Article View: gnu.gcc.help
Article #53690Re: gcc-ld, g++, gcc and SunOS 4.1.1
From: Ethan Bradford
Date: Thu, 08 Aug 1991 00:10
Date: Thu, 08 Aug 1991 00:10
36 lines
2229 bytes
2229 bytes
From alt.sys.sun:
From: ken@syd.dit.CSIRO.AU (Ken.Yap)
Newsgroups: alt.sys.sun
Subject: Re: avoiding gcc-ld with gcc
Date: 4 Aug 91 23:55:35 GMT
Organization: CSIRO Division of Info Tech, Sydney, Australia
>Don't know what you were expecting, but I doubt it will work for the
>above case. The problem is that Sun's ld won't work with object code
>created by g++, you have to use gcc-ld. But, as was pointed out, gcc-ld
>does not handle shared libraries, so when compiling with gcc it's better
>to use the standard ld. What this means is that you have to have some
>way to tell g++ to use gcc-ld while keeping gcc from using it, but they
>both use the exact same method to determine which ld to use. Mainly,
>check to see if gcc-ld exists, and if so, use it.
>
>To fix the problem here I changed the g++ front end to look for g++-ld
>and use it, and put gcc-ld in /usr/local/lib as g++-ld. Not a real
>elegant solution, but one that works.
That is correct. g++ requires gcc-ld, not /bin/ld. Here I solved the
problem by
ln -s /bin/ld /usr/local/lib/ld
and
gcc ... -B/usr/local/lib/ ...
This causes /bin/ld to be used in preference to gcc-ld. The reason I
don't just say -B/bin/ is so as not to get /bin/as. Perhaps it might be
better to get g++ to call g++-ld, and then gcc-ld can be a link to
/bin/ld.
--
-- Ethan (ethanb@u.washington.edu)
Technical Details
Message-ID:
<ETHANB.91Aug7201046@ptolemy.u.washington.edu>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!caen!dali.cs.montana.edu!milton!milton.u.washington.edu!ethanbReferences:
<19183@darkstar.ucsc.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,7f3ce1bdf9dfe422,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1991-08-08 01:04:28 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!caen!dali.cs.montana.edu!milton!milton.u.washington.edu!ethanb From: ethanb@ptolemy.u.washington.edu (Ethan Bradford) Newsgroups: gnu.gcc.help Subject: Re: gcc-ld, g++, gcc and SunOS 4.1.1 Message-ID: <ETHANB.91Aug7201046@ptolemy.u.washington.edu> Date: 8 Aug 91 00:10:46 GMT References: <19183@darkstar.ucsc.edu> Sender: news@milton.u.washington.edu (News) Followup-To: gnu.gcc.help Organization: U. of Washington Lines: 36 In-Reply-To: jik@cats.ucsc.edu's message of 7 Aug 91 23:15:41 GMT