The configure script tests whether GNU ld is used by following piece of code: LD=ld { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${ac_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then ac_cv_prog_gnu_ld=yes else ac_cv_prog_gnu_ld=no fi This construct has two problems: - There is no way to override the definition of LD, i.e. to select another binary for ld. - The common configure option --with-gnu-ld / --without-gnu-ld is not supported. - The ld found by accident in the PATH is not necessarily the ld which is invoked by gcc. My recommendation would be to test the result of $CC -Wl,-V -- i.e. let the C compiler invoke ld with a verbosity flag to find out which ld is used. (Note that the option -v provokes a usage message in case of Sun's ld. -V causes both, GNU ld and Solaris ld, to generate a version info.) Impact: When the configure script is run under Solaris and gcc is configured to use Solaris' ld, the ld will present a usage message detailing that the option -E is invalid. Please note that currently the use of gcc 4.x (we are using gcc 4.2.2) along with the GNU assembler and Solaris' ld is the recommended configuration for gcc under the Solaris 10 / x86 platform. (This is different from the Solaris 10 / SPARC platform where GNU ld is usually used by gcc.) See http://www.sourceware.org/ml/binutils/2006-04/msg00126.html. Workaround: Building works without problems as soon LD=ld is replaced by LD=/usr/ccs/bin/ld on the gcc 4.x / Solaris 10 / x86 platform.
Just stumbled over this one. The same problem has already been analyzed in (later) bug #5730 for Samba 3.2. Sorry - somehow, I did not get this the first time (?) it was reported... Your analysis and workaround are correct. Thanks for the input as how to detect the linker used by gcc. I will play with it... Michael
*** Bug 5730 has been marked as a duplicate of this bug. ***
closing, we have waf buildsystem now