Skip to contentSkip to conversation

nativesdk-libtool: sanitize the script, remove buildpaths

PATCH Superseded Denys Dmytriyenko 2 participants 3 messages Jul 16, 2024 – Jul 17, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nativesdk-libtool: sanitize the script, remove buildpaths

From: Denys Dmytriyenko <[email protected]>

Copy the same sed command to sanitize libtool script from target recipe to nativesdk one. Otherwise fails with buildpaths QA error:

ERROR: nativesdk-libtool-2.5.0-r0 do_package_qa: QA Issue: File /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/libtool in package nativesdk-libtool contains reference to TMPDIR [buildpaths]

---
 .../libtool/nativesdk-libtool_2.5.0.bb               | 12 ++++++++++++
 1 file changed, 12 insertions(+)
meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb +12 -0
index ddb60e717c..69de7a8e40 100644
@@ -13,6 +13,18 @@ do_install () {
 	autotools_do_install
 	install -d ${D}${bindir}/
 	install -m 0755 libtool ${D}${bindir}/
+
+	sed -e 's@--sysroot=${STAGING_DIR_HOST}@@g' \
+	    -e "s@${DEBUG_PREFIX_MAP}@@g" \
+	    -e 's@${STAGING_DIR_HOST}@@g' \
+	    -e 's@${STAGING_DIR_NATIVE}@@g' \
+	    -e 's@^\(sys_lib_search_path_spec="\).*@\1${libdir} ${base_libdir}"@' \
+	    -e 's@^\(compiler_lib_search_dirs="\).*@\1${libdir} ${base_libdir}"@' \
+	    -e 's@^\(compiler_lib_search_path="\).*@\1${libdir} ${base_libdir}"@' \
+	    -e 's@^\(predep_objects="\).*@\1"@' \
+	    -e 's@^\(postdep_objects="\).*@\1"@' \
+	    -e "s@${HOSTTOOLS_DIR}/@@g" \
+	    -i ${D}${bindir}/libtool
 }
 
 SYSROOT_PREPROCESS_FUNCS += "libtoolnativesdk_sysroot_preprocess"
Signature · 1 line
2.25.1
#1 lore raw
Quoted 32 lines · Denys Dmytriyenko via lists.openembedded.org

From: Denys Dmytriyenko <[email protected]>

Copy the same sed command to sanitize libtool script from target recipe to nativesdk one. Otherwise fails with buildpaths QA error:

ERROR: nativesdk-libtool-2.5.0-r0 do_package_qa: QA Issue: File /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/libtool in package nativesdk-libtool contains reference to TMPDIR [buildpaths]

---
 .../libtool/nativesdk-libtool_2.5.0.bb               | 12 ++++++++++++

 1 file changed, 12 insertions(+)
meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb +0 -0
index ddb60e717c..69de7a8e40 100644
@@ -13,6 +13,18 @@ do_install () {

  autotools_do_install
  install -d ${D}${bindir}/
  install -m 0755 libtool ${D}${bindir}/

meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb +12 -0
+
+	sed -e 's@--sysroot=${STAGING_DIR_HOST}@@g' \
+	    -e "s@${DEBUG_PREFIX_MAP}@@g" \
+	    -e 's@${STAGING_DIR_HOST}@@g' \
+	    -e 's@${STAGING_DIR_NATIVE}@@g' \
+	    -e 's@^\(sys_lib_search_path_spec="\).*@\1${libdir} ${base_libdir}"@' \
+	    -e 's@^\(compiler_lib_search_dirs="\).*@\1${libdir} ${base_libdir}"@' \
+	    -e 's@^\(compiler_lib_search_path="\).*@\1${libdir} ${base_libdir}"@' \
+	    -e 's@^\(predep_objects="\).*@\1"@' \
+	    -e 's@^\(postdep_objects="\).*@\1"@' \
+	    -e "s@${HOSTTOOLS_DIR}/@@g" \
+	    -i ${D}${bindir}/libtool
Quoted 4 lines

 }

 SYSROOT_PREPROCESS_FUNCS += "libtoolnativesdk_sysroot_preprocess"

Rather than duplicate code, particularly long commands like this, it should be moved to a function and called from both locations.

Cheers,

Richard

#2 lore raw
Quoted 32 lines · Richard Purdie
Quoted 31 lines · Denys Dmytriyenko via lists.openembedded.org

From: Denys Dmytriyenko <[email protected]>

Copy the same sed command to sanitize libtool script from target recipe to nativesdk one. Otherwise fails with buildpaths QA error:

ERROR: nativesdk-libtool-2.5.0-r0 do_package_qa: QA Issue: File /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/libtool in package nativesdk-libtool contains reference to TMPDIR [buildpaths]

---
 .../libtool/nativesdk-libtool_2.5.0.bb               | 12 ++++++++++++

 1 file changed, 12 insertions(+)
meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb +0 -0
index ddb60e717c..69de7a8e40 100644
@@ -13,6 +13,18 @@ do_install () {

  autotools_do_install
  install -d ${D}${bindir}/
  install -m 0755 libtool ${D}${bindir}/

meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb +11 -0
+
+	sed -e 's@--sysroot=${STAGING_DIR_HOST}@@g' \
+	    -e "s@${DEBUG_PREFIX_MAP}@@g" \
+	    -e 's@${STAGING_DIR_HOST}@@g' \
+	    -e 's@${STAGING_DIR_NATIVE}@@g' \
+	    -e 's@^\(sys_lib_search_path_spec="\).*@\1${libdir} ${base_libdir}"@' \
+	    -e 's@^\(compiler_lib_search_dirs="\).*@\1${libdir} ${base_libdir}"@' \
+	    -e 's@^\(compiler_lib_search_path="\).*@\1${libdir} ${base_libdir}"@' \
+	    -e 's@^\(predep_objects="\).*@\1"@' \
+	    -e 's@^\(postdep_objects="\).*@\1"@' \
+	    -e "s@${HOSTTOOLS_DIR}/@@g" \
Quoted 8 lines
Quoted 5 lines
meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb +1 -0
+	    -i ${D}${bindir}/libtool

 }

 SYSROOT_PREPROCESS_FUNCS += "libtoolnativesdk_sysroot_preprocess"

Rather than duplicate code, particularly long commands like this, it should be moved to a function and called from both locations.

v2 submitted.

Signature · 1 line
Denys