[lsb-discuss] pthread_atfork

Robert Schweikert Robert.Schweikert at abaqus.com
Tue Sep 19 08:34:41 PDT 2006


On Tue, 2006-09-19 at 08:13 -0700, Wichmann, Mats D wrote:
> >> libpthread.so used to be a simple shared library, now
> >> it is a linker script:
> >> 
> >> GROUP ( /lib/libpthread.so.o /usr/lib/libpthread_nonshared.a )
> >> 
> >> When you examine a shared library by itself, it has not yet
> >> been subject to final link editing.  When that library is
> >> the target of producing an executable with ld, the nonshared.a
> >> library will be statically linked, and so the symbol will
> >> exist, and be be resolved, within the executable.
> >
> >But then one should never get a link error for a symbol falling into
> >this category. I can definitely create a link error for
> >pthread_atfork().
> 
> then it must be escaping the way lsbcc does this (BTW, I saw
> two other fatal problems in your checker output, so it's not
> going to succeed anyway - pthread_getattr_np and syscall)

The compiler group is working on addressing the pthread_getattr_np and
syscall interfae issues.

> 
> is -lpthread on the link line?  or is it only in the
> DT_NEEDED of the openMP library (I think we made pthread
> default so this shouldn't matter, but I'm curious to know)

If I do not specify -lpthread I get the link error, if I do the link
problem goes away. 

The library does have a dependency on pthreads:

-> ldd /opt/intel/fce/9.1.033/lib/libguide.so
        libc.so.6 => /lib64/libc.so.6 (0x00002b7d8434f000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002b7d8457f000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b7d84683000)
        /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)

-> readelf -d /opt/intel/fce/9.1.033/lib/libguide.so 
Dynamic section at offset 0x3d080 contains 22 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library:
[libpthread.so.0]
<snip>



> 
-- 
Robert Schweikert                   MAY THE SOURCE BE WITH YOU
(Robert.Schweikert at abaqus.com)                 LINUX
ABAQUS Inc.
Phone : 401-276-7190
FAX : 401-276-4408




More information about the lsb-discuss mailing list