[PATCH] test: fix RPATH in the test suite

Carmelo Amoroso carmelo73 at gmail.com
Tue Feb 3 06:52:54 UTC 2009


Denys Vlasenko wrote:
> On Tuesday 03 February 2009 00:17, Denys Vlasenko wrote:
>> On Wednesday 28 January 2009 16:39, Carmelo AMOROSO wrote:
>>> Folks,
>>> while reviewing test suite, found an issue in setting RPATH
>>> when TEST_INSTALLED_UCLIBC is not set.
>>> The attached patch should fix it.
>>> --------
>>>
>>> Build tests setting RPATH to ./ instead of $(top_builddir)lib
>>> to allow tests using their shared libraries to be loaded
>>> without setting LD_LIBRARY_PATH.
>>> When TEST_INSTALLED_UCLIBC is set, it doesn't need to set the RPATH,
>>> otherwise ass to the RPATH the $(top_builddir)lib too.
>>> UCLIBC_LDSO_ABSPATH is untouched.
>>>
>>> Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
>>
>> Can you provide before and after results
>> of "readelf -W -a test/args/arg_test" ?
> 
> I applied the patch, and ran
> 
> TEST_INSTALLED_UCLIBC=1 make TEST_INSTALLED_UCLIBC=1 V=1 compile
> readelf -W -a args/arg_test
> 
> and RPATH is:
> 
> Dynamic section at offset 0x46c contains 18 entries:
>   Tag        Type                         Name/Value
>  0x00000001 (NEEDED)                     Shared library: [libc.so.0]
>  0x0000000f (RPATH)                      Library rpath: [./]
> 
> 
This is what I wanted exactly. (the INTERP has been always correct).
In this case, the RPATH is use only by those tests that needs to load
their own shared libraries that are located in the test's directory itself.
System shared libraries (libc.so and others) will be searched by the installed
dynamic linker in the default path (including shared library's folder).

> Before patch it was:
> 
>  0x0000000f (RPATH)                      Library rpath: [../../lib:./]
> 
> 
In this case, becasue you are not testing the "installed uclibc", but your own
freash build, you need to set the RPATH pointing to the relative folder
containing the fresh built uclibc libraries, and this will override the /usr/lib
because RPARTH takes precedence.

> Is it better now? For me, both look wrong.
>
Yes, IMO it's the correct status.

> I think in second case, RPATH should be either missing,
> or set to "/uclibc/lib:/usr/lib" (depending on .config,
> see mine attached).
No, I don't think so.
> --
> vda

Carmelo
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc



More information about the uClibc mailing list