This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: glibc and $ORIGIN


On Tue, May 5, 2009 at 5:05 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Tuesday 05 May 2009 17:44:16 Fabiano Sidler wrote:
>> I'd like to build a system unfixed to absolute paths, so with
>>
>> Â LDFLAGS += '-z origin'
>> Â LD_RUN_PATH = '$ORIGIN/../lib'
>>
>> Unfortunately, the glibc seems not to support it. Am I wrong or
>> is there a work-around for this?
>
> $ORIGIN on the glibc libs themselves will not work. Â$ORIGIN on any other ELF
> should work just fine. Âthe ldso must always be in /lib/.
> -mike
>

There are ways to get around this but they're not for the faint of
heart.  The following wiki shows how one can tell the compiler that
the loader lives elsewhere:

http://sources.redhat.com/glibc/wiki/Testing/Builds

And one can debug using the following trick:

http://sources.redhat.com/glibc/wiki/Debugging/Development_Debugging#head-0f2b610260f23db5655a16e911aa7134c6bcc0ba

Most people only use this for debugging GLIBC builds.  I don't
recommend it for production environments unless the entire toolchain
is standalone.

A better alternative is a chroot jail with GLIBC installed into the
chroot / directory.

Ryan S. Arnold


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]