🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50610

Help: order of options to linker

#50610
From: Paul E. Rensing
Date: Wed, 08 Sep 1993 01:14
31 lines
1628 bytes
I am trying to link FORTRAN and C++ code together on a Sun. For some reason,
_main out of libF77.a is getting pulled in. However, I can fix it if I link
the FORTRAN library statically. What I wanted to do was this:

    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 also tried using -Wl,-Bstatic,-lF77,-Bdynamic but this produced:

   ld ... -Bstatic -lF77 -Bdynamic ... <.o files> ...

so libF77.a was never used!

Is there any way in gcc to specify an option that will NOT get shuffled by
gcc? It would seem to me that there really ought to be something, but I could
not find it.

		Paul Rensing

--
Paul Rensing
SLAC, Group B (SLD CRID and LASS)
Home: (415) 327-3751
Work: (415) 926-3593
rensing@slac.stanford.edu
Technical Details
Message-ID: <RENSING.93Sep7181414@egret.SLAC.Stanford.EDU>
Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!mcsun!uunet!spool.mu.edu!uwm.edu!linac!unixhub!SLAC.Stanford.EDU!rensing

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,d364459be080686b,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-09-08 01:36:34 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!mcsun!uunet!spool.mu.edu!uwm.edu!linac!unixhub!SLAC.Stanford.EDU!rensing
From: rensing@egret.SLAC.Stanford.EDU (Paul E. Rensing)
Subject: Help: order of options to linker
Message-ID: <RENSING.93Sep7181414@egret.SLAC.Stanford.EDU>
Sender: news@unixhub.SLAC.Stanford.EDU
Reply-To: rensing@slac.stanford.edu
Organization: Stanford Linear Accelerator Center
Date: Wed, 8 Sep 1993 01:14:14 GMT
Lines: 31