This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v8] Add pretty printers for the NPTL lock types
- From: Siddhesh Poyarekar <siddhesh at sourceware dot org>
- To: Martin Galvan <martin dot galvan at tallertechnologies dot com>
- Cc: Pedro Alves <palves at redhat dot com>, libc-alpha at sourceware dot org, Carlos O'Donell <carlos at redhat dot com>
- Date: Sat, 25 Jun 2016 22:52:44 +0530
- Subject: Re: [PATCH v8] Add pretty printers for the NPTL lock types
- Authentication-results: sourceware.org; auth=none
- References: <CAOKbPbZknCcBGozK_v8SC=PyJdczwr7ss6Y1y1hs2x8ag7cpxA at mail dot gmail dot com> <20160623164003 dot GC17911 at devel dot intra dot reserved-bit dot com> <CAOKbPbbp=-3XgwogxN90EGZxOPjiT_hkEWnaMuB4uz5Ox-njPw at mail dot gmail dot com> <20160624165111 dot GD30229 at devel dot intra dot reserved-bit dot com> <CAOKbPbZk8ONZ8pRMbFV72ek0p6=wk1GRZKF_2RCpz4LmnYt_zw at mail dot gmail dot com> <20160624203223 dot GE30229 at devel dot intra dot reserved-bit dot com> <CAOKbPbbfHoNHpHrZgaTg3+MNQf7nE5XNe7rQyGSRL6P1sDubSw at mail dot gmail dot com> <CAOKbPbZ4spYsX242c_xiieL-TgaLqLBMzmD3G1VoZZGAJqaPXQ at mail dot gmail dot com> <20160625044439 dot GG30229 at devel dot intra dot reserved-bit dot com> <CAOKbPbavP9EVHOeXTCuJrxvg8r20a0SGh2DnrfR1cRJERgoyzw at mail dot gmail dot com>
On Sat, Jun 25, 2016 at 12:06:03PM -0300, Martin Galvan wrote:
> > Your default dynamic linker is being set as the built one instead of
> > the system, perhaps because of the way your source is configured.
>
> Funny, I actually thought it was supposed to do that :)
A correction is in order here: The dynamic linker set in your binaries
is not the built one, it is the *installed* one, i.e. in
/home/martin/glibc/install and not /home/martin/glibc/build (or
whatever the build directory is). And with this correction I can now
explain in detail what is going on.
The TL;DR; version is to stick to doing ../configure --prefix=/usr to
test what all distributions are doing and then take it from there.
When you configure with --prefix=<some-nonstandard-prefix>, the source
tree is built with that prefix hardcoded in. That is, for the dynamic
linker built with these settings, the default search path is in
<some-nonstandard-prefix>/lib:<some-nonstandard-prefix>/usr/lib. This
is why your tests succeed; they find the libraries in your install
tree and run correctly. If there was no install tree, the tests would
fail. In other words, the tests are incapable of running from just
within the build tree.
The /usr prefix is special in that it retains the behaviour in the
dynamic linker of picking libraries from the system directories
because that is what we eventually want when we install the library.
This is also why I see the system libraries being picked up and not
the build tree libraries. This configuration is very important for
testing because most major distributions configure with --prefix=/usr
and testsuite runs within their build trees need to run correctly.
To get the tests running correctly with the --prefix=/usr setting, you
need to provide some kind of hint inside the binaries so that the
correct libraries are picked and also set the dynamic linker to the
one that you want to test. Enter option
--enable-hardcoded-path-in-tests. It sets the dynamic linker header
entry and adds DT_RPATH to the binaries so that they're invoked using
our built dynamic linker and picks up our built libraries.
What we need to do is emulate the --enable-hardcoded-path-in-tests
option all the time for the pretty-printers so that they libraries are
picked correctly.
Siddhesh