patches/strace/4.5.18/140-statfs64-check.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Wed Dec 14 16:55:22 2011 +0100 (2011-12-14)
branch1.13
changeset 2848 1ff89596dab0
permissions -rw-r--r--
libc/eglibc: fix localedef 2.14 build

The localedef of eglibc 2.14 requires NOT_IN_libc to be defined in order to
compile intl/l10nflist.c.

This is because localedef is built separately from eglibc and uses some parts of
eglibc that don't compile in standalone without this preprocessor definition.

This fixes the following error:

[ALL ] gcc -g -O2 -DNO_SYSCONF -DNO_UNCOMPRESS
-DLOCALE_PATH='"/usr/lib/locale:/usr/share/i18n"'
-DLOCALEDIR='"/usr/lib/locale"' -DLOCALE_ALIAS_PATH='"/usr/share/locale"'
-DCHARMAP_PATH='"/usr/share/i18n/charmaps"'
-DREPERTOIREMAP_PATH='"/usr/share/i18n/repertoiremaps"'
-DLOCSRCDIR='"/usr/share/i18n/locales"' -Iglibc/locale/programs -Iglibc/locale
-I/<snip>/.build/src/eglibc-localedef-2_14/include
-I/<snip>/.build/src/eglibc-localedef-2_14 -I.
-include /<snip>/.build/src/eglibc-localedef-2_14/include/always.h -Wall
-Wno-format -c -o locarchive.o glibc/locale/programs/locarchive.c
[ALL ] glibc/locale/programs/locarchive.c: In function 'enlarge_archive':
[ALL ] glibc/locale/programs/locarchive.c:303:21: warning: variable
'oldlocrectab' set but not used [-Wunused-but-set-variable]
[ALL ] In file included from glibc/locale/programs/locarchive.c:651:0:
[ALL ] glibc/locale/programs/../../intl/l10nflist.c: In function
'_nl_normalize_codeset':
[ERROR] glibc/locale/programs/../../intl/l10nflist.c:342:9: error:
'_nl_C_locobj_ptr' undeclared (first use in this function)
[ALL ] glibc/locale/programs/../../intl/l10nflist.c:342:9: note: each
undeclared identifier is reported only once for each function it appears in
[ALL ] glibc/locale/programs/locarchive.c: In function
'add_locales_to_archive':
[ALL ] glibc/locale/programs/locarchive.c:1450:7: warning: passing argument
1 of '__xpg_basename' discards 'const' qualifier from pointer target type
[enabled by default]
[ALL ] /usr/include/libgen.h:35:14: note: expected 'char *' but argument is
of type 'const char *'
[ERROR] make[1]: *** [locarchive.o] Error 1

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