gcc: Improve build reproduciblity

Prevent the gcc embedded checksum from containing a checksum that was
computed with build specific paths. The checksum-options file included
the value of LINKER/LDFLAGS which contains DEBUG_PREFIX_MAP and
STAGING_DIR_TARGET.

(From OE-Core rev: 0ead8cbdfb96c4fcbefd24c6647d0f50599f45b3)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Nathan Rossi
2019-11-30 10:47:24 +00:00
committed by Richard Purdie
parent eb308499c2
commit 098ef4f019
2 changed files with 14 additions and 0 deletions

View File

@@ -68,6 +68,13 @@ do_compile () {
sed -i 's@${STAGING_DIR_TARGET}@/host@g' ${B}/gcc/configargs.h
sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/configargs.h
# Prevent sysroot/workdir paths from being used in checksum-options.
# checksum-options is used to generate a checksum which is embedded into
# the output binary.
oe_runmake TARGET-gcc=checksum-options all-gcc
sed -i 's@${DEBUG_PREFIX_MAP}@@g' ${B}/gcc/checksum-options
sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/checksum-options
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

View File

@@ -145,6 +145,13 @@ do_compile () {
sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/configargs.h
sed -i 's@${STAGING_DIR_HOST}@/@g' ${B}/gcc/configargs.h
# Prevent sysroot/workdir paths from being used in checksum-options.
# checksum-options is used to generate a checksum which is embedded into
# the output binary.
oe_runmake TARGET-gcc=checksum-options all-gcc
sed -i 's@${DEBUG_PREFIX_MAP}@@g' ${B}/gcc/checksum-options
sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/checksum-options
oe_runmake all-host
}