diff mbox series

[scarthgap,2/2] gcc-cross-canadian.inc: Fix buildpaths error for pthread.h

Message ID 20250314092755.22607-2-sanakazi720@gmail.com
State Under Review
Delegated to: Steve Sakoman
Headers show
Series [scarthgap,1/2] gcc: remove paths to sysroot from configargs.h and checksum-options for gcc-cross-canadian | expand

Commit Message

Sana Kazi March 14, 2025, 9:27 a.m. UTC
Replace the hardcoded path with /not/exist as used for other
options[--with-sysroot] to ensure pthread.h does not contain
hardocded references to TMPDIR:

ERROR: gcc-cross-canadian-x86-64-13.3.0-r0 do_package_qa: QA Issue:
File /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/
usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/13.3.0/include-fixed/
pthread.h in package gcc-cross-canadian-x86-64 contains reference to
TMPDIR [buildpaths]

Signed-off-by: Sana Kazi <sanakazi720@gmail.com>
---
 meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
index adcaef2b0f..06f0cef864 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -118,6 +118,11 @@  do_install () {
 	# We don't care about the gcc-<version> copies
 	rm -f ${D}${bindir}/*gcc-${BINV}*
 
+        # Remove buildpaths from pthread.h
+        sed -i -e "s|${RECIPE_SYSROOT_NATIVE}|/not/exist|g" \
+        -e "s|${RECIPE_SYSROOT}|/not/exist|g" \
+        ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed/pthread.h
+
 	# Cleanup empty directories which are not shipped
 	# we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted
 	# ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686