This is the mail archive of the
libc-alpha@cygnus.com
mailing list for the glibc project.
Re: Linking always generates _dl undefines
- To: Dan Christian <robodan@netscape.com>
- Subject: Re: Linking always generates _dl undefines
- From: Myles Uyema <myles@uyema.nws.net>
- Date: Tue, 15 Sep 1998 17:59:49 -1000 (HST)
- cc: libc-alpha@cygnus.com
On Tue, 15 Sep 1998, Dan Christian wrote:
> >Submitter-Id: net
> >Originator:
> >Organization:
> _______________________________________________________________________
> The opinions expressed are mine alone and should not be subpoenaed by anyone.
> Dan Christian (650) 937-2125 FAX 937-5425
> >
> >Confidential: no
> >Synopsis: Trying to link against glibc generates many _dl_ undefs
> >Severity: critical
> >Priority: high
> >Category: libc
> >Class: sw-bug
> >Release: libc-2.0.95
> >Environment:
> Linux, 2.1.121, i686, Main libs glibc 2.0.7
> Host type: i686-pc-linux-gnu
> System: Linux dshak.mcom.com 2.1.121 #2 SMP Tue Sep 15 09:36:00 PDT 1998 i686 unknown
> Architecture: i686
>
> Addons: crypt linuxthreads
>
> Build CC: egcs
> Compiler version: egcs-2.90.29 980515 (egcs-1.0.3 release)
> Kernel headers: 2.1.121
> Symbol versioning: yes
> Build static: yes
> Build shared: yes
> Build pic-default: no
> Build profile: yes
> Build omitfp: no
> Build bounded: no
> Build static-nss: no
> Stdio: libio
>
> >Description:
> cat hello.c
> #include <stdio.h>
> int main (int argc, char **argv)
> {
> --argc, ++argv; /* use them or we get warnings */
> printf ("Hello world\n");
> return 0;
> }
>
> egcs -o hello -O -I/usr/local/include hello.c -L/usr/local/lib
> /usr/local/lib/libc.so.6: undefined reference to `_dl_profile_output'
> /usr/local/lib/libc.so.6: undefined reference to `__libc_stack_end'
> /usr/local/lib/libc.so.6: undefined reference to `_dl_debug_impcalls'
> /usr/local/lib/libc.so.6: undefined reference to `_dl_profile'
> /usr/local/lib/libc.so.6: undefined reference to `_dl_check_all_versions'
> /usr/local/lib/libc.so.6: undefined reference to `_dl_start_profile'
> /usr/local/lib/libc.so.6: undefined reference to `_dl_mcount'
> /usr/local/lib/libc.so.6: undefined reference to `_dl_debug_message'
> /usr/local/lib/libc.so.6: undefined reference to `_dl_profile_map'
> collect2: ld returned 1 exit status
>
> Also, linking with -static will generate an executable that always core dumps.
>
I believe the problem is that, while glibc-2.0.95 is installed to
/usr/local, your C compiler is configured to look to link against
/lib/ld-linux.so.2
It's in the specs file (gcc -v)
and you can override it with
gcc -dynamic-linker /usr/local/lib/ld-linux.so.2 ...