public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Q: gcc with binutils ld?
@ 2001-08-15  4:50 Heiko Nardmann
  2001-08-15  5:01 ` Alan Modra
  0 siblings, 1 reply; 7+ messages in thread
From: Heiko Nardmann @ 2001-08-15  4:50 UTC (permalink / raw)
  To: binutils

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a precompiled version of gcc on my Solaris machine which uses the 
native Sun linker. Is there any way other than recompiling gcc to tell gcc to 
use the binutils ld?

Thanks in advance!

- -- 
Heiko Nardmann (Dipl.-Ing.), h.nardmann@secunet.de, Software Development
secunet Security Networks AG - Sicherheit in Netzwerken (www.secunet.de),
Weidenauer Str. 223-225, D-57076 Siegen
Tel. : +49 271 48950-13, Fax  : +49 271 48950-50
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7emIKpm53PRScYygRAoiAAKCuEYkjY9IAFfg10PNgfts2BESBHgCfa7v+
QA6bDQcbBipB33HrPLQnNMk=
=Vz+g
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Q: gcc with binutils ld?
  2001-08-15  4:50 Q: gcc with binutils ld? Heiko Nardmann
@ 2001-08-15  5:01 ` Alan Modra
  2001-08-15  5:16   ` Heiko Nardmann
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Modra @ 2001-08-15  5:01 UTC (permalink / raw)
  To: Heiko Nardmann; +Cc: binutils

On Wed, Aug 15, 2001 at 01:50:33PM +0200, Heiko Nardmann wrote:
> 
> I have a precompiled version of gcc on my Solaris machine which uses the 
> native Sun linker. Is there any way other than recompiling gcc to tell gcc to 
> use the binutils ld?

Modify the appropriate entry in the gcc specs file.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Q: gcc with binutils ld?
  2001-08-15  5:01 ` Alan Modra
@ 2001-08-15  5:16   ` Heiko Nardmann
  2001-08-15  6:52     ` Alan Modra
                       ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Heiko Nardmann @ 2001-08-15  5:16 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 15 August 2001 14:01, Alan Modra wrote:
> On Wed, Aug 15, 2001 at 01:50:33PM +0200, Heiko Nardmann wrote:
> > I have a precompiled version of gcc on my Solaris machine which uses the
> > native Sun linker. Is there any way other than recompiling gcc to tell
> > gcc to use the binutils ld?
>
> Modify the appropriate entry in the gcc specs file.

Hmm ... I did not find an entry for the path to the ld binary. I already put 
the binutils path in front of /usr/ccs/bin but gcc still uses Sun ld. Here is 
my specs file; what shall I change?

BTW: where do I find a description/specification for the specs file? I 
searched the info pages but could not find anything other than the 
description of the '-specs' command line switch.

*asm:
%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s %{fpic:-K PIC} 
%{fPIC:-K PIC} %(asm_cpu)

*asm_final:
%|

*cpp:
%(cpp_cpu) %(cpp_arch) %(cpp_endian) %(cpp_subtarget)

*cc1:
%{sun4:} %{target:} %{mcypress:-mcpu=cypress} %{msparclite:-mcpu=sparclite} 
%{mf930:-mcpu=f930} %{mf934:-mcpu=f934} %{mv8:-mcpu=v8} 
%{msupersparc:-mcpu=supersparc}

*cc1plus:


*endfile:
crtend.o%s crtn.o%s

*link:
%{h*} %{v:-V}    %{b} %{Wl,*:%*}    %{static:-dn -Bstatic}    %{shared:-G -dy 
%{!mimpure-text:-z text}}    %{symbolic:-Bsymbolic -G -dy -z text}    %{G:-G} 
   %{YP,*}    %{R*}    %{compat-bsd:      %{!YP,*:%{p:-Y 
P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib}        
%{pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib}  
      %{!p:%{!pg:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}}      -R 
/usr/ucblib}    %{!compat-bsd:      %{!YP,*:%{p:-Y 
P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib}        %{pg:-Y 
P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib}        %{!p:%{!pg:-Y 
P,/usr/ccs/lib:/usr/lib}}}}    %{Qy:} %{!Qn:-Qy}

*lib:
%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio}    %{!shared:     %{!symbolic: 
      %{pthreads:-lpthread}        %{!pthreads:%{threads:-lthread}}        
- -lc}}

*libgcc:
- -lgcc

*startfile:
%{!shared:                       %{!symbolic:                     
%{p:mcrt1.o%s}                           %{!p:                            
%{pg:gcrt1.o%s gmon.o%s}
                    %{!pg:crt1.o%s}}}}                  crti.o%s              
          %{ansi:values-Xc.o%s}                   %{!ansi:                    
     %{traditional:values-Xt.o%s}                         
%{!traditional:values-Xa.o%s}}                         crtbegin.o%s

*switches_need_spaces:


*signed_char:
%{funsigned-char:-D__CHAR_UNSIGNED__}

*predefines:
- -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -Asystem(unix) -Asystem(svr4)

*cross_compile:
0

*version:
2.95.2

*multilib:
. ;
 
*multilib_defaults:
 
 
*multilib_extra:
 
 
*multilib_matches:
 
 
*linker:
collect2
 
*cpp_cpu:
%{mcypress:} %{msparclite:-D__sparclite__} %{mf930:-D__sparclite__} 
%{mf934:-D__sparclite__} %{mv8:-D__sparc_v8__} %{msupersparc:-D__supersparc__ 
- -D__sparc_v8__} %{mcpu=sparclet:-D__sparclet__} %{mcpu=tsc701:-D__sparclet__} 
%{mcpu=sparclite:-D__sparclite__} %{mcpu=f930:-D__sparclite__} 
%{mcpu=f934:-D__sparclite__} %{mcpu=v8:-D__sparc_v8__} 
%{mcpu=supersparc:-D__supersparc__ -D__sparc_v8__} 
%{mcpu=hypersparc:-D__hypersparc__ -D__sparc_v8__} 
%{mcpu=sparclite86x:-D__sparclite86x__ -D__sparc_v8__} 
%{mcpu=v9:-D__sparc_v9__} %{mcpu=ultrasparc:-D__sparc_v9__} 
%{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:%(cpp_cpu_default)}}}}}}}
 
*cpp_cpu_default:
 
 
*cpp_arch32:
- -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc)
 
*cpp_arch64:
- -D__arch64__ -Acpu(sparc64) -Amachine(sparc64)
 
*cpp_arch_default:
- -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc)
 
*cpp_arch:
%{m32:%(cpp_arch32)} %{m64:%(cpp_arch64)} %{!m32:%{!m64:%(cpp_arch_default)}}
 
*cpp_endian:
%{mlittle-endian:-D__LITTLE_ENDIAN__} 
%{mlittle-endian-data:-D__LITTLE_ENDIAN_DATA__}
 
*cpp_subtarget:
%{pthreads:-D_REENTRANT -D_PTHREADS} %{!pthreads:%{threads:-D_REENTRANT 
- -D_SOLARIS_THREADS}} %{compat-bsd:-iwithprefixbefore ucbinclude 
- -I/usr/ucbinclude}
 
*asm_cpu:
%{mcpu=v8plus:-xarch=v8plus} %{mcpu=ultrasparc:-xarch=v8plusa} 
%{!mcpu*:%(asm_cpu_default)}
 
*asm_cpu_default:
 
 
*asm_arch32:
- -32
 
*asm_arch64:
- -64
 
*asm_arch_default:
- -32
 
*asm_arch:
%{m32:%(asm_arch32)} %{m64:%(asm_arch64)} %{!m32:%{!m64:%(asm_arch_default)}}
 
*link_command:
%{!fsyntax-only:  %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} 
%{e*} %{m} %{N} %{n}                        %{r} %{s} %{t} %{u*} %{x} %{z} 
%{Z}                 %{!A:%{!nostdlib:%{!nostartfiles:%S}}}                   
%{static:} %{L*} %D %o                  %{!nostdlib:%{!nodefaultlibs:%G %L 
%G}}                 %{!A:%{!nostdlib:%{!nostartfiles:%E}}}                   
    %{T*}
 }}}}}}


- -- 
Heiko Nardmann (Dipl.-Ing.), h.nardmann@secunet.de, Software Development
secunet Security Networks AG - Sicherheit in Netzwerken (www.secunet.de),
Weidenauer Str. 223-225, D-57076 Siegen
Tel. : +49 271 48950-13, Fax  : +49 271 48950-50
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7emgNpm53PRScYygRAm4yAKCq5v/8Rp0u1wjURaB/P1m5L2HAPQCgxsR5
KtkjDg/flY4oId/gaSHducw=
=lrsk
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Q: gcc with binutils ld?
  2001-08-15  5:16   ` Heiko Nardmann
@ 2001-08-15  6:52     ` Alan Modra
  2001-08-15  7:02     ` Nick Clifton
  2001-08-15  7:08     ` Q: gcc with binutils ld? Tom Rix
  2 siblings, 0 replies; 7+ messages in thread
From: Alan Modra @ 2001-08-15  6:52 UTC (permalink / raw)
  To: Heiko Nardmann; +Cc: binutils

On Wed, Aug 15, 2001 at 02:16:12PM +0200, Heiko Nardmann wrote:
>  
> *linker:
> collect2

Hmm, I was forgetting about collect2.  If you're not doiing c++, then
you could just change collect2 above to point to your desired ld.  I
might be wrong on this, it's hard to keep up with all the details of
gcc.

Alan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Q: gcc with binutils ld?
  2001-08-15  5:16   ` Heiko Nardmann
  2001-08-15  6:52     ` Alan Modra
