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

RE: How do I link to nptl?



Thank you, Jakub.  Now I can have the executables built with linuxthreads
and run with nptl, but I still have problems in directly compilation with
nptl.

Here are what I did,
===========================
Software Versions in my box
===========================
1. NPTL v0.4
2. Glibc-2.3.1
3. glibc-linuxthreads-2.3.1pre1
4. linux kernel 2.5.43
5. gcc 3.2-10
6. binutils-2.13.90.0.10-2

=====
Steps 
=====
1. update binutils and gcc to the required version;
2. rebuild the latest linux kernel [2.5.43] and boot with it;
3. cp glibc-2.3.1.tar.gz /home/nptl [any dir name you like]
4. tar xzvf glibc-2.3.1.tar.gz
5. cp glibc-linuxthreads-2.3.1pre1.tar.bz2 /home/nptl
6. tar xjvf glibc-linuxthreads-2.3.1pre1.tar.bz2 -C glibc-2.3.1
7. cp nptl-0.4.tar.bz2 /home/ntpl
8. tar xjvf nptl-0.4.tar.bz2 -C glibc-2.3.1
9. make sure /lib/modules/$(uname -r)/build link to correct place
10. cd /home/nptl/glibc-2.3.1;
11. ./configure --prefix=/usr --enable-add-ons=nptl --enable-kernel=current
--with-tls
12. make 
13. make subdirs=nptl check

14. find a common case, e.g. ex1.c of Linuxthreads examples
15. cp -d libc*so* /lib/nptl
16. cp -d elf/ld*so* /lib/nptl
17. cp -d nptl/libpthread*so* /lib/nptl
18. gcc -o ex1 ex1.c -lpthread
-Wl,-dynamic-linker,/lib/nptl/ld-linux.so.2,-rpath,/lib/nptl
     /lib/libc.so.6: undefined reference to '__libc_stack_end GLIBC_2 1'
     collect2: ld returned 1 exit status

Another question, you see I have used "with-tls" option. However, if I 
export LD_LIBRARY=/home/nptl/glibc:/home/nptl/glibc/nptl, I sttill got error
message
"cannot handle file 'libc.so.6' with TLS data". By the way, what does TLS
stand for?
I only know it's a feature introduced into the kernel.

Thanks
Bingwei


> -----Original Message-----
> From: Jakub Jelinek [mailto:jakub redhat com]
> Sent: 2002年10月29日 18:18
> To: phil-list redhat com
> Cc: Ulrich Drepper
> Subject: 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.
> 
> 
> 
> 
> -- 
> Phil-list mailing list
> Phil-list redhat com
> https://listman.redhat.com/mailman/listinfo/phil-list
> 





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