patches/strace/4.5.19/130-statfs64-check.patch
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Wed Dec 05 20:31:43 2012 +0100 (2012-12-05)
changeset 3134 863723936e24
permissions -rw-r--r--
scripts/xldd: use user's sed and grep

xldd uses sed and grep as detected by ./configure. This works well if is
used on the machine that build the toolchain.

But if the user moves the toolchain to another machine where sed and grep
are not in the same directory (eg. /bin/sed vs. /usr/bin/sed), then xldd
will stop functionning.

Fix that by using ${SED} and ${GREP} if they are set in the environment.

Reported-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
yann@1613
     1
diff -durN strace-4.5.19.orig/acinclude.m4 strace-4.5.19/acinclude.m4
yann@1613
     2
--- strace-4.5.19.orig/acinclude.m4	2004-04-14 04:45:53.000000000 +0200
yann@1613
     3
+++ strace-4.5.19/acinclude.m4	2009-10-28 18:47:18.000000000 +0100
yann@1613
     4
@@ -210,6 +210,26 @@
yann@1613
     5
 fi
yann@1613
     6
 ])
yann@1613
     7
 
yann@1613
     8
+dnl ### A macro to determine whether statfs64 is defined.
yann@1613
     9
+AC_DEFUN([AC_STATFS64],
yann@1613
    10
+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
yann@1613
    11
+AC_CACHE_VAL(ac_cv_type_statfs64,
yann@1613
    12
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
yann@1613
    13
+#include <linux/types.h>
yann@1613
    14
+#include <sys/statfs.h>
yann@1613
    15
+#else
yann@1613
    16
+#include <sys/vfs.h>
yann@1613
    17
+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
yann@1613
    18
+AC_MSG_RESULT($ac_cv_type_statfs64)
yann@1613
    19
+if test "$ac_cv_type_statfs64" = yes
yann@1613
    20
+then
yann@1613
    21
+	AC_DEFINE([HAVE_STATFS64], 1,
yann@1613
    22
+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
yann@1613
    23
+fi
yann@1613
    24
+])
yann@1613
    25
+
yann@1613
    26
+
yann@1613
    27
+
yann@1613
    28
 dnl ### A macro to determine if off_t is a long long
yann@1613
    29
 AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
yann@1613
    30
 [AC_MSG_CHECKING(for long long off_t)
yann@1613
    31
diff -durN strace-4.5.19.orig/configure.ac strace-4.5.19/configure.ac
yann@1613
    32
--- strace-4.5.19.orig/configure.ac	2009-10-12 21:54:43.000000000 +0200
yann@1613
    33
+++ strace-4.5.19/configure.ac	2009-10-28 18:47:18.000000000 +0100
yann@1613
    34
@@ -187,6 +187,7 @@
yann@1613
    35
 		  struct stat.st_level,
yann@1613
    36
 		  struct stat.st_rdev])
yann@1613
    37
 AC_STAT64
yann@1613
    38
+AC_STATFS64
yann@1613
    39
 
yann@1613
    40
 AC_TYPE_SIGNAL
yann@1613
    41
 AC_TYPE_UID_T
yann@1613
    42
diff -durN strace-4.5.19.orig/file.c strace-4.5.19/file.c
yann@1613
    43
--- strace-4.5.19.orig/file.c	2009-10-21 15:44:04.000000000 +0200
yann@1613
    44
+++ strace-4.5.19/file.c	2009-10-28 18:47:18.000000000 +0100
yann@1613
    45
@@ -1688,7 +1688,7 @@
yann@1613
    46
 	return 0;
yann@1613
    47
 }
yann@1613
    48
 
yann@1613
    49
-#ifdef LINUX
yann@1613
    50
+#ifdef HAVE_STATFS64
yann@1613
    51
 static void
yann@1613
    52
 printstatfs64(struct tcb *tcp, long addr)
yann@1613
    53
 {