On Solaris, Sun ship a linker in /usr/ccs/bin/ld. Lots of people have
binutils and have the GNU linker too. gcc can be configured to use either.
Is there any way to tell for certain if gcc uses the GNU or Sun linker
on Solaris? I would also like to do the same for the assembler, though
that is less important to me. I want to do this via a shell script.
I can tell on my machine gcc uses the Sun linker and assembler
$ gcc -v
Using built-in specs.
Target: sparc-sun-solaris2.10
Configured with: ../gcc-4.4.1/configure
--prefix=/usr/local/gcc-4.4.1-sun-linker/ --with-as=/usr/ccs/bin/as
--without-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld
--enable-languages=c,c++,fortran --with-mpfr-include=/usr/local/include
--with-mpfr-lib=/usr/local/lib --with-gmp-include=/usr/local/include
--with-gmp-lib=/usr/local/lib CC=/usr/sfw/bin/gcc CXX=/usr/sfw/bin/g++
LDFLAGS='-R /usr/local/lib -L /usr/local/lib'
Thread model: posix
gcc version 4.4.1 (GCC)
Looking there I see '--without-gnu-as' and '--without-gnu-ld', but there
is no guarantee someone uses those options when configure gcc. Here it
is even more clear, with -with-ld=/usr/ccs/bin/ld and
--with-as=/usr/ccs/bin/as.
But what happens if I don't specify any of this when I build gcc? Would
it just find the first linker and assembler in the path? In which case,
how could I now determine what linker and assembler gcc uses?
dave