From: Richard Purdie <rpurdie@linux.intel.com>
To: Mark Hatle <mark.hatle@windriver.com>
Cc: poky@yoctoproject.org
Subject: Re: [PATCH 1/1] poky.conf: move the SDK install into versiondirectories
Date: Sun, 28 Nov 2010 13:57:31 +0000 [thread overview]
Message-ID: <1290952651.27143.183.camel@rex> (raw)
In-Reply-To: <4CE6A7FF.4040507@windriver.com>
On Fri, 2010-11-19 at 10:38 -0600, Mark Hatle wrote:
> As we move beyond 1.0 work. Would it make sense to focus on making sure the SDK
> tooling works no matter where it is installed?
>
> The compiler/linker can already do this... the other components that may be part
> of the SDK may need some slight changes to detect their current run-time
> location and adjust internal paths as necessary.
>
> (We have experience doing this for Wind River Linux, so we should be able to
> help out if it's a desired feature for Poky.)
On the whole I think we're already in very good shape in this regard
since the sstate packages are designed to be relocatable and adapting
this to the sdk tooling isn't hard.
There is however one peculiarity to keep in mind. The packages we build
to populate /opt/poky are "special". How so?
We have to compile them against a libc so we choose to compile them
against one we build ourselves since we can't guarantee that for a given
SDKMACHINE choice, a suitable libc would be available on any given build
machine. This isn't a problem, we have a cross compiling build system
capable for building toolchains so building our own libc is by far the
easiest thing to do. Also, by doing this we guarantee that the binary
will run pretty much anywhere as we have *no* native dependencies to
worry about.
The twist is that by building the libc we build a dyanmic loader too as
the two are bound together. As we cannot install things into /lib*, we
build our libc to live in /opt/poky/sysroots/*/lib. Our libc and dynamic
loader know how to get the search order right for libs. The trouble is
that the path to the dynamic loader is hardcoded into binaries. We want
binaries to find our loader, not the system one as they behave
differently for path search order.
There is no way to specify the dynamic loader path using $$ORIGIN or as
a relative path.
On the positive side, if you have a libc binary you want to drop in
instead of our version and are happy your libc represents a minimum
target requirement such as LSB X.Y then telling Poky to use that instead
of building its own isn't hard. I have seen some nasty corner cases for
the dynamic linker though where you load a system lib which loads a
dependency for which we ship a library of a different version
within /opt/poky (e.g. xrandr). The main binary can then see a version
of the library it wasn't compiled for and there starts a world of pain.
I value Poky's total independence model and it can be adapted to suit
something like an LSB target easily as that is a simplified version
(where you'd have to provide some prebuilt binaries). The downside is
that the dynamic loader location is hardcoded into the binary.
I have been thinking a nice solution would be a redirection loader at
some specified path which would simply transfer execution to the "real"
loader allowing binaries to become relocatable again. The alternative
would be $$ORIGIN support or relative path support for dynamic loaders
but this would require Linux kernel changes and it would hence be a
while before it could be relied upon, even if such a change were
acceptable to mainline.
Cheers,
Richard
next prev parent reply other threads:[~2010-11-28 21:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-19 15:07 [PATCH 0/1] Enable parallel installations of SDK's from different Poky versions Joshua Lock
2010-11-19 11:59 ` [PATCH 1/1] poky.conf: move the SDK install into version directories Joshua Lock
2010-11-19 16:38 ` [PATCH 1/1] poky.conf: move the SDK install into versiondirectories Mark Hatle
2010-11-19 20:23 ` Tom Rini
2010-11-23 17:22 ` Joshua Lock
2010-11-28 13:57 ` Richard Purdie [this message]
2010-11-19 18:33 ` [PATCH 0/1] Enable parallel installations of SDK's from different Poky versions Scott Garman
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=1290952651.27143.183.camel@rex \
--to=rpurdie@linux.intel.com \
--cc=mark.hatle@windriver.com \
--cc=poky@yoctoproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.