This is the mail archive of the prelink@sourceware.org mailing list for the prelink 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] Add LINKOPTS to CCLINK and CXXLINK in testsuite/Makefile.am


On 07/05/13 14:40, Jakub Jelinek wrote:
> On Tue, May 07, 2013 at 02:33:52PM +0200, Tom de Vries wrote:
>> this patch allows me to run all the tests successfully on x86_64 with
>> LINKOPTS="-Wl,--no-as-needed" set in the environment.
> 
> That shouldn't be needed anymore, are you using latest SVN prelink?

Jakub,

I'm using r205, dated 2013-05-03.

The failures I see with that version are:
...
FAIL: layout1.sh
FAIL: layout2.sh
FAIL: tls5.sh
FAIL: tls6.sh
FAIL: cxx1.sh
FAIL: cxx2.sh
FAIL: cxx3.sh
FAIL: quick1.sh
FAIL: quick2.sh
FAIL: cycle1.sh
FAIL: cycle2.sh
...

Running tls5 by hand gives:
...
$ ../../src/testsuite/tls5.sh  ; echo $?
../src/prelink: tls5lib3.so does not have .gnu.prelink_undo section
4
...

Without --no-as-needed, tls5lib1.so is not dependent on tls5lib3.so, so the
prelink command ignores it:
...
../src/prelink -c ./prelink.conf -C ./prelink.cache --ld-library-path=.
--dynamic-linker=./ld-linux-x86-64.so.2 -vm ./tls5
Laying out 2 libraries in virtual address space 0000003000000000-0000004000000000
Assigned virtual address space slots for libraries:
./ld-linux-x86-64.so.2
0000003000000000-00000030002242c8
./tls5lib1.so
0000003000400000-0000003000602088
./tls5lib2.so
0000003000800000-0000003000a01030
./libc.so.6
0000003000c00000-0000003000fbe4d8
Prelinking /home/vries/upstream/prelink/builds/prelink/build/testsuite/tls5lib2.so
Prelinking /home/vries/upstream/prelink/builds/prelink/build/testsuite/tls5lib1.so
Prelinking /home/vries/upstream/prelink/builds/prelink/build/testsuite/tls5
...
and the undo of the prelink of tls5lib3.so fails.

Setting LINKOPTS with --no-as-needed allows the test to pass:
...
$ LINKOPTS="-Wl,--no-as-needed" ../../src/testsuite/tls5.sh  ; echo $?
0
...

> Before those testsuite changes, one could just do
> make check CC='gcc -Wl,--no-as-needed' CXX='g++ -Wl,--no-as-needed'

That works also for me.

I used LINKOPTS because I read functions.sh and saw how it's used there (CC
includes LINKOPTS, CCLINK includes CC which includes LINKOPTS). It made sense to
me to use LINKOPTS because --no-as-needed it is a link opt, and we need to pass
it only once (instead of in both CC and CXX).

Thanks,
- Tom


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