bug-glibc
[Top][All Lists]
Advanced

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

make bug: make crashes on linking libc.so


From: Frank Pettit
Subject: make bug: make crashes on linking libc.so
Date: Mon, 14 Jul 2003 20:55:57 -0700 (PDT)

Hello,
I am trying to compile glibc 2.3.2 on Linux Mandrake, and have found
that the 'make' command crashes at the step where libc.so is linked,
due to undefined references into pthreads. I want to emphasize that I
HAVE downloaded the linuxthreads add-on and untar'ed it in the root of
my glibc source tree, and I configured glibc with option
'--enable-add-ons=linuxthreads'.

By looking through the source code, I find that the undefined
references refer to global variables in the file pthread.c, which is
in subdirectory linuxthreads. I looked through the output of the
'make' command, and pthread.c is not compiled anywhere, so of course
references to it will be undefined, but I don't know how to fix this
problem.

My attempt to compile is all standard except that I define CFLAGS with
option -DFLOATING_STACKS. Below is info on my OS, setup,
configuration, the make command that crashes and the error output.

** ARCHITECTURE / OS INFO **
Architecture/OS: i686-pc-linux-gnu
Linux kernel 2.4.3-20mdk
Mandrake 8.0
Current glibc: 2.2.2.
Trying to compile glibc: 2.3.2

** COMPILER VERSION INFO **
Compiled with gcc version 3.3.
Installed into /usr/local/bin.
Output of /usr/local/bin/gcc -v:
Reading specs from ./../lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Configured with: ../gcc-3.3/configure --with-stabs
--with-as=/usr/bin/as --with-ld=/usr/bin/ld
--enable-languages=c,c++,f77,java --enable-threads=posix :
(reconfigured) ../gcc-3.3/configure
--with-stabs --with-as=/usr/bin/as --with-ld=/usr/bin/ld
--enable-languages=c,c++,f77,java --enable-threads=posix
Thread model: posix
gcc version 3.3

** ENVIRONMENT VARIABLES **
CC="/usr/local/bin/gcc"
CFLAGS="-O -DFLOATING_STACKS"
LD_LIBRARY_PATH="/usr/local/lib:/usr/lib:/lib"
LD_RUN_PATH="/usr/local/lib:/usr/lib:/lib"

** CONFIGURATION OF GLIBC MAKE **
glibc 2.3.2 installation was configured with:
configure --prefix=/usr --enable-add-ons=linuxthreads

** ERROR MESSAGE FROM MAKE **
Last command executed by make appears to be an attempt to link
libc.so, as shown below:
/usr/local/bin/gcc -shared -static-libgcc -Wl,-O1 -Wl,-z,defs
-Wl,-dynamic-linker=/lib/ld-linux.so.2
-B/usr/local/src/glibc-2.3.2-linux-obj/csu/
-Wl,--version-script=/usr/local/src/glibc-2.3.2-linux-obj/libc.map
-Wl,-soname=libc.so.6 -Wl,-z,combreloc -nostdlib -nostartfiles -e
__libc_main -u __register_frame -L/usr/local/src/glibc-2.3.2-linux-obj
-L/usr/local/src/glibc-2.3.2-linux-obj/math
-L/usr/local/src/glibc-2.3.2-linux-obj/elf
-L/usr/local/src/glibc-2.3.2-linux-obj/dlfcn
-L/usr/local/src/glibc-2.3.2-linux-obj/nss
-L/usr/local/src/glibc-2.3.2-linux-obj/nis
-L/usr/local/src/glibc-2.3.2-linux-obj/rt
-L/usr/local/src/glibc-2.3.2-linux-obj/resolv
-L/usr/local/src/glibc-2.3.2-linux-obj/crypt
-L/usr/local/src/glibc-2.3.2-linux-obj/linuxthreads
-Wl,-rpath-link=/usr/local/src/glibc-2.3.2-linux-obj:/usr/local/src/glibc-2.3.2-linux-obj/math:/usr/local/src/glibc-2.3.2-linux-obj/elf:/usr/local/src/glibc-2.3.2-linux-obj/dlfcn:/usr/local/src/glibc-2.3.2-linux-obj/nss:/usr/local/src/glibc-2.3.2-linux-obj/nis:/usr/local/src/glibc-2.3.2-linux-obj/rt:/usr/local/src/glibc-2.3.2-linux-obj/resolv:/usr/local/src/glibc-2.3.2-linux-obj/crypt:/usr/local/src/glibc-2.3.2-linux-obj/linuxthreads
-o /usr/local/src/glibc-2.3.2-linux-obj/libc.so -T
/usr/local/src/glibc-2.3.2-linux-obj/libc.so.lds
/usr/local/src/glibc-2.3.2-linux-obj/csu/abi-note.o
/usr/local/src/glibc-2.3.2-linux-obj/elf/soinit.os
/usr/local/src/glibc-2.3.2-linux-obj/libc_pic.os
/usr/local/src/glibc-2.3.2-linux-obj/elf/sofini.os
/usr/local/src/glibc-2.3.2-linux-obj/elf/interp.os
/usr/local/src/glibc-2.3.2-linux-obj/elf/ld.so -lgcc

