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/libc.so.6: undefined reference to `_dl_...@GLIBC_2.2'


> From: Andreas Jaeger <aj@suse.de>
> Date: 01 Jan 2001 14:19:29 +0100
> Sender: owner-glibc-linux@ricardo.ecn.wfu.edu
> Reply-To: glibc-linux@ricardo.ecn.wfu.edu
> 
> >>>>> David Andrew Michael Noelle writes:
> 
> >> From: Andreas Jaeger <aj@suse.de>
> >> Date: 01 Jan 2001 12:27:36 +0100
> >> 
> >> How did you configure glibc?
> 
>  > I didn't.  I'm currently using the Slackware 7.1 glibc package.  I don't
>  > recall the specific options I used when I did try compiling it myself,
>  > but it wasn't anything unusual.
> But you did gave --prefix=/usr ?

No.  --prefix=/  Slackware keeps its libc and related libraries in /lib,
not /usr/lib.  Note the error messages below (and in my previous
messages) begin with "//lib/libc.so.6".  Is there some reason glibc
needs to be in /usr/lib?


>  > Thanks for confirming that, but could you please be a little more
>  > specific?  I figured it had *something* to do with the dynamic linker,
>  > since only libdl is generating these error messages.  I'm not getting
>  > any other unusual undefined references.
> 
> libdl is generating those?  Why didn't you mention this before?  When
> does it happen?  At link time?  Try invoking gcc with -Wl,-v (or
> -Wl,-verbose) to check that the correct libdl is included.

I don't understand your response.  Was "generating" the wrong word?
Doesn't the "_dl_" in each one of the undefined references mean that
they are references to functions in libdl?  Many, but not all, of the
programs that fail to link specify "-ldl" on their compile line.

There are no problems with running any software that is already
installed, or installing precompiled binaries, but when compiling new
software, the link step often fails with the same eleven undefined
references to functions that begin with "_dl_" and end with
"@GLIBC_2.2".  I haven't always checked, but I assume it only happens at
link time.  Is there some other step that I'm not aware of that can have
an "undefined reference" error message?


Here are a couple examples:

in "libiconv-1.5"

[...configuration and compilation proceed normally for a while, then...]
/bin/sh ../libtool --mode=link gcc -O  -I. -I. -I../include -I./../include -I../lib ./iconv.c ../lib/libiconv.la -o iconv
gcc -O -I. -I. -I../include -I./../include -I../lib ./iconv.c -Wl,--rpath -Wl,/usr/local/lib ../lib/.libs/libiconv.so -o .libs/iconv
//lib/libc.so.6: undefined reference to `_dl_out_of_memory@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_clktck@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_argv@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_debug_files@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_check_map_versions@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_load_lock@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_init_all_dirs@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_init@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_all_dirs@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_nloaded@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_pagesize@GLIBC_2.2'
collect2: ld returned 1 exit status
make[1]: *** [iconv] Error 1
make[1]: Leaving directory `/home/dave/download/libiconv-1.5/src'
make: *** [all] Error 2


Adding the "-Wl,-v" you suggested...

gcc -O -I. -I. -I../include -I./../include -I../lib ./iconv.c -Wl,--rpath -Wl,/usr/local/lib ../lib/.libs/libiconv.so -o .libs/iconv -Wl,-v
collect2 version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) (i386 Linux/ELF)
/usr/i386-slackware-linux/bin/ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o .libs/iconv /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/crtbegin.o -L/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66 -L/usr/i386-slackware-linux/lib /tmp/ccZS4bN6.o --rpath /usr/local/lib ../lib/.libs/libiconv.so -v -lgcc -lc -lgcc /usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/crtend.o /usr/lib/crtn.o
//lib/libc.so.6: undefined reference to `_dl_out_of_memory@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_clktck@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_argv@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_debug_files@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_check_map_versions@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_load_lock@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_init_all_dirs@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_init@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_all_dirs@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_nloaded@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_pagesize@GLIBC_2.2'
GNU ld version 2.10.90 (with BFD 2.10.0.24)
collect2: ld returned 1 exit status


