[OE-core][scarthgap 5/5] nativesdk-libtool: sanitize the script, remove buildpaths

Steve Sakoman
2025-03-21T15:04:50Z

From: Denys Dmytriyenko <denys@konsulko.com>

Use the same sed command to sanitize libtool script for target recipe
and 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]

(From OE-Core rev: f08df9adf290fb6cbebff24df6bbbbe8e5ce95e0)

Upstream-Status: Backport[https://git.yoctoproject.org/poky/commit/?id=89e184da6c9d95a99fd34334df5ac6c5ae87f13a]

Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 89e184da6c9d95a99fd34334df5ac6c5ae87f13a)
Signed-off-by: Nikhil R <nikhilr5@kpit.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
meta/recipes-devtools/libtool/libtool_2.4.7.bb | 15 +--------------
.../libtool/nativesdk-libtool_2.4.7.bb | 1 +
.../libtool/remove-buildpaths.inc | 13 +++++++++++++
3 files changed, 15 insertions(+), 14 deletions(-)
create mode 100644 meta/recipes-devtools/libtool/remove-buildpaths.inc

diff --git a/meta/recipes-devtools/libtool/libtool_2.4.7.bb b/meta/recipes-devtools/libtool/libtool_2.4.7.bb
index 44a4950574..c1e315aece 100644
--- a/meta/recipes-devtools/libtool/libtool_2.4.7.bb
+++ b/meta/recipes-devtools/libtool/libtool_2.4.7.bb
@@ -1,4 +1,5 @@
require libtool-${PV}.inc
+require remove-buildpaths.inc

SRC_URI += "file://multilib.patch"

@@ -15,20 +16,6 @@ SYSROOT_DIRS_IGNORE += " \

ACLOCALEXTRAPATH:class-target = ""

-do_install:append () {
- 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
-}
-
inherit multilib_script

MULTILIB_SCRIPTS = "${PN}:${bindir}/libtool"
diff --git a/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.7.bb b/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.7.bb
index 86c55ded7b..ac460decf6 100644
--- a/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.7.bb
+++ b/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.7.bb
@@ -1,4 +1,5 @@
require libtool-${PV}.inc
+require remove-buildpaths.inc

FILESEXTRAPATHS =. "${FILE_DIRNAME}/libtool:"

diff --git a/meta/recipes-devtools/libtool/remove-buildpaths.inc b/meta/recipes-devtools/libtool/remove-buildpaths.inc
new file mode 100644
index 0000000000..1ca95aeace
--- /dev/null
+++ b/meta/recipes-devtools/libtool/remove-buildpaths.inc
@@ -0,0 +1,13 @@
+do_install:append () {
+ 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
+}
--
2.43.0