aboutsummaryrefslogtreecommitdiffstats
path: root/tools/fakeroot
diff options
context:
space:
mode:
authorSergey V. Lobanov <sergey@lobanov.in>2021-11-29 19:07:34 +0300
committerFelix Fietkau <nbd@nbd.name>2022-02-16 20:38:47 +0100
commitc8d6a7c84e81d415bad22dd381e7aed236ff6df2 (patch)
treec9428bf09f82659a1ab2529f82cddd09d84a6000 /tools/fakeroot
parent83bf22ba2e5853a5afc09585f76dc76c0d74ebea (diff)
downloadupstream-c8d6a7c84e81d415bad22dd381e7aed236ff6df2.tar.gz
upstream-c8d6a7c84e81d415bad22dd381e7aed236ff6df2.tar.bz2
upstream-c8d6a7c84e81d415bad22dd381e7aed236ff6df2.zip
tools/fakeroot: fix build on MacOS arm64
Added patch for MacOS without 32 bit inodes support (__DARWIN_ONLY_64_BIT_INO_T is true) This patch based on discussion https://github.com/archmac/bootstrap/issues/4 Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in> (cherry-picked from commit 8fedc17d01806c8a4bf4ed9e83a9523677d37bbd)
Diffstat (limited to 'tools/fakeroot')
-rw-r--r--tools/fakeroot/patches/500-macos_arm64_compile_fix.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/tools/fakeroot/patches/500-macos_arm64_compile_fix.patch b/tools/fakeroot/patches/500-macos_arm64_compile_fix.patch
new file mode 100644
index 0000000000..a3731b9e99
--- /dev/null
+++ b/tools/fakeroot/patches/500-macos_arm64_compile_fix.patch
@@ -0,0 +1,86 @@
+diff --git a/communicate.c b/communicate.c
+index e2699a2..21e5366 100644
+--- 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"
+diff --git a/communicate.h b/communicate.h
+index 3f9ca39..a586108 100644
+--- 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 */
+diff --git a/faked.c b/faked.c
+index a970184..ea51a23 100644
+--- 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"
+diff --git a/libfakeroot.c b/libfakeroot.c
+index c967d5d..836337d 100644
+--- 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
+diff --git a/libfakeroot_unix2003.c b/libfakeroot_unix2003.c
+index e1e19b6..f32bfec 100644
+--- 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.