This is the mail archive of the 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 v8] Add pretty printers for the NPTL lock types

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.


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