🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50611

Re: Help: order of options to linker

#50611
From: D. Erway
Date: Wed, 08 Sep 1993 06:06
20 lines
1633 bytes
In article <RENSING.93Sep7181414@egret.SLAC.Stanford.EDU>,
Paul E. Rensing <rensing@slac.stanford.edu> wrote:
>
>    g++ ...  -Xlinker -Bstatic -lF77 -Xlinker -Bdynamic ...
>
>so that only the FORTRAN library would be linked statically. However, it does
>not work because gcc collects all the linker options and sticks them at the
>front and they cancel out:
>  
>   ld ... -Bstatic -Bdynamic ... -lF77 ...

I often have my makefiles call ld directly to build the final object. That way
I for sure have control, and do not have to worry about finagling the options
through gcc. Of course you have to get in all the hidden goodies that gcc/g++
will through in.

With g++, it might be more complicated to bypass it for the final link. Then,
you could do a partial pre-link directly using ld, to get say the F77 library
and most of the objects linked together statically, then pass the resultant .o
file to the final link via g++.
Technical Details
Message-ID: <26jspqINNn6e@gap.caltech.edu>
Path: arc1-ca.pugleaf.net!gmd.de!rrz.uni-koeln.de!news.dfn.de!darwin.sura.net!howland.reston.ans.net!usc!cs.utexas.edu!uunet!news.claremont.edu!nntp-server.caltech.edu!derway
References: <RENSING.93Sep7181414@egret.SLAC.Stanford.EDU>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,d364459be080686b
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-09-08 03:09:33 PST
Path: arc1-ca.pugleaf.net!gmd.de!rrz.uni-koeln.de!news.dfn.de!darwin.sura.net!howland.reston.ans.net!usc!cs.utexas.edu!uunet!news.claremont.edu!nntp-server.caltech.edu!derway
From: derway@cco.caltech.edu (D. Erway)
Newsgroups: gnu.gcc.help
Subject: Re: Help: order of options to linker
Date: 8 Sep 1993 06:06:50 GMT
Organization: California Institute of Technology, Pasadena
Lines: 23
Message-ID: <26jspqINNn6e@gap.caltech.edu>
References: <RENSING.93Sep7181414@egret.SLAC.Stanford.EDU>
NNTP-Posting-Host: alumni.caltech.edu