patches/mpfr/2.4.1/110-assert.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Fri Jan 27 13:31:16 2012 +0100 (2012-01-27)
changeset 2854 a70abdbfa342
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>
     1 diff -Naurd mpfr-2.4.1-a/PATCHES mpfr-2.4.1-b/PATCHES
     2 --- mpfr-2.4.1-a/PATCHES	2009-03-04 13:15:05.000000000 +0000
     3 +++ mpfr-2.4.1-b/PATCHES	2009-03-04 13:17:04.000000000 +0000
     4 @@ -0,0 +1 @@
     5 +assert
     6 diff -Naurd mpfr-2.4.1-a/VERSION mpfr-2.4.1-b/VERSION
     7 --- mpfr-2.4.1-a/VERSION	2009-02-27 16:55:37.000000000 +0000
     8 +++ mpfr-2.4.1-b/VERSION	2009-03-04 13:16:46.000000000 +0000
     9 @@ -1 +1 @@
    10 -2.4.1-p1
    11 +2.4.1-p2
    12 diff -Naurd mpfr-2.4.1-a/mpfr-gmp.c mpfr-2.4.1-b/mpfr-gmp.c
    13 --- mpfr-2.4.1-a/mpfr-gmp.c	2009-02-20 09:43:17.000000000 +0000
    14 +++ mpfr-2.4.1-b/mpfr-gmp.c	2009-03-04 13:16:39.000000000 +0000
    15 @@ -301,7 +301,7 @@
    16        if (linenum != -1)
    17          fprintf (stderr, "%d: ", linenum);
    18      }
    19 -  fprintf (stderr, " assertion failed: %s\n", expr);
    20 +  fprintf (stderr, "MPFR assertion failed: %s\n", expr);
    21    abort();
    22  }
    23  
    24 diff -Naurd mpfr-2.4.1-a/mpfr.h mpfr-2.4.1-b/mpfr.h
    25 --- mpfr-2.4.1-a/mpfr.h	2009-02-27 16:55:38.000000000 +0000
    26 +++ mpfr-2.4.1-b/mpfr.h	2009-03-04 13:16:46.000000000 +0000
    27 @@ -27,7 +27,7 @@
    28  #define MPFR_VERSION_MAJOR 2
    29  #define MPFR_VERSION_MINOR 4
    30  #define MPFR_VERSION_PATCHLEVEL 1
    31 -#define MPFR_VERSION_STRING "2.4.1-p1"
    32 +#define MPFR_VERSION_STRING "2.4.1-p2"
    33  
    34  /* Macros dealing with MPFR VERSION */
    35  #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
    36 diff -Naurd mpfr-2.4.1-a/version.c mpfr-2.4.1-b/version.c
    37 --- mpfr-2.4.1-a/version.c	2009-02-27 16:55:38.000000000 +0000
    38 +++ mpfr-2.4.1-b/version.c	2009-03-04 13:16:46.000000000 +0000
    39 @@ -25,5 +25,5 @@
    40  const char *
    41  mpfr_get_version (void)
    42  {
    43 -  return "2.4.1-p1";
    44 +  return "2.4.1-p2";
    45  }