diff mbox series

gcc: Fix configargs.h build arch contamination

Message ID 20260924141745.1027540-1-richard.purdie@linuxfoundation.org
State New
Headers show
Series gcc: Fix configargs.h build arch contamination | expand

Commit Message

Richard Purdie Sept. 24, 2026, 2:17 p.m. UTC
The --build= option to configure is leaking into target binaries, which means
different host architectures generate different output. Fix this by removing that
part of the string alongside the other patch changes we already make.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-common.inc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index a7f01cd045e..41a8177e0c3 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -125,8 +125,10 @@  remove_sysroot_paths_from_configargs () {
 	# 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}@$replacement@g" ${B}/gcc/configargs.h
-	sed -i "s@${STAGING_DIR_HOST}@/$replacement@g" ${B}/gcc/configargs.h
+	sed -i -e "s@${STAGING_DIR_TARGET}@$replacement@g" \
+	       -e "s@${STAGING_DIR_HOST}@/$replacement@g" \
+	       -e "s@--build=${BUILD_ARCH}@@g" \
+	           ${B}/gcc/configargs.h
 }
 
 remove_sysroot_paths_from_checksum_options () {