summaryrefslogtreecommitdiffstats
path: root/package/valgrind/valgrind-largefile.patch
blob: 3a8a780f0d1123cd6fbdd93d4423fab8b55ee6ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[PATCH] valgrind: don't enable largefile support unconditionally on uClibc

uClibc can be compiled without largefile support (and errors out if
_FILE_OFFSET_BITS is set to 64), so don't define it if that combination
is detected.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>

Index: b/coregrind/m_initimg/initimg-linux.c
===================================================================
--- a/coregrind/m_initimg/initimg-linux.c
+++ b/coregrind/m_initimg/initimg-linux.c
@@ -55,7 +55,11 @@
 
 /* --- !!! --- EXTERNAL HEADERS start --- !!! --- */
 #define _GNU_SOURCE
+#include <features.h>
+/* uclibc without largefile support #errors on _FILE_OFFSET_BITS=64 */
+#if !(defined(__UCLIBC__) && !defined(__UCLIBC_HAS_LFS__))
 #define _FILE_OFFSET_BITS 64
+#endif
 /* This is for ELF types etc, and also the AT_ constants. */
 #include <elf.h>
 /* --- !!! --- EXTERNAL HEADERS end --- !!! --- */
Index: b/coregrind/m_main.c
===================================================================
--- a/coregrind/m_main.c
+++ b/coregrind/m_main.c
@@ -2948,7 +2948,11 @@
 
 /* --- !!! --- EXTERNAL HEADERS start --- !!! --- */
 #define _GNU_SOURCE
+#include <features.h>
+/* uclibc without largefile support #errors on _FILE_OFFSET_BITS=64 */
+#if !(defined(__UCLIBC__) && !defined(__UCLIBC_HAS_LFS__))
 #define _FILE_OFFSET_BITS 64
+#endif
 /* This is in order to get AT_NULL and AT_PAGESIZE. */
 #include <elf.h>
 /* --- !!! --- EXTERNAL HEADERS end --- !!! --- */
Index: b/coregrind/m_ume/elf.c
===================================================================
--- a/coregrind/m_ume/elf.c
+++ b/coregrind/m_ume/elf.c
@@ -48,7 +48,11 @@
 
 /* --- !!! --- EXTERNAL HEADERS start --- !!! --- */
 #define _GNU_SOURCE
+#include <features.h>
+/* uclibc without largefile support #errors on _FILE_OFFSET_BITS=64 */
+#if !(defined(__UCLIBC__) && !defined(__UCLIBC_HAS_LFS__))
 #define _FILE_OFFSET_BITS 64
+#endif
 /* This is for ELF types etc, and also the AT_ constants. */
 #include <elf.h>
 /* --- !!! --- EXTERNAL HEADERS end --- !!! --- */