patches/strace/4.5.19/100-autoreconf.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 -durN strace-4.5.19.orig/configure strace-4.5.19/configure
     2 --- strace-4.5.19.orig/configure	2009-10-21 19:41:11.000000000 +0200
     3 +++ strace-4.5.19/configure	2009-10-28 18:47:18.000000000 +0100
     4 @@ -5773,6 +5773,73 @@
     5  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     6  /* end confdefs.h.  */
     7  
     8 +echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5
     9 +echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6
    10 +if test "${ac_cv_type_statfs64+set}" = set; then
    11 +  echo $ECHO_N "(cached) $ECHO_C" >&6
    12 +else
    13 +  cat >conftest.$ac_ext <<_ACEOF
    14 +/* confdefs.h.  */
    15 +_ACEOF
    16 +cat confdefs.h >>conftest.$ac_ext
    17 +cat >>conftest.$ac_ext <<_ACEOF
    18 +/* end confdefs.h.  */
    19 +#ifdef LINUX
    20 +#include <linux/types.h>
    21 +#include <sys/statfs.h>
    22 +#else
    23 +#include <sys/vfs.h>
    24 +#endif
    25 +int
    26 +main ()
    27 +{
    28 +struct statfs64 st;
    29 +  ;
    30 +  return 0;
    31 +}
    32 +_ACEOF
    33 +rm -f conftest.$ac_objext
    34 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    35 +  (eval $ac_compile) 2>conftest.er1
    36 +  ac_status=$?
    37 +  grep -v '^ *+' conftest.er1 >conftest.err
    38 +  rm -f conftest.er1
    39 +  cat conftest.err >&5
    40 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    41 +  (exit $ac_status); } &&
    42 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
    43 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    44 +  (eval $ac_try) 2>&5
    45 +  ac_status=$?
    46 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    47 +  (exit $ac_status); }; } &&
    48 +	 { ac_try='test -s conftest.$ac_objext'
    49 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    50 +  (eval $ac_try) 2>&5
    51 +  ac_status=$?
    52 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    53 +  (exit $ac_status); }; }; then
    54 +  ac_cv_type_statfs64=yes
    55 +else
    56 +  echo "$as_me: failed program was:" >&5
    57 +sed 's/^/| /' conftest.$ac_ext >&5
    58 +
    59 +ac_cv_type_statfs64=no
    60 +fi
    61 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    62 +fi
    63 +
    64 +echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5
    65 +echo "${ECHO_T}$ac_cv_type_statfs64" >&6
    66 +if test "$ac_cv_type_statfs64" = yes
    67 +then
    68 +
    69 +cat >>confdefs.h <<\_ACEOF
    70 +#define HAVE_STATFS64 1
    71 +_ACEOF
    72 +
    73 +fi
    74 +
    75  
    76  int
    77  main ()