gcc -g -lm -> ld error

gcc -g -lm -> ld error

Post by James Kingd » Tue, 17 Oct 1995 04:00:00



Hi,

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.

The installation is from a relatively recent slackware distribution.
(Sorry, I couldn't find a version number associated with the slackware
files. They were downloaded about 1 month ago.)

I did a quick search through this newsgroup before posting and found a
couple of references to the problem, but no actual solution.

Regards,
James.

 
 
 

gcc -g -lm -> ld error

Post by MB. Tayl » Thu, 26 Oct 1995 04:00:00




>I had the same error when compiling and found it was the -g part of the compile.
>I also had a quick look around and a similar post as yours. With no response.
>I decided to do away with the (-g) debug option since strace and a few printf's
>in the code can be used to debug simple errors instead of using gdb.
>glenn
>>Hi,
>>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.

It seems including a -static flag on the compile line does the trick.
I don't know if this counts as a proper solution or a bit of a kludge.

Mark

-----------------------------------------------------------------------
| Mark Beauchamp Taylor  -  physicist trapped in a chemist's body.    |

| Department of Chemistry, University of Bristol, UK                  -------
-----------------------------------------------------| ... It's the future! |
                                                     ------------------------

 
 
 

gcc -g -lm -> ld error

Post by Pavel Kankovsk » Fri, 27 Oct 1995 04:00:00


..<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.

 
 
 

gcc -g -lm -> ld error

Post by Zenon Fortu » Fri, 27 Oct 1995 04:00:00





>I had the same error when compiling and found it was the -g part of the compile.
>I also had a quick look around and a similar post as yours. With no response.
>I decided to do away with the (-g) debug option since strace and a few printf's
>in the code can be used to debug simple errors instead of using gdb.

>glenn

>>Hi,

>>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.

>>The installation is from a relatively recent slackware distribution.
>>(Sorry, I couldn't find a version number associated with the slackware
>>files. They were downloaded about 1 month ago.)

>>I did a quick search through this newsgroup before posting and found a
>>couple of references to the problem, but no actual solution.

A workaround is to create the following symbolic link:

        # cd /usr/lib; ln -s libc.sa libg.sa

If you run the Slackware 2.2.0(.1), look into
 ftp.netcom.com:/pub/ze/zenon/linux/Slackware2Fixes for more fixes.

 
 
 

1. Solaris 5.8: gcc - > getopt_long and ld: fatal error: ....

Hi,
I try to compile gcvs on my solaris 5.8 with gcc.
When linking I get:
--------------
Undefined               first referenced
  Symbol                     in file
getopt_long                     main.o
ld: fatal: Symbol referencing errors. No output written to cvstree
---------------

How can I circumvent this linker error?
Please cc to my private email as I am "a not too frequent" visitor ;-)
Regards
Clemens

2. Implementing File recovery in the solaris kernel

3. gcc-2.5.8 -> gcc-2.6.3 Help I get an error

4. Test Long file name in FAT (new fs/msdos) - Win95 and NT compatible !

5. Is gcc -shared = ld -d (something broke rh7.0 -> rh7.1)

6. remsh : Host address mismatch

7. GCC/ld error linking shared X libs

8. Smail kills me!

9. GCC/LD error values-Xa.o on Solaris 7 (Sparc)

10. ld 2.6.0.14 cannot open -lm or -lc

11. Help me please:gcc internal compiler error:fatal signal 6/ld.so.4

12. help with gcc/ld error re: libX11.so.6

13. ?? "ld: elf error:" from gcc-2.7.2 in solaris 2.5