summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-common.inc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-common.inc53
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"
11inherit autotools gettext texinfo 11inherit autotools gettext texinfo
12 12
13BPN = "gcc" 13BPN = "gcc"
14COMPILERDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}gcc:do_gcc_stash_builddir" 14COMPILERDEP = "${MLPREFIX}gcc-cross-${TARGET_ARCH}:do_gcc_stash_builddir"
15COMPILERDEP_class-nativesdk = "virtual/${TARGET_PREFIX}gcc-crosssdk:do_gcc_stash_builddir" 15COMPILERDEP:class-nativesdk = "gcc-crosssdk-${SDK_SYS}:do_gcc_stash_builddir"
16 16
17python extract_stashed_builddir () { 17python 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
33get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}" 33get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}"
34 34
35def 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
43get_gcc_x86_64_arch_setting[vardepvalue] = "${@get_gcc_x86_64_arch_setting(bb, d)}"
44
35def get_gcc_mips_plt_setting(bb, d): 45def 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
84get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS" 94get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS"
85 95
86DEBIANNAME_${MLPREFIX}libgcc = "libgcc1" 96DEBIANNAME:${MLPREFIX}libgcc = "libgcc1"
87 97
88MIRRORS =+ "\ 98MIRRORS =+ "\
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 \
98gcclibdir = "${libdir}/gcc" 104gcclibdir = "${libdir}/gcc"
99BINV = "${PV}" 105BINV = "${PV}"
100#S = "${WORKDIR}/gcc-${PV}" 106#S = "${WORKDIR}/gcc-${PV}"
101S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" 107UNPACKDIR = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/sources"
108S = "${UNPACKDIR}/gcc-${PV}"
102 109
103B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" 110B ?= "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
104 111
105target_includedir ?= "${includedir}" 112target_includedir ?= "${includedir}"
106target_libdir ?= "${libdir}" 113target_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.
112src_patches[vardepsexclude] = "WORKDIR" 119src_patches[vardepsexclude] = "WORKDIR"
113should_apply[vardepsexclude] += "PN" 120should_apply[vardepsexclude] += "PN"
121
122remove_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
133remove_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
144cleanup_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}