Occasional use of GNU ld problems
Brad Lucier
lucier@math.purdue.edu
Fri Jun 25 17:54:00 GMT 1999
I'm trying to compile Cilk (a parallel language based on C from
theory.lcs.mit.edu), which requires GNU ld, which I usually don't use,
so I installed it in /opt/binutils-2.9.1 on my Solaris 2.5.1 box.
So now I want egcs to see it and I find the FAQ advice:
GCC can not find GNU as/GNU ld
To ensure that EGCS finds the GNU assembler (the GNU loader), which are
required by some configurations, you should configure these with the
same --prefix option as you used for EGCS. Then build & install GNU as
(GNU ld) and proceed with building EGCS.
Another alternative is to create links to GNU as and ld in any of the
directories printed by the command `gcc -print-search-dirs | grep
'^programs:''. The link to `ld' should be named `real-ld' if `ld'
already exists.
Pre-1.2 snapshots of egcs allow you to specify the full pathname
of the assembler and the linker to use. The configure flags are
`--with-as=/path/to/as' and `--with-ld=/path/to/ld'. EGCS will try to use
these pathnames before looking for `as' or `(real-)ld' in the standard
search dirs. If, at configure-time, the specified programs are found to
be GNU utilities, `--with-gnu-as' and `--with-gnu-ld' need not be used;
these flags will be auto-detected.
<end of faq advice>
Alternative 2 is a real pain (although I suppose I could write a script
to do), and I'm working on the first alternative now, which I don't
really want to do, because I'm going to be building a series of temporary
snapshots of egcs in a directory (binutils) that otherwise I don't want
to fool around with.
But first I tried adding the '-B /opt/binutils-2.9.1/bin' option to
LDFLAGS in the makefiles for Cilk, which seemed to allow egcs to see
GNU ld, but then I had to rerun configure for some reason, and configure
uses 'gcc -print-prog-name=ld' to find out which ld gcc uses, and the
-B option doesn't seem to affect which load program is printed:
bessel-125% gcc -B /opt/binutils-2.9.1/bin -print-prog-name=ld
/usr/ccs/bin/ld
So the configure for Cilk bombs and says I need to use GNU ld.
So, I really think there should be an easier way for egcs to use
the GNU linker for occasional packages that need it.
Brad Lucier lucier@math.purdue.edu
More information about the Gcc
mailing list