Article View: gnu.g++.help
Article #663Re: Gnu ld and collect
From: Joe Buck
Date: Wed, 06 Jan 1993 20:43
Date: Wed, 06 Jan 1993 20:43
36 lines
2110 bytes
2110 bytes
In article <klamer.726308465@mi.el.utwente.nl> klamer@mi.el.utwente.nl (Klamer Schutte) writes: >I can see advantages in using both Gnu ld and collect for linking g++ >programs. (See FAQ for what reasons.) Is it possible to have both >link systems available at the same time? (With a command line switch >for g++, for example?) This can be made to work on some platforms (where collect and Gnu ld both work and accept the same format of object file). Here is one very ugly way to do it that I got to work. Let's say, for example, that you have 2.3.3 installed on a sparc. The compiler passes are then in (somewhere)/lib/gcc-lib/sparc/2.3.3 (the makefile variable "libsubdir" refers to this directory). As a first step, install gcc with "--with-gnu-ld" and put Gnu ld in the libsubdir directory. Now, create a directory (somewhere)/lib/gcc-lib/sparc/2.3.3-collect. Do a symbolic link to have everything in libsubdir appear in this directory as well. Install collect in this directory. Now, you can use collect by saying "gcc -V 2.3.3-collect". Furthermore, since only the link is different, you can omit the -V switch except when you are linking. Warning: on the sparc, the Gnu linker won't call constructors properly for code compiled by a gcc binary that was configured without the --with-gnu-ld switch (the stabs directives that gld needs will be missing), but collect will not care if the stabs are present. Since having the stabs present when they are unneeded is harmless (and the space required is tiny) I think they should always be generated on platforms with a.out-style objects. -- Joe Buck jbuck@ohm.berkeley.edu
Technical Details
Message-ID:
<1ifg91INNnfv@agate.berkeley.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!forney.berkeley.edu!jbuckReferences:
<klamer.726308465@mi.el.utwente.nl>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!forney.berkeley.edu!jbuck From: jbuck@forney.berkeley.edu (Joe Buck) Newsgroups: gnu.g++.help Subject: Re: Gnu ld and collect Date: 6 Jan 1993 20:43:13 GMT Organization: U. C. Berkeley Lines: 36 Message-ID: <1ifg91INNnfv@agate.berkeley.edu> References: <klamer.726308465@mi.el.utwente.nl> NNTP-Posting-Host: forney.berkeley.edu