I don't see where this tells me what libdl it's linking against, but
there's only one "libdl.a" on my system anyway, according to locate.  I
have several versions of libdl.so, though; 1.9.9, 2.1.2, 2.1.3, and
2.2.  /lib/libdl.so is a link to /lib/libdl.so.2, which is a link to
/lib/libdl-2.2.so


The recent kdemultimedia package fails similarly:

/bin/sh ../../../libtool --mode=link --tag=CXX g++  -O2 -fno-exceptions -fno-check-new -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long -fno-builtin -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST   -o mpgplay -L/usr/X11R6/lib -L/usr/lib/qt/lib -L/opt/kde/lib   mpgplay.o ../../lib/libmpeg.la -lX11 -lXext -lm -lstdc++ -lXxf86vm  -lcdda_paranoia -lcdda_interface  -lvorbisfile -lvorbis -logg -lpthread 
g++ -O2 -fno-exceptions -fno-check-new -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long -fno-builtin -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST -o .libs/mpgplay mpgplay.o  -L/usr/X11R6/lib -L/usr/lib/qt/lib -L/opt/kde/lib ../../lib/.libs/libmpeg.so -L/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66 -L/usr/i386-slackware-linux/lib -lc -lgcc -lX11 -lXext -lstdc++ -lXxf86vm -lcdda_paranoia -lcdda_interface /usr/local/lib/libvorbisfile.so /usr/local/lib/libvorbis.so -lm /usr/local/lib/libogg.so -lpthread -Wl,--rpath -Wl,/opt/kde/lib -Wl,--rpath -Wl,/usr/local/lib
//lib/libc.so.6: undefined reference to `_dl_out_of_memory@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_clktck@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_argv@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_debug_files@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_check_map_versions@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_load_lock@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_init_all_dirs@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_init@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_all_dirs@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_nloaded@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_pagesize@GLIBC_2.2'
collect2: ld returned 1 exit status
make[4]: *** [mpgplay] Error 1


Other examples include Xtheater and other programs that try to use SDL,
because they all fail to configure:

gcc -o conftest -g -O2 -I/usr/local/include -I/usr/local/include/SDL -D_REENTRANT   conftest.c  -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread 1>&5
//lib/libc.so.6: undefined reference to `_dl_out_of_memory@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_clktck@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_argv@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_debug_files@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_check_map_versions@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_load_lock@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_init_all_dirs@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_init@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_all_dirs@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_nloaded@GLIBC_2.2'
//lib/libc.so.6: undefined reference to `_dl_pagesize@GLIBC_2.2'
collect2: ld returned 1 exit status



>  > I've reinstalled the Slackware "glibc" and "ldso" packages several times
>  > and I've compiled them myself at least once each.  Can you tell me
>  > exactly what part of the dynamic linking system could be "broken" in
>  > such a way as to cause this, and where I can get one that might work
>  > correctly?  
> I don't know enough about Slackware to give any judgement about this
> but it might be that you have an old libdl, libc, or ld-linux.so lying
> around somewhere which gets used instead of the normal version.

I don't think so, but how do I check?  Is there some way to distinguish
an old library that's getting in the way from a "legacy" library that
supports old binaries or a current library that will render the system
instantly unusable if it's not there?  The problem I'm trying to solve
is a lot less severe than the problems I could cause by deleting the
wrong libdl, libc, or ld-linux.so.  And it's not severe enough to resort
to the Microsoft solution, format the hard disk and reinstall from CD.


-- 
            -Dave Noelle,                 dave@Straylight.org
            -the Villa Straylight,  http://www.straylight.org
Coalition Against Unsolicited Commercial Email  ==  http://www.cauce.com

Disclaimer: Any similarities to the opinions of any real or fictional 
persons, living, dead, or undead, are clearly the reader's own delusion.

Quote of the Day:
Death is a nonmaskable interrupt.   

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