Skip to contentSkip to conversation

bash/flex: Ensure BUILD_FLAGS doesn't leak onto target

PATCH New Richard Purdie 1 participant 1 message Mar 18, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bash/flex: Ensure BUILD_FLAGS doesn't leak onto target

The ptest packages were leaking BUILD_LDFLAGS into the Makefile used on target. Remove these values instead.

---
 meta/recipes-devtools/flex/flex_2.6.4.bb | 1 +
 meta/recipes-extended/bash/bash.inc      | 1 +
 2 files changed, 2 insertions(+)
meta/recipes-devtools/flex/flex_2.6.4.bb +1 -0
index 1ac88d65ef8..f7d4ef1f085 100644
@@ -68,6 +68,7 @@ do_install_ptest() {
 	sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
 	    -e 's|${DEBUG_PREFIX_MAP}||g' \
 	    -e 's:${HOSTTOOLS_DIR}/::g' \
+	    -e 's:\(^LDFLAGS_FOR_BUILD =\).*:\1:g' \
 	    -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
 	    -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \-e 's/^Makefile:/_Makefile:/' \
 	    -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/^top_srcdir = \(.*\)/top_srcdir = ./' \
meta/recipes-extended/bash/bash.inc +1 -0
index 2c3e6055113..7832ad052b9 100644
@@ -102,6 +102,7 @@ do_install_ptest () {
 	install -D ${WORKDIR}/run-bash-ptests ${D}${PTEST_PATH}/run-bash-ptests
         sed -i -e 's/^Makefile/_Makefile/' -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
 	    -e 's|${DEBUG_PREFIX_MAP}||g' \
+	    -e 's|${BUILD_LDFLAGS}||g' \
 	    -e "s,${S},,g" -e "s,${B},,g" -e "s,${STAGING_DIR_NATIVE},,g" \
 	    -e 's:${HOSTTOOLS_DIR}/::g' \
 	    -e 's:${UNINATIVE_LOADER}:${base_bindir}/false:g' \
Signature · 1 line
2.40.1