..<stuff deleted>...
Quote:>>I have a problem compiling a program with gcc -g -lm; it bombs out with
>>the following error:
>>ld: Output file requires shared library `libc.so.4'
>>gcc: Internal compiler error: program ld got fatal signal 6
>>The problem can be worked around by either supplying -static or
>>/usr/lib/libc.sa on the compile line.
GCC specs file (at least that one I received with Slackware 2.1)
says in ld section: "If you get -g, link with libg.a". Libg is a static
version of libc carrying lots of debugging info. If you link with -g -lm,
the linker complains because it links dll version of libm that needs dll
version of libc. Option -static makes ld use static libm, libc.sa makes
ld include dll libc stubs (and yield exe using static and dll versions of
libc at once!).
I *COMPILE* with -g but *LINK* without it and I get an executable that
has debugging info for my own code (as usual, I am not interested in libc
internals) and links libraries dynamically (thus saving plenty of disk
space and memory).
Of course, you may like editing gcc's specs and get rid of the problem
forever.... :)
--
Sincerely, +-----------------------------------------
| DCIT s.r.o., CDMS, J. Martiho 2/407
Pavel Kankovsky aka PeaK | 160 41 Praha 6 - Veleslavin, Czech Rep.
| www: http://www.dcit.cz/
Disclaimer:
Unless explicitly stated otherwise, this document expresses personal
opinions of the author, and DCIT s.r.o. disclaims any responsibility
regarding its contents.