From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] Bug in RPATH fixing logic
Date: Sun, 12 Nov 2017 18:42:50 +0100 [thread overview]
Message-ID: <20171112174250.GD2947@scaer> (raw)
In-Reply-To: <20171112182403.5d5c8fe4@windsurf.home>
On 2017-11-12 18:24 +0100, Thomas Petazzoni spake thusly:
> Hello,
>
> On Sun, 12 Nov 2017 18:15:12 +0100, Peter Korsgaard wrote:
>
> > > So this happens because the ARC binutils version is fetched from Git,
> > > so we need to have host-flex installed, and binutils detects the flex
> > > library and decides to use it.
> >
> > And there is no configure flag to disable that?
>
> Not that I can see.
A long time ago (when I was too young to have a beard), libfl was only
available as a static library.
That library contained (and stil contains) a 'main()' symbol (is it even
a weak one?), so it really is a weird library to begin with... I would
not mind building that host library with --disable-shared --enable-static
and only install the static library...
That would solve this specific issue.
Until we need another library...
> > >> - The absolute rpath in $(HOST_DIR)/<tuple>/bin/ar is wrong in the
> > >> first place, but I'm not sure how to fix this.
> >
> > > I'm wrong on this: $(HOST_DIR)/<tuple>/bin/ar RPATH is totally fine:
> >
> > > $ readelf -d arc-buildroot-linux-uclibc/bin/ar | grep rpath
> > > 0x000000000000000f (RPATH) Library rpath: [/opt/br-arcle-hs38-full-2017.11-rc1/lib]
> >
> > > The problem is that this gets turned into $ORIGIN/../lib by patchelf.
> >
> > > I don't see any other solution than de-duplicating such binaries.
> >
> > > Do you see another option ?
> >
> > Not if we *need* both binaries (do we?)
>
> I think we do need both binaries. <tuple>-<tool> is the "publicly"
> visible copy, while <tuple>/bin/<tool> is the one called internally by
> gcc (for example when it calls as or ld). Yann can explain more about
> this perhaps.
I can't explain much more than you did, sorry...
> > Is there a way to get binutils to use soft links instead of hard links?
>
> How would this solve the problem?
I guess the reasoning of Peter was that maybe $ORIGIN is relative to the
real file not the symlink.
Thus by having <tuple>/bin/<tool> a symlink to ../../bin/<tuple>-<tool>
would solve the issue.
But I am not sure of it either, and the manpage for ld.so does not
mention that. It only states:
$ORIGIN (or equivalently ${ORIGIN})
This expands to the directory containing the program or
shared object.
No mention of the behaviour when the program is being called through a
symlink in another directory... :-/
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2017-11-12 17:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-12 16:40 [Buildroot] Bug in RPATH fixing logic Thomas Petazzoni
2017-11-12 16:49 ` Thomas Petazzoni
2017-11-12 17:15 ` Peter Korsgaard
2017-11-12 17:24 ` Thomas Petazzoni
2017-11-12 17:42 ` Yann E. MORIN [this message]
2017-11-13 7:17 ` Wolfgang Grandegger
2017-11-13 13:50 ` Peter Korsgaard
2017-11-13 15:19 ` Wolfgang Grandegger
2017-11-13 17:36 ` Yann E. MORIN
2017-11-13 18:04 ` Wolfgang Grandegger
2017-11-13 20:23 ` Peter Korsgaard
2017-11-13 20:33 ` Yann E. MORIN
2017-11-14 8:00 ` Wolfgang Grandegger
2017-11-14 9:05 ` Wolfgang Grandegger
2017-11-14 10:39 ` Peter Korsgaard
2017-11-12 18:03 ` Peter Korsgaard
2017-11-12 19:04 ` Wolfgang Grandegger
2017-11-12 19:35 ` Wolfgang Grandegger
2017-11-12 20:37 ` Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171112174250.GD2947@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox