summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2019-11-25 06:58:00 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-29 17:43:40 +0000
commitdecb74d362849ece8f93f40c1c36cbcbcd188927 (patch)
treee77eac9b29252217579e770474a156a68cbd1f79 /meta/recipes-devtools/gcc
parent5507707f0d36a612992758dabd58d68a72ab0cfc (diff)
downloadpoky-decb74d362849ece8f93f40c1c36cbcbcd188927.tar.gz
gcc-cross.inc: Prevent native sysroot from leaking into configargs.h
Prevent the native(sdk) sysroot path from leaking into configargs.h. The configargs.h header is intended to be static and unchanged as the content is used as a means of determining that a gcc plugin is built for the same gcc. This also effects the output of 'gcc --version'. Due to per recipe sysroots and staging, the sysroot path would be replaced with the sysroot local to the recipe thus changing the content of configargs.h. The sysroot path is replaced with a generic "/host" prefix which represents the host sysroot (e.g. native or nativesdk). (From OE-Core rev: 84a78f46d59447eeec3d69532a7506148f64c979) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross.inc7
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime.inc4
2 files changed, 7 insertions, 4 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index 8855bb1f34..06ba3ccd15 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -61,6 +61,13 @@ do_compile () {
61 export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" 61 export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
62 export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" 62 export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
63 63
64 # Prevent native/host sysroot path from being used in configargs.h header,
65 # as it will be rewritten when used by other sysroots preventing support
66 # for gcc plugins
67 oe_runmake configure-gcc
68 sed -i 's@${STAGING_DIR_TARGET}@/host@g' ${B}/gcc/configargs.h
69 sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/configargs.h
70
64 oe_runmake all-host configure-target-libgcc 71 oe_runmake all-host configure-target-libgcc
65 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h) 72 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
66 # now generate script to drive testing 73 # now generate script to drive testing
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index 437a9df08a..d3f8ae8b9b 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -302,10 +302,6 @@ do_check() {
302 302
303 # HACK: this works around the configure setting CXX with -nostd* args 303 # HACK: this works around the configure setting CXX with -nostd* args
304 sed -i 's/-nostdinc++ -nostdlib++//g' $(find ${B} -name testsuite_flags | head -1) 304 sed -i 's/-nostdinc++ -nostdlib++//g' $(find ${B} -name testsuite_flags | head -1)
305 # HACK: this works around the de-stashing changes to configargs.h, as well as recipe-sysroot changing the content
306 sed -i '/static const char configuration_arguments/d' ${B}/gcc/configargs.h
307 ${CC} -v 2>&1 | grep "^Configured with:" | \
308 sed 's/Configured with: \(.*\)/static const char configuration_arguments[] = "\1";/g' >> ${B}/gcc/configargs.h
309 305
310 if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then 306 if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then
311 # qemu user has issues allocating large amounts of memory 307 # qemu user has issues allocating large amounts of memory