* [Buildroot] host directories in target rpath
@ 2016-01-01 15:56 Alex Suykov
2016-01-01 22:05 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Alex Suykov @ 2016-01-01 15:56 UTC (permalink / raw)
To: buildroot
Hi all,
I noticed I have bunch of target executables with host directories in RPATH:
$ readelf -d output/target/usr/bin/aserver | grep RPATH
0x0000000f (RPATH) Library rpath: [/home/alex/src/buildroot.snow/output/build/alsa-lib-1.0.29/src/.libs]
$ readelf -d output/target/usr/bin/glib-compile-resources | grep RPATH
0x0000000f (RPATH) Library rpath: [/home/alex/src/buildroot.snow/output/build/libglib2-2.46.1/gio/.libs:/home/alex/src/buildroot.snow/output/build/libglib2-2.46.1/gobject/.libs:/home/alex/src/buildroot.snow/output/build/libglib2-2.46.1/gmodule/.libs:/home/alex/src/buildroot.snow/output/build/libglib2-2.46.1/glib/.libs:/home/alex/src/buildroot.snow/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib]
$ readelf -d output/target/usr/bin/weston | grep RPATH
0x0000000f (RPATH) Library rpath: [/home/alex/src/buildroot.snow/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib]
It does not break anything, but it's not right either.
And it makes strace output look rather messy.
A quick way to check it is building alsa-lib, which is where aserver comes from.
The underlying cause is libtool, and for autoreconfed packages I can fix it
by patching (host-)libtool. This fixes alsa-lib but not weston because weston
carries that code in its pre-built configure. So I have to either patch weston
in place (and also every non-autoreconfed package), or autoreconf them all.
What's your thoughts on this? Maybe there are better ways to fix it?
package/libtool/0001-no-rpath.patch:
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -5035,7 +5035,6 @@
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
# ancient GNU ld didn't support --whole-archive et. al.
if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] host directories in target rpath
2016-01-01 15:56 [Buildroot] host directories in target rpath Alex Suykov
@ 2016-01-01 22:05 ` Thomas Petazzoni
2016-01-04 19:43 ` Alex Suykov
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2016-01-01 22:05 UTC (permalink / raw)
To: buildroot
Dear Alex Suykov,
On Fri, 1 Jan 2016 17:56:23 +0200, Alex Suykov wrote:
> I noticed I have bunch of target executables with host directories in RPATH:
>
> $ readelf -d output/target/usr/bin/aserver | grep RPATH
> 0x0000000f (RPATH) Library rpath: [/home/alex/src/buildroot.snow/output/build/alsa-lib-1.0.29/src/.libs]
>
> $ readelf -d output/target/usr/bin/glib-compile-resources | grep RPATH
> 0x0000000f (RPATH) Library rpath: [/home/alex/src/buildroot.snow/output/build/libglib2-2.46.1/gio/.libs:/home/alex/src/buildroot.snow/output/build/libglib2-2.46.1/gobject/.libs:/home/alex/src/buildroot.snow/output/build/libglib2-2.46.1/gmodule/.libs:/home/alex/src/buildroot.snow/output/build/libglib2-2.46.1/glib/.libs:/home/alex/src/buildroot.snow/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib]
>
> $ readelf -d output/target/usr/bin/weston | grep RPATH
> 0x0000000f (RPATH) Library rpath: [/home/alex/src/buildroot.snow/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib]
>
> It does not break anything, but it's not right either.
> And it makes strace output look rather messy.
>
> A quick way to check it is building alsa-lib, which is where aserver comes from.
>
> The underlying cause is libtool, and for autoreconfed packages I can fix it
> by patching (host-)libtool. This fixes alsa-lib but not weston because weston
> carries that code in its pre-built configure. So I have to either patch weston
> in place (and also every non-autoreconfed package), or autoreconf them all.
>
> What's your thoughts on this? Maybe there are better ways to fix it?
You can see the following patches from Samuel Martin, which aim at
solving this problem:
http://patchwork.ozlabs.org/patch/494781/
http://patchwork.ozlabs.org/patch/494782/
http://patchwork.ozlabs.org/patch/494783/
http://patchwork.ozlabs.org/patch/494784/
http://patchwork.ozlabs.org/patch/494785/
Samuel said he would respin them on top of master and post a new
version of those patches.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] host directories in target rpath
2016-01-01 22:05 ` Thomas Petazzoni
@ 2016-01-04 19:43 ` Alex Suykov
0 siblings, 0 replies; 3+ messages in thread
From: Alex Suykov @ 2016-01-04 19:43 UTC (permalink / raw)
To: buildroot
Fri, Jan 01, 2016 at 11:05:49PM +0100, Thomas Petazzoni wrote:
> > The underlying cause is libtool, and for autoreconfed packages I can fix it
> > by patching (host-)libtool. This fixes alsa-lib but not weston because weston
> > carries that code in its pre-built configure. So I have to either patch weston
> > in place (and also every non-autoreconfed package), or autoreconf them all.
> >
> > What's your thoughts on this? Maybe there are better ways to fix it?
>
> You can see the following patches from Samuel Martin, which aim at
> solving this problem:
>
> http://patchwork.ozlabs.org/patch/494781/
> http://patchwork.ozlabs.org/patch/494782/
> http://patchwork.ozlabs.org/patch/494783/
> http://patchwork.ozlabs.org/patch/494784/
> http://patchwork.ozlabs.org/patch/494785/
>
> Samuel said he would respin them on top of master and post a new
> version of those patches.
Thanks, I wasn't aware of this set and it looks much better than
what I was going to do!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-04 19:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-01 15:56 [Buildroot] host directories in target rpath Alex Suykov
2016-01-01 22:05 ` Thomas Petazzoni
2016-01-04 19:43 ` Alex Suykov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox