an installation bug in either gcc, gld, or readline -- I don't know which
Phil Edwards
pedwards@disaster.jaj.com
Wed Dec 26 16:12:00 GMT 2001
On Wed, Dec 26, 2001 at 05:40:45PM -0500, Andrew Koenig wrote:
> Phil> The -shared option, among others, /is/ translated by the compiler driver into
> Phil> linker-specific options. One of the most common bug reports we get occurs
> Phil> when Solaris users configure GCC to use {Sun,GNU} linkers and assemblers,
> Phil> but at runtime "the other one" is actually found.
>
> That makes sense. Sigh.
It's a tangle. Most of the bug reports actually occur when the above
confusion takes place while /building/ GCC, not while using it. There's no
particular bug in the GCC build; many of us consider the "bug" to be that
so many people fall into this trap so easily, but we don't have any good
solutions in mind.
> Phil> Ideally, readline and suchlike need to ask GCC "hey, what linker are you
> Phil> using?" and GCC needs to answer in a portable way. Right now this isn't
> Phil> possible at either end. Hmmm...
>
> Phil> I think I ended up installing two copies of GCC on my Solaris boxes:
> Phil> the default uses GNU backend tools, and for those packages which care,
> Phil> another copy uses only Sun tools.
>
> Ouch! Surely there must be an easier way.
The pain is alleviated by having the common files shared between the two
installations, but yeah, it shouldn't be necessary in the first place.
The "which linker are you using" question can actually be asked:
gcc -print-prog-name=ld
but the answer isn't portable, and it /does/ depend on PATH issues.
(But it's the PATH at build time, not at runtime/"inquire time", if I
recall correctly.)
On some systems, I get a full path, on others I get only "ld". On those
with a full path, readline could do something like
case `$CC -print-prog-name=ld` in
*ccs/bin/ld) use Sun options ;;
*) assume GNU ;;
esac
or whatever. But then that starts depending on symlinks and installation
paths, etc. Using
`gcc -print-prog-name=ld` -v
might work... bleah.
> >> It's a mountain pass in Norway named Trollstigveien. It is even more
> >> astonishing in person than in the photo.
>
> Phil> Thanks! (Boy, our guess was so wrong...)
>
> What was your guess?
Either Rocky Mountain National Park, or somewhere in Switzerland.
Phil
--
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams
More information about the Gcc-bugs
mailing list