Subject: Re: finding the linker with gcc3
To: James K. Lowden <jklowden@schemamania.org>
From: Frederick Bruckman <fredb@immanent.net>
List: tech-pkg
Date: 03/28/2004 15:30:40
On Sun, 28 Mar 2004, James K. Lowden wrote:

> I don't know how someone is supposed to know what version of ld he needs,
> without the aid of google.  From time to time, I'm sure the compiler folk=
s
> make changes that they know will mandate linker changes, but I couldn't
> find any statement in the gcc3 info pages or README, etc. indicating the
> minimum GNU linker version known to work.

I couldn't find that, either. It appears that they don't even try to
support downlevel binutils. Our gcc packages use any old linker at
their own peril.

> All I can say is that I wouldn't have looked for a make variable to gover=
n
> which linker gcc3 would invoke.  Only belatedly did I understand that gcc=
3
> didn't include a linker of its own (call me na=EFve, sure), and in any ca=
se
> I figured "export LD=3D/usr/pkg/bin/ld" should suffice.  I actually think
> it's a bit goofy that gcc doesn't inspect that environment variable,
> becuase I understand ${LD} to be widely used for that purpose.

They provide a facility to build the linker and compiler together,
it's just that the binutils and gcc are maintained and distributed by
different teams, so you have to merge the distributions by hand to do
that (or use CVS). "gcc" will also pick up and hard code the path to
installed "as" and "ld" at configure-time if they are obviously
family, that is, if they are found in "${prefix}${target}/bin".

There's a similar problem with the gcc-2.95.3 package. (See the
neighboring thread on that, which includes a couple of alternative
solutions for pkgsrc).

Frederick