patches/strace/4.5.17/140-statfs64-check.patch
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:06:16 2011 +0200 (2011-05-19)
changeset 2461 ec30b191f0e3
parent 747 d3e603e7c17c
permissions -rw-r--r--
complibs/ppl: build only C and C++ interfaces for PPL

By default, PPL wants to build interfaces for any of a variety of
langauges it finds on the local host (python, java, possibly perl, also
more esoteric languages such as ocaml and prolog).

These extra interfaces can double the compile time for the library. For
single-process builds, I found a savings of more than 40%:

default / j1: 716s total, 143.2s avg, 0.52s stdev
just_c / j1: 406s total, 81.2s avg, 0.33s stdev
just_c_cpp / j1: 413s total, 82.6s avg, 0.22s stdev

And for multi-process builds, it approached 50%:

default / j4: 625s total, 125.0s avg, 0.57s stdev
just_c / j4: 338s total, 67.6s avg, 1.25s stdev
just_c_cpp / j4: 327s total, 65.4s avg, 0.36s stdev

Since the PPL we build within ct-ng is only used by GCC, we only need to
build the C and C++ interfaces.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
yann@974
     1
Original patch from gentoo: ../../dev/crosstool-NG/ct-ng.trunk/patches/strace/4.5.17/140-statfs64-check.patch
yann@974
     2
-= BEGIN original header =-
yann@428
     3
diff -dur strace-4.5.16.orig/acinclude.m4 strace-4.5.16/acinclude.m4
yann@974
     4
-= END original header =-
yann@974
     5
diff -durN strace-4.5.17.orig/acinclude.m4 strace-4.5.17/acinclude.m4
yann@974
     6
--- strace-4.5.17.orig/acinclude.m4	2004-04-14 04:21:01.000000000 +0200
yann@974
     7
+++ strace-4.5.17/acinclude.m4	2008-10-24 21:30:13.000000000 +0200
yann@428
     8
@@ -210,6 +210,26 @@
yann@428
     9
 fi
yann@428
    10
 ])
yann@974
    11
 
yann@428
    12
+dnl ### A macro to determine whether statfs64 is defined.
yann@428
    13
+AC_DEFUN([AC_STATFS64],
yann@428
    14
+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
yann@428
    15
+AC_CACHE_VAL(ac_cv_type_statfs64,
yann@428
    16
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
yann@428
    17
+#include <linux/types.h>
yann@428
    18
+#include <sys/statfs.h>
yann@428
    19
+#else
yann@428
    20
+#include <sys/vfs.h>
yann@428
    21
+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
yann@428
    22
+AC_MSG_RESULT($ac_cv_type_statfs64)
yann@428
    23
+if test "$ac_cv_type_statfs64" = yes
yann@428
    24
+then
yann@428
    25
+	AC_DEFINE([HAVE_STATFS64], 1,
yann@428
    26
+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
yann@428
    27
+fi
yann@428
    28
+])
yann@428
    29
+
yann@428
    30
+
yann@428
    31
+
yann@428
    32
 dnl ### A macro to determine if off_t is a long long
yann@428
    33
 AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
yann@428
    34
 [AC_MSG_CHECKING(for long long off_t)
yann@974
    35
diff -durN strace-4.5.17.orig/configure.ac strace-4.5.17/configure.ac
yann@974
    36
--- strace-4.5.17.orig/configure.ac	2008-07-22 02:42:29.000000000 +0200
yann@974
    37
+++ strace-4.5.17/configure.ac	2008-10-24 21:30:13.000000000 +0200
yann@428
    38
@@ -169,6 +169,7 @@
yann@428
    39
 		  struct stat.st_level,
yann@428
    40
 		  struct stat.st_rdev])
yann@428
    41
 AC_STAT64
yann@428
    42
+AC_STATFS64
yann@974
    43
 
yann@428
    44
 AC_TYPE_SIGNAL
yann@428
    45
 AC_TYPE_UID_T
yann@974
    46
diff -durN strace-4.5.17.orig/file.c strace-4.5.17/file.c
yann@974
    47
--- strace-4.5.17.orig/file.c	2008-05-20 06:56:18.000000000 +0200
yann@974
    48
+++ strace-4.5.17/file.c	2008-10-24 21:30:13.000000000 +0200
yann@974
    49
@@ -1703,7 +1703,7 @@
yann@428
    50
 	return 0;
yann@428
    51
 }
yann@974
    52
 
yann@428
    53
-#ifdef LINUX
yann@428
    54
+#ifdef HAVE_STATFS64
yann@428
    55
 static void
yann@428
    56
 printstatfs64(tcp, addr)
yann@428
    57
 struct tcb *tcp;