]> code.ossystems Code Review - openembedded-core.git/commitdiff
gcc-cross.inc: Prevent native sysroot from leaking into configargs.h
authorNathan Rossi <nathan@nathanrossi.com>
Mon, 25 Nov 2019 06:58:00 +0000 (06:58 +0000)
committerArmin Kuster <akuster808@gmail.com>
Sun, 15 Mar 2020 20:33:19 +0000 (13:33 -0700)
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).

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
(cherry picked from commit 84a78f46d59447eeec3d69532a7506148f64c979)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/recipes-devtools/gcc/gcc-cross.inc
meta/recipes-devtools/gcc/gcc-runtime.inc

index 8855bb1f34a8bc4826b6bc94520d85956c3b0d3d..06ba3ccd154f4cf26bd3c32cbe0b75b71427ab94 100644 (file)
@@ -61,6 +61,13 @@ do_compile () {
        export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
        export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
 
+       # Prevent native/host sysroot path from being used in configargs.h header,
+       # as it will be rewritten when used by other sysroots preventing support
+       # for gcc plugins
+       oe_runmake configure-gcc
+       sed -i 's@${STAGING_DIR_TARGET}@/host@g' ${B}/gcc/configargs.h
+       sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/configargs.h
+
        oe_runmake all-host configure-target-libgcc
        (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
        # now generate script to drive testing
index 2da3c02ef02a89c08fd63aee5267b47b927f0d28..536b18d97fbb57e7ac072dfc0c7b6c68fadd93cc 100644 (file)
@@ -302,10 +302,6 @@ do_check() {
 
     # HACK: this works around the configure setting CXX with -nostd* args
     sed -i 's/-nostdinc++ -nostdlib++//g' $(find ${B} -name testsuite_flags | head -1)
-    # HACK: this works around the de-stashing changes to configargs.h, as well as recipe-sysroot changing the content
-    sed -i '/static const char configuration_arguments/d' ${B}/gcc/configargs.h
-    ${CC} -v 2>&1 | grep "^Configured with:" | \
-        sed 's/Configured with: \(.*\)/static const char configuration_arguments[] = "\1";/g' >> ${B}/gcc/configargs.h
 
     if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then
         # qemu user has issues allocating large amounts of memory