diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-common.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-common.inc | 53 |
1 files changed, 43 insertions, 10 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc index 629fa26dfe..8d95698743 100644 --- a/meta/recipes-devtools/gcc/gcc-common.inc +++ b/meta/recipes-devtools/gcc/gcc-common.inc | |||
@@ -11,8 +11,8 @@ CVE_PRODUCT = "gcc" | |||
11 | inherit autotools gettext texinfo | 11 | inherit autotools gettext texinfo |
12 | 12 | ||
13 | BPN = "gcc" | 13 | BPN = "gcc" |
14 | COMPILERDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}gcc:do_gcc_stash_builddir" | 14 | COMPILERDEP = "${MLPREFIX}gcc-cross-${TARGET_ARCH}:do_gcc_stash_builddir" |
15 | COMPILERDEP_class-nativesdk = "virtual/${TARGET_PREFIX}gcc-crosssdk:do_gcc_stash_builddir" | 15 | COMPILERDEP:class-nativesdk = "gcc-crosssdk-${SDK_SYS}:do_gcc_stash_builddir" |
16 | 16 | ||
17 | python extract_stashed_builddir () { | 17 | python extract_stashed_builddir () { |
18 | src = d.expand("${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir-${TARGET_SYS}") | 18 | src = d.expand("${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir-${TARGET_SYS}") |
@@ -32,6 +32,16 @@ def get_gcc_float_setting(bb, d): | |||
32 | 32 | ||
33 | get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}" | 33 | get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}" |
34 | 34 | ||
35 | def get_gcc_x86_64_arch_setting(bb, d): | ||
36 | import re | ||
37 | march = re.match(r'^.*-march=([^\s]*)', d.getVar('TUNE_CCARGS')) | ||
38 | if march: | ||
39 | return "--with-arch=%s " % march.group(1) | ||
40 | # The earliest supported x86-64 CPU | ||
41 | return "--with-arch=core2" | ||
42 | |||
43 | get_gcc_x86_64_arch_setting[vardepvalue] = "${@get_gcc_x86_64_arch_setting(bb, d)}" | ||
44 | |||
35 | def get_gcc_mips_plt_setting(bb, d): | 45 | def get_gcc_mips_plt_setting(bb, d): |
36 | if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d): | 46 | if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d): |
37 | return "--with-mips-plt" | 47 | return "--with-mips-plt" |
@@ -83,14 +93,10 @@ def get_tune_parameters(tune, d): | |||
83 | 93 | ||
84 | get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS" | 94 | get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS" |
85 | 95 | ||
86 | DEBIANNAME_${MLPREFIX}libgcc = "libgcc1" | 96 | DEBIANNAME:${MLPREFIX}libgcc = "libgcc1" |
87 | 97 | ||
88 | MIRRORS =+ "\ | 98 | MIRRORS =+ "\ |
89 | ${GNU_MIRROR}/gcc ftp://gcc.gnu.org/pub/gcc/releases/ \n \ | 99 | ${GNU_MIRROR}/gcc https://gcc.gnu.org/pub/gcc/releases/ \ |
90 | ${GNU_MIRROR}/gcc ftp://gd.tuwien.ac.at/gnu/gcc/ \n \ | ||
91 | ${GNU_MIRROR}/gcc http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \ | ||
92 | ${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \ | ||
93 | ${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \ | ||
94 | " | 100 | " |
95 | # | 101 | # |
96 | # Set some default values | 102 | # Set some default values |
@@ -98,9 +104,10 @@ ${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \ | |||
98 | gcclibdir = "${libdir}/gcc" | 104 | gcclibdir = "${libdir}/gcc" |
99 | BINV = "${PV}" | 105 | BINV = "${PV}" |
100 | #S = "${WORKDIR}/gcc-${PV}" | 106 | #S = "${WORKDIR}/gcc-${PV}" |
101 | S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" | 107 | UNPACKDIR = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/sources" |
108 | S = "${UNPACKDIR}/gcc-${PV}" | ||
102 | 109 | ||
103 | B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" | 110 | B ?= "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" |
104 | 111 | ||
105 | target_includedir ?= "${includedir}" | 112 | target_includedir ?= "${includedir}" |
106 | target_libdir ?= "${libdir}" | 113 | target_libdir ?= "${libdir}" |
@@ -111,3 +118,29 @@ target_prefix ?= "${prefix}" | |||
111 | # The real WORKDIR location isn't a dependency for the shared workdir. | 118 | # The real WORKDIR location isn't a dependency for the shared workdir. |
112 | src_patches[vardepsexclude] = "WORKDIR" | 119 | src_patches[vardepsexclude] = "WORKDIR" |
113 | should_apply[vardepsexclude] += "PN" | 120 | should_apply[vardepsexclude] += "PN" |
121 | |||
122 | remove_sysroot_paths_from_configargs () { | ||
123 | replacement=${1} | ||
124 | # Prevent sysroot path from being used in configargs.h header, as it will | ||
125 | # be rewritten when used by other sysroots preventing support for gcc | ||
126 | # plugins. Additionally the path is embeddeded into the output binary, this | ||
127 | # prevents building a reproducible binary. | ||
128 | oe_runmake configure-gcc | ||
129 | sed -i "s@${STAGING_DIR_TARGET}@$replacement@g" ${B}/gcc/configargs.h | ||
130 | sed -i "s@${STAGING_DIR_HOST}@/$replacement@g" ${B}/gcc/configargs.h | ||
131 | } | ||
132 | |||
133 | remove_sysroot_paths_from_checksum_options () { | ||
134 | stagingdir=${1} | ||
135 | replacement=${2} | ||
136 | # Prevent sysroot/workdir paths from being used in checksum-options. | ||
137 | # checksum-options is used to generate a checksum which is embedded into | ||
138 | # the output binary. | ||
139 | oe_runmake TARGET-gcc=checksum-options all-gcc | ||
140 | sed -i "s@${DEBUG_PREFIX_MAP}@@g" ${B}/gcc/checksum-options | ||
141 | sed -i "s@$stagingdir@$replacement@g" ${B}/gcc/checksum-options | ||
142 | } | ||
143 | |||
144 | cleanup_installed_include_fixed () { | ||
145 | find ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed -type f -not -name "README" -not -name limits.h -not -name syslimits.h | xargs rm -f | ||
146 | } | ||