From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] rpath and runpath
Date: Fri, 19 May 2017 21:27:01 +0200 [thread overview]
Message-ID: <20170519212701.6824e4e3@free-electrons.com> (raw)
In-Reply-To: <952e1471-12e9-7935-16c2-af56ad4fead7@ou.edu>
Hello,
On Fri, 19 May 2017 07:55:24 -0600, Steve Kenton wrote:
> The chrpath command can display and/or modify the (pre LD_LIBRARY_PATH)
> rpath and (post LD_LIBRARY_PATH) runpath settings in the ELF executable.
> As an example looking at the host and target /usr/sbin directory gives
> the 95 lines of output below.
>
> I can see the reason for having the host executables use an RPATH to the
> build directory, although I think a relative path using "$ORIGIN" at
> link time which would allow the tree to be relocated would be even better.
The problem with $ORIGIN is that it contains a $, and this means it
easily gets expanded as a shell variable within Buildroot or inside the
package build system. So our attempts to use $ORIGIN directly during
the build have failed so far.
Therefore, the approach we are moving towards is keeping the absolute
rpath during the build, and at the very end of the build, do a
post-processing step that replaces the absolute rpath with relative
rpath using $ORIGIN.
> However, some of the target target executables also have RPATH to the
> build directory which makes no real sense to me and other have no RPATH
> or RUNPATH at all.
The plan is to get rid of them as well.
> What is the purpose of this arrangement, or is it just a historical
> accident?
See the patch series from Wolfgang Grandegger at
http://lists.busybox.net/pipermail/buildroot/2017-March/185714.html.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2017-05-19 19:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-19 13:55 [Buildroot] rpath and runpath Steve Kenton
2017-05-19 19:27 ` Thomas Petazzoni [this message]
2017-05-20 20:54 ` Steve Kenton
2017-05-21 5:15 ` 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=20170519212701.6824e4e3@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--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