Here is the error message. The undefined references are all to global
variables defined in pthread.c, which is in subdirectory linuxthreads:

/usr/local/src/glibc-2.3.2-linux-obj/libc_pic.os: In function
`thread_self':
/usr/local/src/glibc-2.3.2-linux-obj/libc_pic.os(.text+0x385):
undefined reference to `__pthread_initial_thread_bos'
/usr/local/src/glibc-2.3.2-linux-obj/libc_pic.os(.text+0x38f):
undefined reference to `__pthread_initial_thread'
/usr/local/src/glibc-2.3.2-linux-obj/libc_pic.os(.text+0x397):
undefined reference to `__pthread_manager_thread_bos'
/usr/local/src/glibc-2.3.2-linux-obj/libc_pic.os(.text+0x3a1):
undefined reference to `__pthread_manager_thread_tos'
/usr/local/src/glibc-2.3.2-linux-obj/libc_pic.os(.text+0x3ab):
undefined reference to `__pthread_manager_thread'
/usr/local/src/glibc-2.3.2-linux-obj/libc_pic.os(.text+0x3b3):
undefined reference to `__pthread_nonstandard_stacks'
/usr/local/src/glibc-2.3.2-linux-obj/libc_pic.os(.text+0x3bd):
undefined reference to `__pthread_find_self'
/usr/local/src/glibc-2.3.2-linux-obj/libc_pic.os: In function
`__socketpair':
__socketpair(.text+0xca332): undefined reference to
`__pthread_initial_thread_bos'
__socketpair(.text+0xca33c): undefined reference to
`__pthread_initial_thread'
__socketpair(.text+0xca344): undefined reference to
`__pthread_manager_thread_bos'
__socketpair(.text+0xca34e): undefined reference to
`__pthread_manager_thread_tos'
__socketpair(.text+0xca358): undefined reference to
`__pthread_manager_thread'
__socketpair(.text+0xca360): undefined reference to
`__pthread_nonstandard_stacks'
__socketpair(.text+0xca36a): undefined reference to
`__pthread_find_self'
__socketpair(.text+0xca427): undefined reference to
`__pthread_initial_thread_bos'
__socketpair(.text+0xca431): undefined reference to
`__pthread_initial_thread'
__socketpair(.text+0xca439): undefined reference to
`__pthread_manager_thread_bos'
__socketpair(.text+0xca443): undefined reference to
`__pthread_manager_thread_tos'
__socketpair(.text+0xca44d): undefined reference to
`__pthread_manager_thread'
__socketpair(.text+0xca455): undefined reference to
`__pthread_nonstandard_stacks'
__socketpair(.text+0xca45f): undefined reference to
`__pthread_find_self'
__socketpair(.text+0xcd3e1): undefined reference to
`__pthread_initial_thread_bos'
__socketpair(.text+0xcd3eb): undefined reference to
`__pthread_initial_thread'
__socketpair(.text+0xcd3f3): undefined reference to
`__pthread_manager_thread_bos'
__socketpair(.text+0xcd3fd): undefined reference to
`__pthread_manager_thread_tos'
__socketpair(.text+0xcd407): undefined reference to
`__pthread_manager_thread'
__socketpair(.text+0xcd40f): undefined reference to
`__pthread_nonstandard_stacks'
__socketpair(.text+0xcd419): undefined reference to
`__pthread_find_self'
/usr/local/src/glibc-2.3.2-linux-obj/libc_pic.os: In function `htons':
htons(.text+0xd032d): undefined reference to
`__pthread_initial_thread_bos'
htons(.text+0xd0337): undefined reference to
`__pthread_initial_thread'
htons(.text+0xd033f): undefined reference to
`__pthread_manager_thread_bos'
htons(.text+0xd0349): undefined reference to
`__pthread_manager_thread_tos'
htons(.text+0xd0353): undefined reference to
`__pthread_manager_thread'
htons(.text+0xd035b): undefined reference to
`__pthread_nonstandard_stacks'
htons(.text+0xd0365): undefined reference to `__pthread_find_self'
collect2: ld returned 1 exit status
make[1]: *** [/usr/local/src/glibc-2.3.2-linux-obj/libc.so] Error 1
make[1]: Leaving directory `/usr/local/src/glibc-2.3.2'
make: *** [all] Error 2

Regards,
 Frank Pettit




reply via email to

[Prev in Thread] Current Thread [Next in Thread]