public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] nativesdk-libtool: sanitize the script, remove buildpaths
@ 2024-07-16 22:09 Denys Dmytriyenko
  2024-07-17  6:29 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Denys Dmytriyenko @ 2024-07-16 22:09 UTC (permalink / raw)
  To: openembedded-core; +Cc: Denys Dmytriyenko

From: Denys Dmytriyenko <denys@konsulko.com>

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]

Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
---
 .../libtool/nativesdk-libtool_2.5.0.bb               | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb b/meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb
index ddb60e717c..69de7a8e40 100644
--- a/meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb
+++ b/meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb
@@ -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"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] nativesdk-libtool: sanitize the script, remove buildpaths
  2024-07-16 22:09 [PATCH] nativesdk-libtool: sanitize the script, remove buildpaths Denys Dmytriyenko
@ 2024-07-17  6:29 ` Richard Purdie
  2024-07-17 17:16   ` Denys Dmytriyenko
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2024-07-17  6:29 UTC (permalink / raw)
  To: denis, openembedded-core; +Cc: Denys Dmytriyenko

On Tue, 2024-07-16 at 18:09 -0400, Denys Dmytriyenko via lists.openembedded.org wrote:
> From: Denys Dmytriyenko <denys@konsulko.com>
> 
> 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]
> 
> Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
> ---
>  .../libtool/nativesdk-libtool_2.5.0.bb               | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb b/meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb
> index ddb60e717c..69de7a8e40 100644
> --- a/meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb
> +++ b/meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb
> @@ -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"
> 

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

Cheers,

Richard


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] nativesdk-libtool: sanitize the script, remove buildpaths
  2024-07-17  6:29 ` [OE-core] " Richard Purdie
@ 2024-07-17 17:16   ` Denys Dmytriyenko
  0 siblings, 0 replies; 3+ messages in thread
From: Denys Dmytriyenko @ 2024-07-17 17:16 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On Wed, Jul 17, 2024 at 07:29:45AM +0100, Richard Purdie wrote:
> On Tue, 2024-07-16 at 18:09 -0400, Denys Dmytriyenko via lists.openembedded.org wrote:
> > From: Denys Dmytriyenko <denys@konsulko.com>
> > 
> > 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]
> > 
> > Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
> > ---
> >  .../libtool/nativesdk-libtool_2.5.0.bb               | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb b/meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb
> > index ddb60e717c..69de7a8e40 100644
> > --- a/meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb
> > +++ b/meta/recipes-devtools/libtool/nativesdk-libtool_2.5.0.bb
> > @@ -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"
> > 
> 
> Rather than duplicate code, particularly long commands like this, it
> should be moved to a function and called from both locations.

v2 submitted.

-- 
Denys


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-17 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-16 22:09 [PATCH] nativesdk-libtool: sanitize the script, remove buildpaths Denys Dmytriyenko
2024-07-17  6:29 ` [OE-core] " Richard Purdie
2024-07-17 17:16   ` Denys Dmytriyenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox