Boost logo

Boost-Build :

From: Andre Hentz (ahentz_at_[hidden])
Date: 2004-01-12 17:34:24


Christopher Currie wrote:
>
> The only way that I know of to determine the linker used is to capture
> the output of:
>
> gcc -Wl,-V
>
> which will generate lots of errors because of a failed link, but will
> also get ld (either Solaris or GNU) to print out a version string that
> could be interpreted. My linker prints out:
>
> ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.282
>
> I'm not sure what the GNU linker looks like, but it probably has the
> word GNU in it somewhere, perhaps we could key off that.
>
It is also possible to pass --print-prog-name=ld to gcc. Here's some
results for you to compare.

Solaris:
$ gcc --print-prog-name=ld
/usr/ccs/bin/ld
$ `gcc --print-prog-name=ld` -V
ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.279

Cygwin:
$ gcc --print-prog-name=ld
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/bin/ld.exe
$ `gcc --print-prog-name=ld` -V
GNU ld version 2.14.90 20030901
Supported emulations:
i386pe

Linux:
$ gcc --print-prog-name=ld
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/../../../../i586-suse-linux/bin/ld
$ `gcc --print-prog-name=ld` -V
GNU ld version 2.14.90.0.5 20030722 (SuSE Linux)
Supported emulations:
elf_i386
i386linux
elf_x86_64

FreeBSD (/usr/bin):
$ /usr/bin/gcc --print-prog-name=ld
/usr/libexec/elf/ld
$ `/usr/bin/gcc --print-prog-name=ld` -V
GNU ld version 2.12.1 [FreeBSD] 2002-07-20
Supported emulations:
elf_i386

FreeBSD (/usr/local/bin):
$ /usr/local/bin/gcc --print-prog-name=ld
ld
$ which ld
/usr/bin/ld
$ `/usr/local/bin/gcc --print-prog-name=ld` -V
GNU ld version 2.12.1 [FreeBSD] 2002-07-20
Supported emulations:
elf_i386

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk