Bug 7825 - need to fix GNU ld version detection with old gcc releases
need to fix GNU ld version detection with old gcc releases
Status: RESOLVED FIXED
Product: Samba 3.5
Classification: Unclassified
Component: Build environment
3.5.6
Other Windows XP
: P3 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-26 12:16 UTC by Björn Jacke
Modified: 2013-02-26 07:48 UTC (History)
3 users (show)

See Also:
metze: review+


Attachments
patch that resolves the stdout/stderr mess up (1.51 KB, patch)
2013-02-19 14:36 UTC, Björn Jacke
no flags Details
changed patch for fixing gnu ld detection (912 bytes, patch)
2013-02-20 21:21 UTC, Thomas Bork
no flags Details
0001-build-autoconf-fix-check-for-GNU-ld-version.patch (1.92 KB, text/plain)
2013-02-22 23:47 UTC, Björn Jacke
metze: review+
Details
0002-build-autoconf-put-ld-check-variable-in-quotes.patch (1.12 KB, text/plain)
2013-02-22 23:47 UTC, Björn Jacke
metze: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Jacke 2010-11-26 12:16:44 UTC
otherwise during configure:

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

and possibly build failures later on.
Comment 1 Björn Jacke 2010-11-27 16:02:13 UTC
to fix it in 3.5 70a7da0e101910e3ceb08b86d4b840b219e24d7d needs to be cherry-picked. Metze, can you plasee review and reassign to Karo if you're fine with it?
Comment 2 Stefan Metzmacher 2011-05-19 06:18:56 UTC
Karolin please pick for the next 3.5. release if this applies to v3-5-test
Comment 3 Karolin Seeger 2011-05-20 19:03:19 UTC
Pushed to v3-5-test.
Closing out bug report.

Thanks!
Comment 4 Björn Jacke 2013-02-19 11:19:43 UTC
this needs to be reopened I guess. The redirection of stderr to stdout is being mixed ugly on one line when being grep'ed:

gcc -Wl,-v /dev/null 2>&1 < /dev/null 
collect2 version 4.1.2 20070115 (SUSE Linux) (x86-64 Linux/ELF)
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbegin.o -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.. -v /dev/null -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtend.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crtn.o
GNU ld version 2.16.91.0.5 20051219 (SUSE Linux)
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
init.c:(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status

# gcc -Wl,-v /dev/null 2>&1 < /dev/null |grep "GNU ld"
GNU ld version 2.16.91.0.5 20051219 (SUSE Linux/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
Comment 5 SATOH Fumiyasu 2013-02-19 13:51:05 UTC
FYI.

Newer GNU ld -v does not contain the release date in the version information:

  $ ld -v
  GNU ld (GNU Binutils for Debian) 2.22

That is why source3/configure in Samba 3.6.12 cannot detect newer GNU ld.
Comment 6 Björn Jacke 2013-02-19 14:36:33 UTC
Created attachment 8571 [details]
patch that resolves the stdout/stderr mess up

please test this patch. It works for me. It tests once on stdout and if there was no result it tests in a second run on stderr.
Comment 7 Thomas Bork 2013-02-19 19:49:12 UTC
This results in

checking if the linker used by compiler is GNU ld... yes
./configure: line 7798: test: too many arguments
checking GNU ld release date...
checking GNU ld release version... 2.19
checking GNU ld release version major... 2
checking GNU ld release version minor... 19

here.

Must be:

if test -z "$ac_cv_gnu_ld_version" ; then

And not:

if test -z ${ac_cv_gnu_ld_version} ; then


Thank you :)
Comment 8 Thomas Bork 2013-02-20 21:21:38 UTC
Created attachment 8572 [details]
changed patch for fixing gnu ld detection

This patch does not output "test: too many arguments" anymore for me.
Comment 9 Björn Jacke 2013-02-22 23:47:46 UTC
Created attachment 8577 [details]
0001-build-autoconf-fix-check-for-GNU-ld-version.patch
Comment 10 Björn Jacke 2013-02-22 23:47:46 UTC
Created attachment 8578 [details]
0002-build-autoconf-put-ld-check-variable-in-quotes.patch
Comment 11 Björn Jacke 2013-02-22 23:51:11 UTC
Comment on attachment 8577 [details]
0001-build-autoconf-fix-check-for-GNU-ld-version.patch

patch for 3.6 and 4.0 stable trees
Comment 12 Björn Jacke 2013-02-22 23:51:23 UTC
Comment on attachment 8578 [details]
0002-build-autoconf-put-ld-check-variable-in-quotes.patch

patch for 3.6 and 4.0 stable trees
Comment 13 Stefan Metzmacher 2013-02-25 08:29:06 UTC
Comment on attachment 8577 [details]
0001-build-autoconf-fix-check-for-GNU-ld-version.patch

Looks good
Comment 14 Stefan Metzmacher 2013-02-25 08:29:25 UTC
Comment on attachment 8578 [details]
0002-build-autoconf-put-ld-check-variable-in-quotes.patch

Looks good
Comment 15 Stefan Metzmacher 2013-02-25 08:30:15 UTC
Karolin, please pick to 3.6 and 4.0
Comment 16 Karolin Seeger 2013-02-25 08:38:37 UTC
Pushed to v3-6-test and autobuild-v4-0-test.
Comment 17 Karolin Seeger 2013-02-26 07:48:14 UTC
Pushed to v4-0-test.
Closing out bug report.

Thanks!