Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "GNU cc and gcc C compilers" |
| 2 | HOMEPAGE = "http://www.gnu.org/software/gcc/" |
| 3 | SECTION = "devel" |
| 4 | LICENSE = "GPL" |
| 5 | |
| 6 | NATIVEDEPS = "" |
| 7 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 8 | CVE_PRODUCT = "gcc" |
| 9 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 10 | inherit autotools gettext texinfo |
| 11 | |
| 12 | BPN = "gcc" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 13 | COMPILERDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}gcc:do_gcc_stash_builddir" |
| 14 | COMPILERDEP_class-nativesdk = "virtual/${TARGET_PREFIX}gcc-crosssdk:do_gcc_stash_builddir" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 15 | |
| 16 | python extract_stashed_builddir () { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 17 | src = d.expand("${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir-${TARGET_SYS}") |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 18 | dest = d.getVar("B") |
| 19 | oe.path.copyhardlinktree(src, dest) |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 20 | staging_processfixme([src + "/fixmepath"], dest, d.getVar("RECIPE_SYSROOT"), d.getVar("RECIPE_SYSROOT_NATIVE"), d) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 21 | } |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 22 | |
| 23 | def get_gcc_float_setting(bb, d): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 24 | if d.getVar('ARMPKGSFX_EABI') == "hf" and d.getVar('TRANSLATED_TARGET_ARCH') == "arm": |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | return "--with-float=hard" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 26 | if d.getVar('TARGET_FPU') in [ 'soft' ]: |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 27 | return "--with-float=soft" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 28 | if d.getVar('TARGET_FPU') in [ 'ppc-efd' ]: |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 29 | return "--enable-e500_double" |
| 30 | return "" |
| 31 | |
| 32 | get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}" |
| 33 | |
| 34 | def get_gcc_mips_plt_setting(bb, d): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 35 | if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d): |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | return "--with-mips-plt" |
| 37 | return "" |
| 38 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 39 | def get_gcc_ppc_plt_settings(bb, d): |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 40 | if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'powerpc', 'powerpc64' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d): |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 41 | return "--enable-secureplt" |
| 42 | return "" |
| 43 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 44 | def get_gcc_multiarch_setting(bb, d): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 45 | target_arch = d.getVar('TRANSLATED_TARGET_ARCH') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 46 | multiarch_options = { |
| 47 | "i586": "--enable-targets=all", |
| 48 | "i686": "--enable-targets=all", |
| 49 | "powerpc": "--enable-targets=powerpc64", |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 50 | "powerpc64le": "--enable-targets=powerpcle", |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | "mips": "--enable-targets=all", |
| 52 | "sparc": "--enable-targets=all", |
| 53 | } |
| 54 | |
| 55 | if bb.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d): |
| 56 | if target_arch in multiarch_options : |
| 57 | return multiarch_options[target_arch] |
| 58 | return "" |
| 59 | |
| 60 | # this is used by the multilib setup of gcc |
| 61 | def get_tune_parameters(tune, d): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 62 | availtunes = d.getVar('AVAILTUNES') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 63 | if tune not in availtunes.split(): |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 64 | bb.error('The tune: %s is not one of the available tunes: %s' % (tune or None, availtunes)) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 65 | |
| 66 | localdata = bb.data.createCopy(d) |
| 67 | override = ':tune-' + tune |
| 68 | localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 69 | |
| 70 | retdict = {} |
| 71 | retdict['tune'] = tune |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 72 | retdict['ccargs'] = localdata.getVar('TUNE_CCARGS') |
| 73 | retdict['features'] = localdata.getVar('TUNE_FEATURES') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 74 | # BASELIB is used by the multilib code to change library paths |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 75 | retdict['baselib'] = localdata.getVar('BASE_LIB') or localdata.getVar('BASELIB') |
| 76 | retdict['arch'] = localdata.getVar('TUNE_ARCH') |
| 77 | retdict['abiextension'] = localdata.getVar('ABIEXTENSION') |
| 78 | retdict['target_fpu'] = localdata.getVar('TARGET_FPU') |
| 79 | retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH') |
| 80 | retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 81 | return retdict |
| 82 | |
| 83 | get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS" |
| 84 | |
| 85 | DEBIANNAME_${MLPREFIX}libgcc = "libgcc1" |
| 86 | |
| 87 | MIRRORS =+ "\ |
| 88 | ${GNU_MIRROR}/gcc ftp://gcc.gnu.org/pub/gcc/releases/ \n \ |
| 89 | ${GNU_MIRROR}/gcc ftp://gd.tuwien.ac.at/gnu/gcc/ \n \ |
| 90 | ${GNU_MIRROR}/gcc http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \ |
| 91 | ${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \ |
| 92 | ${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \ |
| 93 | " |
| 94 | # |
| 95 | # Set some default values |
| 96 | # |
| 97 | gcclibdir = "${libdir}/gcc" |
| 98 | BINV = "${PV}" |
| 99 | #S = "${WORKDIR}/gcc-${PV}" |
| 100 | S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 101 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 102 | B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" |
| 103 | |
| 104 | target_includedir ?= "${includedir}" |
| 105 | target_libdir ?= "${libdir}" |
| 106 | target_base_libdir ?= "${base_libdir}" |
| 107 | target_prefix ?= "${prefix}" |
| 108 | |
| 109 | # We need to ensure that for the shared work directory, the do_patch signatures match |
| 110 | # The real WORKDIR location isn't a dependency for the shared workdir. |
| 111 | src_patches[vardepsexclude] = "WORKDIR" |
| 112 | should_apply[vardepsexclude] += "PN" |