patches/strace/4.5.15/150-statfs64-check.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 746 b150d6f590fc
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 -dur strace-4.5.15.orig/acinclude.m4 strace-4.5.15/acinclude.m4
     2 --- strace-4.5.15.orig/acinclude.m4	2004-04-14 04:21:01.000000000 +0200
     3 +++ strace-4.5.15/acinclude.m4	2007-07-14 19:25:25.000000000 +0200
     4 @@ -210,6 +210,26 @@
     5  fi
     6  ])
     7  
     8 +dnl ### A macro to determine whether statfs64 is defined.
     9 +AC_DEFUN([AC_STATFS64],
    10 +[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
    11 +AC_CACHE_VAL(ac_cv_type_statfs64,
    12 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
    13 +#include <linux/types.h>
    14 +#include <sys/statfs.h>
    15 +#else
    16 +#include <sys/vfs.h>
    17 +#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
    18 +AC_MSG_RESULT($ac_cv_type_statfs64)
    19 +if test "$ac_cv_type_statfs64" = yes
    20 +then
    21 +	AC_DEFINE([HAVE_STATFS64], 1,
    22 +[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
    23 +fi
    24 +])
    25 +
    26 +
    27 +
    28  dnl ### A macro to determine if off_t is a long long
    29  AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
    30  [AC_MSG_CHECKING(for long long off_t)
    31 diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac
    32 --- strace-4.5.15.orig/configure.ac	2007-01-11 12:37:55.000000000 +0100
    33 +++ strace-4.5.15/configure.ac	2007-07-14 19:25:25.000000000 +0200
    34 @@ -169,6 +169,7 @@
    35  		  struct stat.st_level,
    36  		  struct stat.st_rdev])
    37  AC_STAT64
    38 +AC_STATFS64
    39  
    40  AC_TYPE_SIGNAL
    41  AC_TYPE_UID_T
    42 diff -dur strace-4.5.15.orig/file.c strace-4.5.15/file.c
    43 --- strace-4.5.15.orig/file.c	2007-01-15 21:25:52.000000000 +0100
    44 +++ strace-4.5.15/file.c	2007-07-14 19:25:25.000000000 +0200
    45 @@ -1635,7 +1635,7 @@
    46  	return 0;
    47  }
    48  
    49 -#ifdef LINUX
    50 +#ifdef HAVE_STATFS64
    51  static void
    52  printstatfs64(tcp, addr)
    53  struct tcb *tcp;