aboutsummaryrefslogtreecommitdiffstats
path: root/tools/fakeroot/patches/500-macos_arm64_compile_fix.patch
blob: 271dceef91bfcca4d078d67d7e2c0250ebf66b6c (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
--- a/communicate.c
+++ b/communicate.c
@@ -24,7 +24,12 @@
    In this file, we want 'struct stat' to have a 32-bit 'ino_t'.
    We use 'struct stat64' when we need a 64-bit 'ino_t'.
 */
-#define _DARWIN_NO_64_BIT_INODE
+# include <sys/types.h>
+# if __DARWIN_ONLY_64_BIT_INO_T
+#  define _DARWIN_USE_64_BIT_INODE
+# else
+#  define _DARWIN_NO_64_BIT_INODE
+# endif
 #endif
 
 #include "communicate.h"
--- a/communicate.h
+++ b/communicate.h
@@ -91,6 +91,10 @@
 # include <inttypes.h>
 #endif
 
+#if __DARWIN_ONLY_64_BIT_INO_T
+struct stat64 __DARWIN_STRUCT_STAT64;
+#endif
+
 #ifndef FAKEROOT_FAKENET
 # define FAKEROOTKEY_ENV          "FAKEROOTKEY"
 #endif /* ! FAKEROOT_FAKENET */
--- a/faked.c
+++ b/faked.c
@@ -84,7 +84,12 @@
    In this file, we want 'struct stat' to have a 32-bit 'ino_t'.
    We use 'struct stat64' when we need a 64-bit 'ino_t'.
 */
-#define _DARWIN_NO_64_BIT_INODE
+# include <sys/types.h>
+# if __DARWIN_ONLY_64_BIT_INO_T
+#  define _DARWIN_USE_64_BIT_INODE
+# else
+#  define _DARWIN_NO_64_BIT_INODE
+# endif
 #endif
 
 #include "config.h"
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -38,7 +38,12 @@
    In this file, we want 'struct stat' to have a 32-bit 'ino_t'.
    We use 'struct stat64' when we need a 64-bit 'ino_t'.
 */
-#define _DARWIN_NO_64_BIT_INODE
+# include <sys/types.h>
+# if __DARWIN_ONLY_64_BIT_INO_T
+#  define _DARWIN_USE_64_BIT_INODE
+# else
+#  define _DARWIN_NO_64_BIT_INODE
+# endif
 
 /* The helper _unix2003 version of this file calls a few functions in this file
    that are marked with static_nonapple so that needs to become private instead
--- a/libfakeroot_unix2003.c
+++ b/libfakeroot_unix2003.c
@@ -18,7 +18,11 @@
    In this file, we want 'struct stat' to have a 32-bit 'ino_t'.
    We use 'struct stat64' when we need a 64-bit 'ino_t'.
 */
-#define _DARWIN_NO_64_BIT_INODE
+# if __DARWIN_ONLY_64_BIT_INO_T
+#  define _DARWIN_USE_64_BIT_INODE
+# else
+#  define _DARWIN_NO_64_BIT_INODE
+# endif
 
 /*
    This file is for 32-bit symbols which have the "$UNIX2003" version, i.e.
--- a/libfakeroot_inode64.c
+++ b/libfakeroot_inode64.c
@@ -25,7 +25,7 @@
 #include "config.h"
 #include "communicate.h"
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 && !__DARWIN_ONLY_64_BIT_INO_T
 
 #include <stdio.h>
 #include <spawn.h>
--- a/wrapfunc.inp
+++ b/wrapfunc.inp
@@ -48,9 +48,11 @@ getattrlist$UNIX2003;int;(const char *pa
 #endif
 #endif
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+#if !__DARWIN_ONLY_64_BIT_INO_T
 lstat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf)
 stat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf)
 fstat$INODE64;int;(int fd, struct stat *buf);(fd, buf)
+#endif
 posix_spawn;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp)
 posix_spawnp;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp)
 #endif
@@ -232,7 +234,7 @@ facl;int;(int fd, int cmd, int cnt, void
 #ifdef HAVE_FTS_READ
 fts_read;FTSENT *;(FTS *ftsp);(ftsp)
 #ifdef __APPLE__
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 && !__DARWIN_ONLY_64_BIT_INO_T
 fts_read$INODE64;FTSENT *;(FTS *ftsp);(ftsp)
 #endif
 #endif /* ifdef __APPLE__ */
@@ -240,7 +242,7 @@ fts_read$INODE64;FTSENT *;(FTS *ftsp);(f
 #ifdef HAVE_FTS_CHILDREN
 fts_children;FTSENT *;(FTS *ftsp, int options);(ftsp, options)
 #ifdef __APPLE__
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 && !__DARWIN_ONLY_64_BIT_INO_T
 fts_children$INODE64;FTSENT *;(FTS *ftsp, int options);(ftsp, options)
 #endif
 #endif /* ifdef __APPLE__ */