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

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

 



"Dr. David Kirkby" <david.kirkby@xxxxxxxxxx> writes:
> Russ Allbery wrote:

>> It's a pain in the ass, but sadly the most robust thing for you to do
>> is to write configure probes that try to use the exact linker options
>> that you want to use and see if they work.

> I've done that. Sage will build ok on Solaris if gcc is configured to use
> GNU or Sun tools. It could break if a mix and Sun and GNU are used.

Well, I was meaning duplicate excatly the way that you would call the
linker in Sage, down to the path and everything.  So, for instance, if
you're doing the link step through the compiler, check the flag that way
in Autoconf as well.

It requires sometimes constructing rather complex test programs.

> Having thought about it more, just compiling a simple program
>
> main()
> {
> }
>
> as:
>
> gcc -Wl,-zallextract simple.c
>
> should return an error if the GNU linker is used, as it will not
> understand the -zallextract option. But it will not produce any error if
> gcc uses the Sun linker, since -zallextract is a valid option.

Yeah, exactly.

-- 
Russ Allbery (rra@xxxxxxxxxxxx)             <http://www.eyrie.org/~eagle/>


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux