Patchwork [1/2] pseudo: Tell pseudo to avoid specifying an RPATH

login
register
mail settings
Submitter Mark Hatle
Date April 12, 2012, 9:21 p.m.
Message ID <3d06ef85d583f8ef824cb7ca91ff070dcddd0e8b.1334265557.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/25701/
State Accepted
Commit ae978e9671fdbcb31e306308bfb816b4bd2b2496
Headers show

Comments

Mark Hatle - April 12, 2012, 9:21 p.m.
[Yocto #2251]

Add --without-rpath to avoid embedding rpaths into the pseudo
components.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/recipes-devtools/pseudo/pseudo.inc    |    8 ++++----
 meta/recipes-devtools/pseudo/pseudo_1.3.bb |    2 +-
 meta/recipes-devtools/pseudo/pseudo_git.bb |    2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Saul Wold - April 13, 2012, 3:13 p.m.
On 04/12/2012 02:21 PM, Mark Hatle wrote:
> [Yocto #2251]
>
> Add --without-rpath to avoid embedding rpaths into the pseudo
> components.
>
> Signed-off-by: Mark Hatle<mark.hatle@windriver.com>
> ---
>   meta/recipes-devtools/pseudo/pseudo.inc    |    8 ++++----
>   meta/recipes-devtools/pseudo/pseudo_1.3.bb |    2 +-
>   meta/recipes-devtools/pseudo/pseudo_git.bb |    2 +-
>   3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-devtools/pseudo/pseudo.inc
> index 664a9b5..d5c33df 100644
> --- a/meta/recipes-devtools/pseudo/pseudo.inc
> +++ b/meta/recipes-devtools/pseudo/pseudo.inc
> @@ -29,9 +29,9 @@ NO32LIBS ??= "0"
>   # Compile for the local machine arch...
>   do_compile () {
>   	if [ "${SITEINFO_BITS}" == "64" ]; then
> -	  ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite
> +	  ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
>   	else
> -	  ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite
> +	  ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
>   	fi
>   	oe_runmake ${MAKEOPTS}
>   }
> @@ -42,7 +42,7 @@ do_compile () {
>   do_compile_prepend_virtclass-native () {
>   	if [ "${SITEINFO_BITS}" == "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" == "pseudo-native" -a "${NO32LIBS}" != "1" ]; then
>   		# We need the 32-bit libpseudo on a 64-bit machine...
> -		./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32
> +		./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
>   		oe_runmake ${MAKEOPTS} libpseudo
>   		# prevent it from removing the lib, but remove everything else
>   		make 'LIB=foo' ${MAKEOPTS} distclean
> @@ -52,7 +52,7 @@ do_compile_prepend_virtclass-native () {
>   do_compile_prepend_virtclass-nativesdk () {
>   	if [ "${SITEINFO_BITS}" == "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" == "pseudo-native" -a "${NO32LIBS}" != "1" ]; then
>   		# We need the 32-bit libpseudo on a 64-bit machine...
> -		./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32
> +		./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
We might still need this rpath or something similar since the nativesdk 
now breaks not finding the correct version of the included libc.so.6

/opt/poky/1.2/sysroots/x86_64-pokysdk-linux/usr/bin/pseudo -P 
/opt/poky/1.2/sysroots/x86_64-pokysdk-linux/usr tar -C "/tmp/opt" -xjf 
"/intel/home/sgw/Downloads/core-image-minimal-qemux86-64.tar.bz2"
tar: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found 
(required by 
/opt/poky/1.2/sysroots/x86_64-pokysdk-linux/usr/lib/pseudo/lib64/libpseudo.so)

See also bug 1968

I do have a libc.so.6.

/opt/poky/1.2/sysroots/x86_64-pokysdk-linux/lib/libc.so.6 -> libc-2.15.so

Sau!

>   		oe_runmake ${MAKEOPTS} libpseudo
>   		# prevent it from removing the lib, but remove everything else
>   		make 'LIB=foo' ${MAKEOPTS} distclean
> diff --git a/meta/recipes-devtools/pseudo/pseudo_1.3.bb b/meta/recipes-devtools/pseudo/pseudo_1.3.bb
> index e7a329c..080b739 100644
> --- a/meta/recipes-devtools/pseudo/pseudo_1.3.bb
> +++ b/meta/recipes-devtools/pseudo/pseudo_1.3.bb
> @@ -1,6 +1,6 @@
>   require pseudo.inc
>
> -PR = "r7"
> +PR = "r8"
>
>   SRC_URI = "http://www.yoctoproject.org/downloads/${BPN}/${BPN}-${PV}.tar.bz2"
>
> diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
> index 9414c79..7857275 100644
> --- a/meta/recipes-devtools/pseudo/pseudo_git.bb
> +++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
> @@ -2,7 +2,7 @@ require pseudo.inc
>
>   SRCREV = "f0375c9aaefbccfd41aebbf6d332bb4d9e8f980c"
>   PV = "1.3+git${SRCPV}"
> -PR = "r22"
> +PR = "r23"
>
>   DEFAULT_PREFERENCE = "-1"
>
Mark Hatle - April 13, 2012, 3:22 p.m.
On 4/13/12 10:13 AM, Saul Wold wrote:
> On 04/12/2012 02:21 PM, Mark Hatle wrote:
>> [Yocto #2251]
>>
>> Add --without-rpath to avoid embedding rpaths into the pseudo
>> components.
>>
>> Signed-off-by: Mark Hatle<mark.hatle@windriver.com>
>> ---
>>    meta/recipes-devtools/pseudo/pseudo.inc    |    8 ++++----
>>    meta/recipes-devtools/pseudo/pseudo_1.3.bb |    2 +-
>>    meta/recipes-devtools/pseudo/pseudo_git.bb |    2 +-
>>    3 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-devtools/pseudo/pseudo.inc
>> index 664a9b5..d5c33df 100644
>> --- a/meta/recipes-devtools/pseudo/pseudo.inc
>> +++ b/meta/recipes-devtools/pseudo/pseudo.inc
>> @@ -29,9 +29,9 @@ NO32LIBS ??= "0"
>>    # Compile for the local machine arch...
>>    do_compile () {
>>    	if [ "${SITEINFO_BITS}" == "64" ]; then
>> -	  ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite
>> +	  ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
>>    	else
>> -	  ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite
>> +	  ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
>>    	fi
>>    	oe_runmake ${MAKEOPTS}
>>    }
>> @@ -42,7 +42,7 @@ do_compile () {
>>    do_compile_prepend_virtclass-native () {
>>    	if [ "${SITEINFO_BITS}" == "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" == "pseudo-native" -a "${NO32LIBS}" != "1" ]; then
>>    		# We need the 32-bit libpseudo on a 64-bit machine...
>> -		./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32
>> +		./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
>>    		oe_runmake ${MAKEOPTS} libpseudo
>>    		# prevent it from removing the lib, but remove everything else
>>    		make 'LIB=foo' ${MAKEOPTS} distclean
>> @@ -52,7 +52,7 @@ do_compile_prepend_virtclass-native () {
>>    do_compile_prepend_virtclass-nativesdk () {
>>    	if [ "${SITEINFO_BITS}" == "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" == "pseudo-native" -a "${NO32LIBS}" != "1" ]; then
>>    		# We need the 32-bit libpseudo on a 64-bit machine...
>> -		./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32
>> +		./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
> We might still need this rpath or something similar since the nativesdk
> now breaks not finding the correct version of the included libc.so.6

In this case, I don't think embedding a static RPATH makes sense, but perhaps a 
$ORIGIN path might?

Can chrpath be used to add an rpath after compilation and linking, if so that is 
what I would suggest to do.  Otherwise I'm not exactly sure how to resolve this...

Note, typically pseudo is -not- linked the "sdk" version of the libc, but is 
linked to the host libc.  In the past when exporting and sdk with something like 
pseudo you needed to either build on a common machine (where everything was 
compatible) or have a way to rebuild pseudo on the final target system.  Perhaps 
that is what is needed?

--Mark

> /opt/poky/1.2/sysroots/x86_64-pokysdk-linux/usr/bin/pseudo -P
> /opt/poky/1.2/sysroots/x86_64-pokysdk-linux/usr tar -C "/tmp/opt" -xjf
> "/intel/home/sgw/Downloads/core-image-minimal-qemux86-64.tar.bz2"
> tar: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found
> (required by
> /opt/poky/1.2/sysroots/x86_64-pokysdk-linux/usr/lib/pseudo/lib64/libpseudo.so)
>
> See also bug 1968
>
> I do have a libc.so.6.
>
> /opt/poky/1.2/sysroots/x86_64-pokysdk-linux/lib/libc.so.6 ->  libc-2.15.so
>
> Sau!
>
>>    		oe_runmake ${MAKEOPTS} libpseudo
>>    		# prevent it from removing the lib, but remove everything else
>>    		make 'LIB=foo' ${MAKEOPTS} distclean
>> diff --git a/meta/recipes-devtools/pseudo/pseudo_1.3.bb b/meta/recipes-devtools/pseudo/pseudo_1.3.bb
>> index e7a329c..080b739 100644
>> --- a/meta/recipes-devtools/pseudo/pseudo_1.3.bb
>> +++ b/meta/recipes-devtools/pseudo/pseudo_1.3.bb
>> @@ -1,6 +1,6 @@
>>    require pseudo.inc
>>
>> -PR = "r7"
>> +PR = "r8"
>>
>>    SRC_URI = "http://www.yoctoproject.org/downloads/${BPN}/${BPN}-${PV}.tar.bz2"
>>
>> diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
>> index 9414c79..7857275 100644
>> --- a/meta/recipes-devtools/pseudo/pseudo_git.bb
>> +++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
>> @@ -2,7 +2,7 @@ require pseudo.inc
>>
>>    SRCREV = "f0375c9aaefbccfd41aebbf6d332bb4d9e8f980c"
>>    PV = "1.3+git${SRCPV}"
>> -PR = "r22"
>> +PR = "r23"
>>
>>    DEFAULT_PREFERENCE = "-1"
>>
Richard Purdie - April 13, 2012, 3:33 p.m.
On Fri, 2012-04-13 at 10:22 -0500, Mark Hatle wrote:
> > We might still need this rpath or something similar since the nativesdk
> > now breaks not finding the correct version of the included libc.so.6
> 
> In this case, I don't think embedding a static RPATH makes sense, but perhaps a 
> $ORIGIN path might?
> 
> Can chrpath be used to add an rpath after compilation and linking, if so that is 
> what I would suggest to do.  Otherwise I'm not exactly sure how to resolve this...
> 
> Note, typically pseudo is -not- linked the "sdk" version of the libc, but is 
> linked to the host libc.  In the past when exporting and sdk with something like 
> pseudo you needed to either build on a common machine (where everything was 
> compatible) or have a way to rebuild pseudo on the final target system.  Perhaps 
> that is what is needed?

We need to embed a full static rpath and then our nativesdk relocation
code will then handle adding in the correct $ORIGIN for us.

The way the sdk works, it will link against the sdk libc btw and this
avoids the need to rebuild on the target system. We just need the rpath
in there so it can figure things out correctly.

Cheers,

Richard
Mark Hatle - April 13, 2012, 3:40 p.m.
On 4/13/12 10:33 AM, Richard Purdie wrote:
> On Fri, 2012-04-13 at 10:22 -0500, Mark Hatle wrote:
>>> We might still need this rpath or something similar since the nativesdk
>>> now breaks not finding the correct version of the included libc.so.6
>>
>> In this case, I don't think embedding a static RPATH makes sense, but perhaps a
>> $ORIGIN path might?
>>
>> Can chrpath be used to add an rpath after compilation and linking, if so that is
>> what I would suggest to do.  Otherwise I'm not exactly sure how to resolve this...
>>
>> Note, typically pseudo is -not- linked the "sdk" version of the libc, but is
>> linked to the host libc.  In the past when exporting and sdk with something like
>> pseudo you needed to either build on a common machine (where everything was
>> compatible) or have a way to rebuild pseudo on the final target system.  Perhaps
>> that is what is needed?
>
> We need to embed a full static rpath and then our nativesdk relocation
> code will then handle adding in the correct $ORIGIN for us.
>
> The way the sdk works, it will link against the sdk libc btw and this
> avoids the need to rebuild on the target system. We just need the rpath
> in there so it can figure things out correctly.

Ha, that is what we had (unintentionally) that triggered the QA failure.

If it's only for a nativesdk build, then we simply switch the --without-rpath

--Mark

> Cheers,
>
> Richard
>
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Richard Purdie - April 13, 2012, 3:50 p.m.
On Fri, 2012-04-13 at 10:40 -0500, Mark Hatle wrote:
> On 4/13/12 10:33 AM, Richard Purdie wrote:
> > On Fri, 2012-04-13 at 10:22 -0500, Mark Hatle wrote:
> >>> We might still need this rpath or something similar since the nativesdk
> >>> now breaks not finding the correct version of the included libc.so.6
> >>
> >> In this case, I don't think embedding a static RPATH makes sense, but perhaps a
> >> $ORIGIN path might?
> >>
> >> Can chrpath be used to add an rpath after compilation and linking, if so that is
> >> what I would suggest to do.  Otherwise I'm not exactly sure how to resolve this...
> >>
> >> Note, typically pseudo is -not- linked the "sdk" version of the libc, but is
> >> linked to the host libc.  In the past when exporting and sdk with something like
> >> pseudo you needed to either build on a common machine (where everything was
> >> compatible) or have a way to rebuild pseudo on the final target system.  Perhaps
> >> that is what is needed?
> >
> > We need to embed a full static rpath and then our nativesdk relocation
> > code will then handle adding in the correct $ORIGIN for us.
> >
> > The way the sdk works, it will link against the sdk libc btw and this
> > avoids the need to rebuild on the target system. We just need the rpath
> > in there so it can figure things out correctly.
> 
> Ha, that is what we had (unintentionally) that triggered the QA failure.
> 
> If it's only for a nativesdk build, then we simply switch the --without-rpath

Maybe, maybe not. It depends exactly what rpath its encoding in there.
Previously it looked like it was encoding the sysroot path too (which is
a security hole). We need a target rpath in there and no sysroot path.

Cheers,

Richard

Patch

diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-devtools/pseudo/pseudo.inc
index 664a9b5..d5c33df 100644
--- a/meta/recipes-devtools/pseudo/pseudo.inc
+++ b/meta/recipes-devtools/pseudo/pseudo.inc
@@ -29,9 +29,9 @@  NO32LIBS ??= "0"
 # Compile for the local machine arch...
 do_compile () {
 	if [ "${SITEINFO_BITS}" == "64" ]; then
-	  ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite
+	  ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
 	else
-	  ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite
+	  ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
 	fi
 	oe_runmake ${MAKEOPTS}
 }
@@ -42,7 +42,7 @@  do_compile () {
 do_compile_prepend_virtclass-native () {
 	if [ "${SITEINFO_BITS}" == "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" == "pseudo-native" -a "${NO32LIBS}" != "1" ]; then
 		# We need the 32-bit libpseudo on a 64-bit machine...
-		./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32
+		./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
 		oe_runmake ${MAKEOPTS} libpseudo
 		# prevent it from removing the lib, but remove everything else
 		make 'LIB=foo' ${MAKEOPTS} distclean 
@@ -52,7 +52,7 @@  do_compile_prepend_virtclass-native () {
 do_compile_prepend_virtclass-nativesdk () {
 	if [ "${SITEINFO_BITS}" == "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" == "pseudo-native" -a "${NO32LIBS}" != "1" ]; then
 		# We need the 32-bit libpseudo on a 64-bit machine...
-		./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32
+		./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
 		oe_runmake ${MAKEOPTS} libpseudo
 		# prevent it from removing the lib, but remove everything else
 		make 'LIB=foo' ${MAKEOPTS} distclean 
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.3.bb b/meta/recipes-devtools/pseudo/pseudo_1.3.bb
index e7a329c..080b739 100644
--- a/meta/recipes-devtools/pseudo/pseudo_1.3.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_1.3.bb
@@ -1,6 +1,6 @@ 
 require pseudo.inc
 
-PR = "r7"
+PR = "r8"
 
 SRC_URI = "http://www.yoctoproject.org/downloads/${BPN}/${BPN}-${PV}.tar.bz2"
 
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index 9414c79..7857275 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -2,7 +2,7 @@  require pseudo.inc
 
 SRCREV = "f0375c9aaefbccfd41aebbf6d332bb4d9e8f980c"
 PV = "1.3+git${SRCPV}"
-PR = "r22"
+PR = "r23"
 
 DEFAULT_PREFERENCE = "-1"