patches/glibc/2.9/600-recent-binutils.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Fri Jan 27 13:31:16 2012 +0100 (2012-01-27)
changeset 2854 a70abdbfa342
parent 1654 489e9f2158fa
permissions -rw-r--r--
complibs/cloog: fix linking with libm

In Ubuntu 11.04 and 11.10, the default options for ld have changed.
--no-copy-dt-needed-entries and --as-needed are now enabled by default, which
causes errors like:

[EXTRA] Checking CLooG/ppl
[DEBUG] ==> Executing: 'make' '-j3' '-s' 'check'
[ALL ] Making check in .
[ALL ] config.status: creating include/cloog/cloog-config.h
[ALL ] config.status: include/cloog/cloog-config.h is unchanged
[ALL ] libtool: link: i686-build_pc-linux-gnu-gcc -Wall -fomit-frame-pointer
-pipe -o cloog cloog.o -L/<snip>/build/static/lib ./.libs/libcloog.a -lm
/<snip>/build/static/lib/libppl_c.a /<snip>/build/static/lib/libpwl.a
/<snip>/build/static/lib/libppl.a /<snip>/build/static/lib/libgmpxx.a
/<snip>/build/static/lib/libgmp.a -lstdc++
[ALL ] /usr/bin/ld: /<snip>/build/static/lib/libppl.a(MIP_Problem.o):
undefined reference to symbol 'sqrt@@GLIBC_2.0'
[ALL ] /usr/bin/ld: note: 'sqrt@@GLIBC_2.0' is defined in DSO
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libm.so so try adding
it to the linker command line
[ALL ] /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libm.so:
could not read symbols: Invalid operation
[ALL ] collect2: ld returned 1 exit status
[ERROR] make[2]: *** [cloog] Error 1
[ERROR] make[1]: *** [check-recursive] Error 1

See:
https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition

This patch fixes these errors by placing '-lm' at the right place on the command
line as libppl requires libm when linking cloog.

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
yann@1967
     1
diff -durN glibc-2.9.orig/configure glibc-2.9/configure
yann@1967
     2
--- glibc-2.9.orig/configure	2010-05-18 23:47:23.000000000 +0200
yann@1967
     3
+++ glibc-2.9/configure	2010-05-18 23:50:04.000000000 +0200
yann@1967
     4
@@ -4534,7 +4534,7 @@
fr@1654
     5
   ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
fr@1654
     6
   case $ac_prog_version in
fr@1654
     7
     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
fr@1654
     8
-    2.1[3-9]*)
yann@1967
     9
+    2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*)
fr@1654
    10
        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
fr@1654
    11
     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
fr@1654
    12
 
yann@1967
    13
@@ -4597,7 +4597,7 @@
fr@1654
    14
   ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
fr@1654
    15
   case $ac_prog_version in
fr@1654
    16
     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
fr@1654
    17
-    2.1[3-9]*)
yann@1967
    18
+    2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*)
fr@1654
    19
        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
fr@1654
    20
     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
fr@1654
    21
 
yann@1967
    22
diff -durN glibc-2.9.orig/configure.in glibc-2.9/configure.in
yann@1967
    23
--- glibc-2.9.orig/configure.in	2010-05-18 23:47:23.000000000 +0200
yann@1967
    24
+++ glibc-2.9/configure.in	2010-05-18 23:51:25.000000000 +0200
fr@1654
    25
@@ -844,10 +844,10 @@
fr@1654
    26
 # Accept binutils 2.13 or newer.
fr@1654
    27
 AC_CHECK_PROG_VER(AS, $AS, --version,
fr@1654
    28
 		  [GNU assembler.* \([0-9]*\.[0-9.]*\)],
fr@1654
    29
-		  [2.1[3-9]*], AS=: critic_missing="$critic_missing as")
yann@1967
    30
+		  [2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], AS=: critic_missing="$critic_missing as")
fr@1654
    31
 AC_CHECK_PROG_VER(LD, $LD, --version,
fr@1654
    32
 		  [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
fr@1654
    33
-		  [2.1[3-9]*], LD=: critic_missing="$critic_missing ld")
yann@1967
    34
+		  [2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], LD=: critic_missing="$critic_missing ld")
fr@1654
    35
 
fr@1654
    36
 # We need the physical current working directory.  We cannot use the
fr@1654
    37
 # "pwd -P" shell builtin since that's not portable.  Instead we try to