[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I test if the GNU or Sun linker is used?

From: Dr. David Kirkby
Subject: Re: How can I test if the GNU or Sun linker is used?
Date: Fri, 07 Aug 2009 03:26:33 +0100
User-agent: Thunderbird (X11/20090218)

Russ Allbery wrote:
Philip Herron <address@hidden> writes:

All you should really care about is making sure your environment has a
compatible c compiler or whats needed and autoconf does that for you,
with the prog_c macro then it inserts into the makefile etc. And you
just have to make sure your code is compatible. I would discourage
trying to over-think and separate what compilers, assemblers are being
used to give warnings, because thats not what you want. You want
autoconf to figure out your environment for you so you don't have to
have complicated makefiles and options to build your program.

Usually this sort of problem comes up because one wants to pass flags
like -Bsymbolic -z defs to the linker, but
you have to know which linker you're using to know whether you can use
that syntax or -xldscope=symbolic or something else instead.

That's basically the reason. Sage is made up of lots of bits of software. Some have many GNU-isms. They pass things like -soname directly the the linker, which fails if the Sun linker is used.

What I have done in Sage is to test the version of the linker, to see if it Sun or GNU. But this relies on the fact the first copy of 'ld' in the path is the one used when building gcc. That might not be true. So whilst my hacks do allow Sage to build with either the GNU or Sun tools, it does require the path is set correctly. I'm sure they would break if a mix of Sun and GNU tools are used by gcc.

I'd rather not use libtool - I don't want to learn yet another tool. Especially since it has already caused me some grief on Solaris.

I must admit, any time I've seen anyone display the output of gcc -v on Solaris, it has always been obvious what linker and assembler are used. But I don't believe its necessary to specify them when building gcc, so conceivably gcc -v might not show it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]