This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu 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]

Re: __lib_fork symbol


>>>>> Thomas Pasch writes:

 > Well, 
 > perhaps silly. But I can't compile with libpthread with glibc version 2.1.2. Trying

>> gcc test.c -lc -lpthread

 > always leads to 

 > /lib/libpthread.so: undefined reference to `__libc_fork@@GLIBC_2.1.2' 

 > Indeed __libc_fork seems to be defined in /lib/libc.so.6 but not __libc_fork@@GLIBC_2.1.2 (that
 > is look for by /lib/libpthread.so.0
 > There is something wrong with symbol versioning? Or with the linker? I've just upgraded
 > from 2.1.1.

In that case you must have miscompiled glibc somehow.

gromit:/usr/src/cvs/libc:[0]$ readelf -a /lib/libpthread.so.0 |grep __libc_fork
  000114e8  01707 R_386_JUMP_SLOT       00000000  __libc_fork              
   23:        0    47 FUNC    GLOBAL  0  UND __libc_fork@GLIBC_2.1.2 (9)
  218:        0    47 FUNC    GLOBAL  0  UND __libc_fork@@GLIBC_2.1.2
gromit:/usr/src/cvs/libc:[0]$ readelf -a /lib/libc.so.6 |grep __libc_fork
  0013ab40  54201 R_386_32              00095650  __libc_fork              
  1346:    95650    47 FUNC    GLOBAL  0   17 __libc_fork@@GLIBC_2.1.2
  4686:    95650    47 FUNC    GLOBAL  0   17 __libc_fork

Are you sure that /lib/libpthread.so.0 and /lib/libc.so.6 are both the
newly installed files?  Is /usr/lib/libc.so the linker script as
documented in the FAQ?

If you compiled glibc 2.1.2 yourself, you should have in
posix/Versions:
[...]
  GLIBC_2.1.2 {
    # functions used in other libraries
    __libc_fork; __vfork;
  }
which ends up in libc.map in your build directory.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.rhein-neckar.de

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