Article View: gnu.gcc.help
Article #51007Re: Getting gcc 2.4+ to build dynamic linked progs on SunOS 4.x
From: Michael Salmon
Date: Mon, 12 Jul 1993 07:53
Date: Mon, 12 Jul 1993 07:53
33 lines
2182 bytes
2182 bytes
In article <21ka9a$rip@tramp.cc.utexas.edu> mccoy@ccwf.cc.utexas.edu (Jim McCoy) writes: |> |> Has some default changed somewhere in gcc 2.4.[whatever...] that no longer |> lets it make a dynamically linked execuatable? I have no problems doing so |> using a copy of gcc 2.3.3 that I keep around for this reason, but not one |> of the 2.4 versions has been able to do this. Contrary to the man page, |> gcc does not recognize the "-shared" flag and the inability of 2.4.x to |> dynamic link and the ability of 2.3.3 to be able to do so seems to happen |> regardless of whether or not the default ld or gnu ld is found first in my |> path. |> |> Any assistance or explanation would be appreciated... gcc, regardless of version, doesn't build executables, it calls either gld or ld to do that. gld in fact cannot build a dynamically linked executable, only ld can do that. The current gcc configuration renames collect2 to ld which then invokes gld if it can find it and the original ld otherwise. Hence if you want dynamically linked executables you must remove all copies of gld that collect2 is likely to find. Also note that the -shared flag is to be used to create an object file that can later be shared, the flag that you want is -dynamic. -- Michael Salmon #include <standard.disclaimer> #include <witty.saying> #include <fancy.pseudo.graphics> Ericsson Telecom AB Stockholm
Technical Details
Message-ID:
<1993Jul12.075340.8354@ericsson.se>Path:
arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!noc.near.net!uunet!pipex!sunic!ericom!eos.ericsson.se!etxmesaReferences:
<21ka9a$rip@tramp.cc.utexas.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,8440fa119c54f10a X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-07-12 01:18:45 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!noc.near.net!uunet!pipex!sunic!ericom!eos.ericsson.se!etxmesa From: etxmesa@eos.ericsson.se (Michael Salmon) Subject: Re: Getting gcc 2.4+ to build dynamic linked progs on SunOS 4.x Message-ID: <1993Jul12.075340.8354@ericsson.se> Sender: etxmesa@eos6c02 (Michael Salmon) Nntp-Posting-Host: eos6c02.ericsson.se Reply-To: etxmesa@eos.ericsson.se (Michael Salmon) Organization: Ericsson Telecom AB References: <21ka9a$rip@tramp.cc.utexas.edu> Date: Mon, 12 Jul 1993 07:53:40 GMT Lines: 33