This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: glibc and $ORIGIN
- From: Ryan Arnold <ryan dot arnold at gmail dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-help at sourceware dot org, Fabiano Sidler <lists at fipscode dot ch>
- Date: Tue, 5 May 2009 17:19:46 -0500
- Subject: Re: glibc and $ORIGIN
- References: <20090505214416.GB25755@true> <200905051805.31914.vapier@gentoo.org>
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