* [Buildroot] binutils now adds sysroot for ld -rpath search
@ 2017-03-14 9:33 Jörg Krause
2017-03-14 21:20 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Jörg Krause @ 2017-03-14 9:33 UTC (permalink / raw)
To: buildroot
Hi,
some news!
After a discussion with Brad King on the CMake issue tracker [1] about
how the linker should handle -rpath we agreed that ld should add the
sysroot when searching for files (but not when setting the RPATH header
value).
I picked up a five years old patch from the binutils mailing list [2]
which already proposed the change, but was not submitted then.
I resend the patch [3] and this time Alan Modra accepted the change. He
submitted two patches [4,5] which will add the sysroot to -rpath?for
absolute paths.
[1] https://gitlab.kitware.com/cmake/cmake/issues/16682
[2] https://sourceware.org/ml/binutils/2012-09/msg00156.html
[3] https://sourceware.org/ml/binutils/2017-03/msg00134.html
[4] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h
=316a1245fe31e327223ca66797b789eaf9544c2c
[5] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h
=118aa6cf395aec093fe12d7fb2d05441791a93fa
Best regards,
J?rg Krause
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] binutils now adds sysroot for ld -rpath search
2017-03-14 9:33 [Buildroot] binutils now adds sysroot for ld -rpath search Jörg Krause
@ 2017-03-14 21:20 ` Thomas Petazzoni
2017-03-15 7:45 ` Jörg Krause
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2017-03-14 21:20 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, 14 Mar 2017 10:33:58 +0100, J?rg Krause wrote:
> After a discussion with Brad King on the CMake issue tracker [1] about
> how the linker should handle -rpath we agreed that ld should add the
> sysroot when searching for files (but not when setting the RPATH header
> value).
>
> I picked up a five years old patch from the binutils mailing list [2]
> which already proposed the change, but was not submitted then.
>
> I resend the patch [3] and this time Alan Modra accepted the change. He
> submitted two patches [4,5] which will add the sysroot to -rpath?for
> absolute paths.
Aaah indeed. I also recently looked at some package that was failing to
build because -rpath /usr/lib was passed. And then I realized that
things were clunky: what if you really a RPATH to be encoded in the
generated binary, but don't want this path to be looked at on the build
machine during the cross-compilation.
Your patch solves exactly that. I guess we'll have to integrate it in
Buildroot as well, but we will still have issues with external
toolchains, sadly :-/
Thanks a lot for this work!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] binutils now adds sysroot for ld -rpath search
2017-03-14 21:20 ` Thomas Petazzoni
@ 2017-03-15 7:45 ` Jörg Krause
0 siblings, 0 replies; 3+ messages in thread
From: Jörg Krause @ 2017-03-15 7:45 UTC (permalink / raw)
To: buildroot
Hi Thomas,
On Tue, 2017-03-14 at 22:20 +0100, Thomas Petazzoni wrote:
> Hello,
>
> On Tue, 14 Mar 2017 10:33:58 +0100, J?rg Krause wrote:
>
> > After a discussion with Brad King on the CMake issue tracker [1]
> > about
> > how the linker should handle -rpath we agreed that ld should add
> > the
> > sysroot when searching for files (but not when setting the RPATH
> > header
> > value).
> >
> > I picked up a five years old patch from the binutils mailing list
> > [2]
> > which already proposed the change, but was not submitted then.
> >
> > I resend the patch [3] and this time Alan Modra accepted the
> > change. He
> > submitted two patches [4,5] which will add the sysroot to
> > -rpath?for
> > absolute paths.
>
> Aaah indeed. I also recently looked at some package that was failing
> to
> build because -rpath /usr/lib was passed. And then I realized that
> things were clunky: what if you really a RPATH to be encoded in the
> generated binary, but don't want this path to be looked at on the
> build
> machine during the cross-compilation.
>
> Your patch solves exactly that. I guess we'll have to integrate it in
> Buildroot as well, but we will still have issues with external
> toolchains, sadly :-/
For now! But someday in the future all toolchains will use binutils at
least 2.29 (which will have the patch).
> Thanks a lot for this work!
>
You're welcome! I just wanted to understand what the issue with rpath
is. I'm glad it will cause less trouble (when all toolchains are
updated).
Best regards,
J?rg
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-15 7:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-14 9:33 [Buildroot] binutils now adds sysroot for ld -rpath search Jörg Krause
2017-03-14 21:20 ` Thomas Petazzoni
2017-03-15 7:45 ` Jörg Krause
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox