summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2019-11-30 10:47:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-16 16:44:53 +0000
commit917d2fc42bc57f5f5f50e172a6928823a833ac80 (patch)
tree2ef59cbcdbc03f9ee9e9e26e5be35ec07d5bdf77
parent4dabdf2ff5769fb13468d74be6c6c38ce1d2bdc1 (diff)
downloadpoky-917d2fc42bc57f5f5f50e172a6928823a833ac80.tar.gz
gcc-target.inc: Prevent sysroot from leaking into configargs.h
Prevent the full recipe-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 -v'. 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. This change also improves gcc binary reproducibility. The sysroot path is replaced with the base target root "/". (From OE-Core rev: 0f418fccab3f67a2afaa28195263d6f24831dd56) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b8d6e2ab68ee5e341fe970b191bfd334e6d2c40b) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/gcc/gcc-target.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc
index bdc6ff658f..987e88d32c 100644
--- a/meta/recipes-devtools/gcc/gcc-target.inc
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -137,6 +137,14 @@ FILES_${PN}-doc = "\
137" 137"
138 138
139do_compile () { 139do_compile () {
140 # Prevent full target sysroot path from being used in configargs.h header,
141 # as it will be rewritten when used by other sysroots preventing support
142 # for gcc plugins. Additionally the path is embeddeded into the output
143 # binary, this prevents building a reproducible binary.
144 oe_runmake configure-gcc
145 sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/configargs.h
146 sed -i 's@${STAGING_DIR_HOST}@/@g' ${B}/gcc/configargs.h
147
140 oe_runmake all-host 148 oe_runmake all-host
141} 149}
142 150