This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Append system library paths to environment for test programs
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 2 Apr 2012 09:00:38 -0400
- Subject: Re: [PATCH] Append system library paths to environment for test programs
- References: <20120402103319.6afeb5b9@spoyarek>
On Mon, Apr 2, 2012 at 1:03 AM, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
> A bunch of tests fail on my system due to not being able to find some
> libraries (libgcc_s.so, libstdc++.so). I found that this is because I
> have a 64-bit Fedora install, which puts these libraries in /lib64
> and /usr/lib64 instead of the usual /lib and /usr/lib. The current
> --library-path for ld.so in the test cases ends up including only the
> libraries in the build and those that may have been mentioned in
> LDFLAGS.
>
> To fix these tests on my box, I have written a small fix to Makeconfig
> that appends search paths used by gcc (if we are using gcc) to the
> --library-path of the dynamic linker command that invokes the tests.
>
> I have verified that the libc libraries being tested are not being
> overridden by the default paths. An example of a test that fails with
> this is dlfcn/bug-atexit3.c. There are many more similar tests that
> fail without this fix:
These failures are because you used --prefix but didn't provide a
correctly built sysroot in --prefix.
I'm strongly against querying the compiler and adding whatever paths
it used to our library search list. Why? It complicates testing by
providing poor separation of the test framework from the natively
installed libraries. This becomes even more important when
cross-compiling and cross-testing.
I would be OK having a target that builds a minimal sysroot for you to
use with testing, but that would be a special step that a developer
would take if they didn't already have a setup sysroot.
On top of this complication is the recent multi-arch layouts adopted
by some distributions.
Cheers,
Carlos.