[oe-commits] [openembedded-core] 01/18: gcc-target.inc: Prevent sysroot from leaking into configargs.h

git at git.openembedded.org git at git.openembedded.org
Wed Dec 4 12:54:16 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 1924f4eb74d9e8c7d5f2251d26df941481f19c99
Author: Nathan Rossi <nathan at nathanrossi.com>
AuthorDate: Sat Nov 30 10:47:24 2019 +0000

    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 "/".
    
    Signed-off-by: Nathan Rossi <nathan at nathanrossi.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-target.inc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc
index bdc6ff6..987e88d 100644
--- a/meta/recipes-devtools/gcc/gcc-target.inc
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -137,6 +137,14 @@ FILES_${PN}-doc = "\
 "
 
 do_compile () {
+	# Prevent full target sysroot path from being used in configargs.h header,
+	# as it will be rewritten when used by other sysroots preventing support
+	# for gcc plugins. Additionally the path is embeddeded into the output
+	# binary, this prevents building a reproducible binary.
+	oe_runmake configure-gcc
+	sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/configargs.h
+	sed -i 's@${STAGING_DIR_HOST}@/@g' ${B}/gcc/configargs.h
+
 	oe_runmake all-host
 }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list