@ 2001-08-15  7:02     ` Nick Clifton
  2001-08-15  9:02       ` Q: gcc with binutils ld? (kind of summary) Heiko Nardmann
  2001-08-15  7:08     ` Q: gcc with binutils ld? Tom Rix
  2 siblings, 1 reply; 7+ messages in thread
From: Nick Clifton @ 2001-08-15  7:02 UTC (permalink / raw)
  To: Heiko Nardmann; +Cc: binutils

Hi Heiko,

> Hmm ... I did not find an entry for the path to the ld binary. I
> already put the binutils path in front of /usr/ccs/bin but gcc still
> uses Sun ld. Here is my specs file; what shall I change?

In theory the entry to change is this one:

> *linker:
> collect2

Since however, gcc is using collect2 you may not want to change this.
(Or you may want to jsut recompile collect2 and change its default
linker....).
 
> BTW: where do I find a description/specification for the specs file?
> I searched the info pages but could not find anything other than the 
> description of the '-specs' command line switch.

It is documented in the gcc/doc/invoke.texi.  Depending upon how old
your gcc sources are you may have to search around for this file, or
the 'Spec Files' node may be missing entirely.

Cheers
        Nick

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Q: gcc with binutils ld?
  2001-08-15  5:16   ` Heiko Nardmann
  2001-08-15  6:52     ` Alan Modra
  2001-08-15  7:02     ` Nick Clifton
@ 2001-08-15  7:08     ` Tom Rix
  2 siblings, 0 replies; 7+ messages in thread
From: Tom Rix @ 2001-08-15  7:08 UTC (permalink / raw)
  To: Heiko Nardmann; +Cc: binutils

In your spec file, under the heading 

*linker:
collect2

You could try a couple of things.  First collect2 is a gcc wrapper around the
true linker.  You may just have to set your envionment PATH to point to the new
gnu linker.  A risky thing to do would be to change "collect2" to
"/path_to_gnu_linker/ld"

collect2 has a verbose output setting.  If you want to see if it is finding the
correct linker when you can add 

-Xlinker -debug 

to a sample compile to see where the linker (and a lot of other stuff) is coming
from.

Tom 
-- 
Tom Rix 
GCC Engineer
trix@redhat.com
256.704.9201

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Q: gcc with binutils ld? (kind of summary)
  2001-08-15  7:02     ` Nick Clifton
@ 2001-08-15  9:02       ` Heiko Nardmann
  0 siblings, 0 replies; 7+ messages in thread
From: Heiko Nardmann @ 2001-08-15  9:02 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 15 August 2001 15:59, Nick Clifton wrote:
> Hi Heiko,
>
> > Hmm ... I did not find an entry for the path to the ld binary. I
> > already put the binutils path in front of /usr/ccs/bin but gcc still
> > uses Sun ld. Here is my specs file; what shall I change?
>
> In theory the entry to change is this one:
> > *linker:
> > collect2
>
> Since however, gcc is using collect2 you may not want to change this.
> (Or you may want to jsut recompile collect2 and change its default
> linker....).
>

Anyway, I am going to give it a try with a local specs file (as Alan Modra 
stated), changing collect2 to the binutils ld path tomorrow ...

I am also going to try 

- -Xlinker -debug

as an option for collect2 in the specs file as Tom Rix stated.

[snip]
> It is documented in the gcc/doc/invoke.texi.  Depending upon how old
> your gcc sources are you may have to search around for this file, or
> the 'Spec Files' node may be missing entirely.

I had a look into the 2.95.3 of invoke.texi. Nothing. But calling

collect2 --help

seems to be quite useful. I am going to have a look at it ...

Thanks for everyone answering.

Maybe then I just can use '-fini' and '-init' without further consideration 
how it is passed to the underlying assember and/or OS (for defining 
entry/exit points for a shared object).

- -- 
Heiko Nardmann (Dipl.-Ing.), h.nardmann@secunet.de, Software Development
secunet Security Networks AG - Sicherheit in Netzwerken (www.secunet.de),
Weidenauer Str. 223-225, D-57076 Siegen
Tel. : +49 271 48950-13, Fax  : +49 271 48950-50
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7epzkpm53PRScYygRAuChAJ9N42iA5hdB0akwhQgsFmkQcMsaigCfaNQE
yTYyJxUS2TdCO2ife6e6Um8=
=KGbJ
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-08-15  9:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-15  4:50 Q: gcc with binutils ld? Heiko Nardmann
2001-08-15  5:01 ` Alan Modra
2001-08-15  5:16   ` Heiko Nardmann
2001-08-15  6:52     ` Alan Modra
2001-08-15  7:02     ` Nick Clifton
2001-08-15  9:02       ` Q: gcc with binutils ld? (kind of summary) Heiko Nardmann
2001-08-15  7:08     ` Q: gcc with binutils ld? Tom Rix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).