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: Andreas Jaeger <aj@arthur.rhein-neckar.de>
- Date: 16 Sep 1998 07:11:49 +0200
- Cc: libc-alpha@cygnus.com
- Mail-Copies-To: never
- References: <199809160036.RAA04666@dshak.mcom.com>
>>>>> Dan Christian writes:
Dan> cat hello.c
Dan> #include <stdio.h>
Dan> int main (int argc, char **argv)
int main (void) is also allowed.
Dan> {
Dan> --argc, ++argv; /* use them or we get warnings */
Dan> printf ("Hello world\n");
Dan> return 0;
Dan> }
Dan> egcs -o hello -O -I/usr/local/include hello.c -L/usr/local/lib
Dan> /usr/local/lib/libc.so.6: undefined reference to `_dl_profile_output'
Dan> /usr/local/lib/libc.so.6: undefined reference to `__libc_stack_end'
Dan> /usr/local/lib/libc.so.6: undefined reference to `_dl_debug_impcalls'
Dan> /usr/local/lib/libc.so.6: undefined reference to `_dl_profile'
Dan> /usr/local/lib/libc.so.6: undefined reference to `_dl_check_all_versions'
Dan> /usr/local/lib/libc.so.6: undefined reference to `_dl_start_profile'
Dan> /usr/local/lib/libc.so.6: undefined reference to `_dl_mcount'
Dan> /usr/local/lib/libc.so.6: undefined reference to `_dl_debug_message'
Dan> /usr/local/lib/libc.so.6: undefined reference to `_dl_profile_map'
Dan> collect2: ld returned 1 exit status
Try:
egcs -o hello -O -I/usr/local/include hello.c -L/usr/local/lib \
-Wl,--rpath=/usr/local/liblib \
-Wl,--dynamic-linker=/usr/local/lib/ld-linux.so.2
The important one is the dynamic-linker. I guess you link (check with
gcc -Wl,-v) against /lib/ld-linux.so* which is wrong. You've got to
use the ld-linux.so.2 that comes with glibc2.0.95 together with the
libc that's part of 2.0.95.
Please check the FAQ entry 2.6 which explains the problem and gives
also another solution.
Andreas
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de