[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: How do I link to nptl?



On Tue, Oct 29, 2002 at 06:06:41PM +0800, Liu, Bing Wei wrote:
> Hi Ulrich,
> 
> I have the same question with regard to the usage of nptl. Furthermore, I
> was confused by some
> issues while testing binary compatibility of nptl with linuxthreads.  Please
> point out if I was doing wrong.
> 
> Issue 1:  tests was linked to linuxthreads library instead of nptl library.
> # follow the steps given by the subject "RE: NPTL 0.4 setup compile error".
> working dir is /home/nptl
> # ...
> # make subdirs=nptl check
> # ldd tst-basic1
> 	libpthread.so.0 => /lib/i686/libpthread.so.0 (0x40024000)
> 			^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 	libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
> 	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

But the tests are run like elf/ld.so --library-path .:nptl nptl/tst-basic1,
or at least should be.
If you want to make a binary which will automagically use NPTL yet don't
want to change your system glibc, you can e.g. put nptl/libpthread*so*,
libc*so* and elf/ld*so* to /lib/nptl/ and link the program with:
gcc ... -Wl,-dynamic-linker,/lib/nptl/ld-linux.so.2,-rpath,/lib/nptl
When debugging such program, you'll have to point gdb to the corresponding
linuxthreads_db.so though.

> Issue 3: System was tainted while using the newly built libc.so.  Can you
> explain the TSL feature used in NPT?
> # ln -fs /home/ngptl/glibc/libc.so.6 /lib/i686/libc.so.6
> # ls
>     	cannot handle file 'libc.so.6' with TLS data
> # reboot
>     	cannot handle file 'libc.so.6' with TLS data

s/TSL/TLS/
The dynamic linker has to be updated as well from --with-tls build.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]