Samba 3.5.6 and determining ld version

Thomas Bork tombork at
Thu Nov 25 16:59:00 MST 2010

Hi @all,

in Samba 3.5.6 was a change in in determining the gnu ld 
version (my old Samba version was 3.4.9 and was ok):

New version:
ac_cv_gnu_ld_version=`$CC -Wl,-v /dev/null 2>/dev/null | head -1`

Old version was:
ac_cv_gnu_ld_version=`$LD -v 2>/dev/null | head -1`

deveis # gcc -Wl,-v
collect2 version 3.4.6 (i386 Linux/ELF)
/usr/bin/ld --eh-frame-hdr -m elf_i386 -dynamic-linker 
/lib/ /usr/lib/gcc/i486-pc-linux-gnu/3.4.6/../../../crt1.o 
-L/usr/lib/gcc/i486-pc-linux-gnu/3.4.6/../../.. -v -lgcc --as-needed 
-lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed 
/usr/lib/gcc/i486-pc-linux-gnu/3.4.6/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
GNU ld version 2.17
deveis # gcc -Wl,-v /dev/null 2>/dev/null
deveis #ld -v 2>/dev/null | head -1
GNU ld version 2.17

Thats why I have this in configure:
checking if the linker used by compiler is GNU ld... yes
checking GNU ld release date...
checking GNU ld release version...
checking GNU ld release version major...
checking GNU ld release version minor...
./configure: line 11878: test: : integer expression expected
./configure: line 11878: test: : integer expression expected
./configure: line 11881: test: : integer expression expected

The old version was ok for me...

Suggested patch for
---    2010-10-07 18:41:16.000000000 +0200
+++        2010-11-26 00:50:16.000000000 +0100
@@ -211,11 +211,12 @@ AC_CHECK_TOOL(AR, ar)
  dnl Check if we (actually our C compiler!) use GNU ld

  dnl Certain versions of GNU ld the default is not to have the
  dnl --allow-shlib-undefined flag defined.  This causes a stackload of
  dnl warnings when building modules.
  if test "$ac_cv_prog_gnu_ld" = "yes"; then
-       ac_cv_gnu_ld_version=`$CC -Wl,-v /dev/null 2>/dev/null | head -1`
+       ac_cv_gnu_ld_version=`$LD -v 2>/dev/null | head -1`
         AC_MSG_CHECKING(GNU ld release date)
         ac_cv_gnu_ld_date=`echo $ac_cv_gnu_ld_version | sed -n 

der tom

More information about the samba-technical mailing list