How to 'Compile against glibc build tree' ?

Carlos O'Donell carlos@redhat.com
Tue Dec 1 15:56:00 GMT 2015


On 12/01/2015 09:40 AM, David Aldrich wrote:
> 
>> I guess you're aware that the library search paths are baked into
>> the binary, and moving or removing your freshly built glibc will
>> mean that the binary won't run.
> 
> Yes, understood. The thing is that I need glibc 2.22 because it
> includes a bug fix for dlopen(), but I don't want to disrupt the
> system version. So we have to put up with any limitations :-)

You are not quite following the right process.

For anything that is not debugging you should build against an
installed tree.

That is to say you need to:

Building glibc with intent to install:
https://sourceware.org/glibc/wiki/Testing/Builds#Building_glibc_with_intent_to_install

and:

Compile against glibc in an installed location:
https://sourceware.org/glibc/wiki/Testing/Builds#Compile_against_glibc_in_an_installed_location

For testing purposes what you're doing is OK.

You can eventually get fancy and use $ORIGIN in your rpath and
other strings to make the paths relative to your binary.

Cheers,
Carlos.



More information about the Libc-help mailing list