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

Re: gcc can't compile, egcc can!??



It looks to me as if the gcc drivers aren't doing anything wrong.  But
this is a big fat clue:

>ld: warning: libm.so.6, needed by /usr/lib/libstdc++.so, may conflict with lib
>m.so.5
>ld: warning: libc.so.6, needed by /lib/libm.so.6, may conflict with libc.so.5

The linker called by gcc/g++ 2.7 is attempting to link your program
with the crt1.o from libc6 but the dynamic library from libc5.  That
implies you have strange environment variable settings or mangled
linker config files.  egcc has a wrapper for ld which is smart enough
to straighten this out.

If you have environment variables named LD_somethingorother
(LD_RUN_PATH, LD_LIBRARY_PATH, etc.) unset them and try again to
compile with gcc 2.7.  Also, do this:

ld --verbose | more

This will produce much incomprehensible output; you care only about
the first few lines, which should read like this:

GNU ld version 2.8.2 (with BFD 2.8.1.0.25)
  Supported emulations:
   elf_i386
   i386linux
using internal linker script:
==================================================
OUTPUT_FORMAT("elf32-i386", "elf32-i386",
              "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); 
SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/elf_i386/lib);

If it doesn't say "using internal linker script", or if any of the
SEARCH_DIR entries have the word `libc5' in them, you have a problem
with your linker installation.

>% cat /usr/lib/libc.so
>/* GNU ld script
>   Use the shared library, but some functions are only in
>   the static library, so try that secondarily.  */
>GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )

*blink* I thought that was only in development libc.  What do you get
if you execute /lib/libc.so.6 as a program?

zw


--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: