gcc-common.inc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. SUMMARY = "GNU cc and gcc C compilers"
  2. HOMEPAGE = "http://www.gnu.org/software/gcc/"
  3. DESCRIPTION = "The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, Go, and D, as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system."
  4. SECTION = "devel"
  5. LICENSE = "GPL"
  6. NATIVEDEPS = ""
  7. CVE_PRODUCT = "gcc"
  8. inherit autotools gettext texinfo
  9. BPN = "gcc"
  10. COMPILERDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}gcc:do_gcc_stash_builddir"
  11. COMPILERDEP:class-nativesdk = "virtual/${TARGET_PREFIX}gcc-crosssdk:do_gcc_stash_builddir"
  12. python extract_stashed_builddir () {
  13. src = d.expand("${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir-${TARGET_SYS}")
  14. dest = d.getVar("B")
  15. oe.path.copyhardlinktree(src, dest)
  16. staging_processfixme([src + "/fixmepath"], dest, d.getVar("RECIPE_SYSROOT"), d.getVar("RECIPE_SYSROOT_NATIVE"), d)
  17. }
  18. def get_gcc_float_setting(bb, d):
  19. if d.getVar('ARMPKGSFX_EABI') == "hf" and d.getVar('TRANSLATED_TARGET_ARCH') == "arm":
  20. return "--with-float=hard"
  21. if d.getVar('TARGET_FPU') in [ 'soft' ]:
  22. return "--with-float=soft"
  23. if d.getVar('TARGET_FPU') in [ 'ppc-efd' ]:
  24. return "--enable-e500_double"
  25. return ""
  26. get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}"
  27. def get_gcc_mips_plt_setting(bb, d):
  28. if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d):
  29. return "--with-mips-plt"
  30. return ""
  31. def get_gcc_ppc_plt_settings(bb, d):
  32. if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'powerpc', 'powerpc64' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d):
  33. return "--enable-secureplt"
  34. return ""
  35. def get_gcc_multiarch_setting(bb, d):
  36. target_arch = d.getVar('TRANSLATED_TARGET_ARCH')
  37. multiarch_options = {
  38. "i586": "--enable-targets=all",
  39. "i686": "--enable-targets=all",
  40. "powerpc": "--enable-targets=powerpc64",
  41. "powerpc64le": "--enable-targets=powerpcle",
  42. "mips": "--enable-targets=all",
  43. "sparc": "--enable-targets=all",
  44. }
  45. if bb.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d):
  46. if target_arch in multiarch_options :
  47. return multiarch_options[target_arch]
  48. return ""
  49. # this is used by the multilib setup of gcc
  50. def get_tune_parameters(tune, d):
  51. availtunes = d.getVar('AVAILTUNES')
  52. if tune not in availtunes.split():
  53. bb.error('The tune: %s is not one of the available tunes: %s' % (tune or None, availtunes))
  54. localdata = bb.data.createCopy(d)
  55. override = ':tune-' + tune
  56. localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override)
  57. retdict = {}
  58. retdict['tune'] = tune
  59. retdict['ccargs'] = localdata.getVar('TUNE_CCARGS')
  60. retdict['features'] = localdata.getVar('TUNE_FEATURES')
  61. # BASELIB is used by the multilib code to change library paths
  62. retdict['baselib'] = localdata.getVar('BASE_LIB') or localdata.getVar('BASELIB')
  63. retdict['arch'] = localdata.getVar('TUNE_ARCH')
  64. retdict['abiextension'] = localdata.getVar('ABIEXTENSION')
  65. retdict['target_fpu'] = localdata.getVar('TARGET_FPU')
  66. retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH')
  67. retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS')
  68. return retdict
  69. get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS"
  70. DEBIANNAME:${MLPREFIX}libgcc = "libgcc1"
  71. MIRRORS =+ "\
  72. ${GNU_MIRROR}/gcc https://gcc.gnu.org/pub/gcc/releases/ \
  73. "
  74. #
  75. # Set some default values
  76. #
  77. gcclibdir = "${libdir}/gcc"
  78. BINV = "${PV}"
  79. #S = "${WORKDIR}/gcc-${PV}"
  80. S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
  81. B ?= "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
  82. target_includedir ?= "${includedir}"
  83. target_libdir ?= "${libdir}"
  84. target_base_libdir ?= "${base_libdir}"
  85. target_prefix ?= "${prefix}"
  86. # We need to ensure that for the shared work directory, the do_patch signatures match
  87. # The real WORKDIR location isn't a dependency for the shared workdir.
  88. src_patches[vardepsexclude] = "WORKDIR"
  89. should_apply[vardepsexclude] += "PN"