This is the mail archive of the libc-alpha@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: [PATCH] Append system library paths to environment for testprograms


On Tue, 3 Apr 2012 02:36:15 -0400
"Carlos O'Donell" <carlos@systemhalted.org> wrote:
> No, in the testsuite we never end up using /etc/ld.so.cache because we
> use --library-path.

Using --library-path means that the linker will not look at
LD_LIBRARY_PATH, but there is nothing to stop the linker from looking
at ld.so.cache. Try this for example:

1) Configure and build with a different prefix
2) Build and verify that dlfcn/bug-atexit3 fails
3) Remove dlfcn/bug-atexit3*
4) Copy over /etc/ld.so.cache to $(prefix)/etc/ld.so.cache

You'll see that the test works correctly, because your system
ld.so.cache had the entry for libstdc++.so. Conversely (if you're brave
enough), copy the ld.so.cache from ${prefix} into /etc and see how
libstdc++.so cannot be found until ldconfig is run.
 
> Your counter argument is: "It should just work."
> 
> The counter argument to that is: "It does, don't set prefix."

Not really. I have to explicitly set prefix to /usr, otherwise it does
not work. Not setting prefix leaves it at /usr/local and that too does
not work since the ld.so.cache is now at /usr/local/etc/.

> I think it's the *definition* of what --prefix means that is cause
> the problem.
> 
> In every other project --prefix simply means "install here."
> 
> In glibc it means more than that and has implications on the testing
> framework.

Right, this is the difference that we're talking about and I am not
entirely convinced that the difference is necessary. I am fine if there
is consensus on requiring a complete sysroot wherever I have a prefix
because I can work around it either by copying the /etc/ld.so.cache (or
writing a ${prefix}/etc/ld.so.conf) or by LD_PRELOAD'ing line Marek
does. Do we agree that we need to at least document this (and the
workarounds that can be used)? Is README a good place to put it in or
the FAQ.in?


--
Siddhesh


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