Samba 3.5.6 and determining ld version

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


Hi @all,

in Samba 3.5.6 was a change in configure.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/ld-linux.so.2 /usr/lib/gcc/i486-pc-linux-gnu/3.4.6/../../../crt1.o 
/usr/lib/gcc/i486-pc-linux-gnu/3.4.6/../../../crti.o 
/usr/lib/gcc/i486-pc-linux-gnu/3.4.6/crtbegin.o 
-L/usr/lib/gcc/i486-pc-linux-gnu/3.4.6 
-L/usr/lib/gcc/i486-pc-linux-gnu/3.4.6 
-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/crtend.o 
/usr/lib/gcc/i486-pc-linux-gnu/3.4.6/../../../crtn.o
/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 configure.in:
--- configure.in.org    2010-10-07 18:41:16.000000000 +0200
+++ configure.in        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
  AC_PROG_LD_GNU

+LD=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)
         changequote(,)dnl
         ac_cv_gnu_ld_date=`echo $ac_cv_gnu_ld_version | sed -n 
's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`

-- 
der tom
[eisfair-team]


More information about the samba-technical mailing list