[gnu.gcc] Using ld instead of gcc-ld

mikeb@coho.ee.ubc.ca (Mike Bolotski) (02/07/90)

Is there an easy way to tell gcc to use the system-provided ld instead
of the GNU ld (installed for g++)?

I could hack the find_exec_file function in gcc.c to look for "ld" and
not search the lib directory, but that's real ugly.



Mike Bolotski, Department of Electrical Engineering,
               University of British Columbia, Vancouver, Canada 
mikeb@salmon.ee.ubc.ca             | mikeb%salmon.ee.ubc.ca@relay.ubc.ca
salmon.ee.ubc.ca!mikeb@uunet.uu.net| uunet!ubc-cs!salmon.ee.ubc.ca!mikeb

khera@CS.DUKE.EDU (Vick Khera) (02/08/90)

+---------
| From: mikeb@coho.ee.ubc.ca (Mike Bolotski)
| Subject: Using ld instead of gcc-ld
| Newsgroups: gnu.gcc
| Date: 6 Feb 90 23:57:36 GMT
|
| Is there an easy way to tell gcc to use the system-provided ld instead
| of the GNU ld (installed for g++)?
|
| Mike Bolotski, Department of Electrical Engineering,
| University of British Columbia, Vancouver, Canada 
| mikeb@salmon.ee.ubc.ca             | mikeb%salmon.ee.ubc.ca@relay.ubc.ca
| salmon.ee.ubc.ca!mikeb@uunet.uu.net| uunet!ubc-cs!salmon.ee.ubc.ca!mikeb
+---------

here is what i did.  i changed the installation of ld from .../lib/gcc-ld to
.../lib/gcc-ld++. then in gcc.c (in the g++ distribution) i changed the
definition of link_spec to look for ld++ rather than ld. now g++ looks for
ld++ and only finds it in .../lib/gcc-ld++ and gcc looks for ld, and finds
the original system supplied one. this way i get dynamic libraries for gcc
(i run SunOS 4.0.3), and the appropriate linking for g++.

								v.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vick Khera                              Department of Computer Science
ARPA:   khera@cs.duke.edu               Duke University
UUCP:   ..!{mcnc,decvax}!duke!khera     Durham, NC 27706

ghfeil@white.toronto.edu (Georg Feil) (02/08/90)

I ran into precisely this problem: I wanted g++ and gcc to use different
linkers. However, both look for .../lib/gcc-ld by default.

I changed my g++ makefile so that the GNU tool prefix is g++-* instead of
gcc-*. Thus my .../lib directory contains the following:

g++-as@       g++-gnulib@   gcc-as@       gcc-gnulib*
g++-cc1plus*  g++-include/  gcc-cc1*      gcc-include/
g++-cpp@      g++-ld@       gcc-cpp*      gcc-ld@

I think this change should be adopted by the g++ camp. At the very worst,
you will just have to add a few g++-* symbolic links pointing at the gcc-*
files.

Georg.
--
Georg Feil                                 Internet: ghfeil@white.toronto.edu
                                             -or-  : georg@sgl.ists.ca
..if all else fails, try:
{uunet,pyramid,watmath,utzoo}!utcsri!white!ghfeil      (UUCP)
ghfeil%white.toronto.edu@relay.cs.net                  (ARPA)