nfs-kernel-server: fix build on macos arm64
authorSergey V. Lobanov <[email protected]>
Sun, 12 Dec 2021 11:55:43 +0000 (14:55 +0300)
committerRosen Penev <[email protected]>
Tue, 14 Dec 2021 03:57:18 +0000 (19:57 -0800)
1. prctl() check is not required for host-compile on any OS due to prctl
is not used in rpcgen which is only one is compiled during host-compile
phase. prctl() check is disabled via HOST_CONFIGURE_VARS in OpenWrt makefile

2. __DARWIN_ONLY_64_BIT_INO_T is true on macos arm64 so struct stat64
and stat64() are not available. This patch defines stat64 as stat if
__DARWIN_ONLY_64_BIT_INO_T is true

Signed-off-by: Sergey V. Lobanov <[email protected]>
net/nfs-kernel-server/Makefile
net/nfs-kernel-server/patches/200-fix-macos-build.patch [new file with mode: 0644]

index 3bf2646aaf8998ed35cc7ac5acf48ad5d8da7476..2492c664d9c3ea1fd326be9f6cd01400901716a4 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nfs-kernel-server
 PKG_VERSION:=2.5.4
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 PKG_HASH:=546ce4b51eeebc66e354b6cc6ca0ce509437efbdef0caaf99389534eef0e598b
 
 PKG_SOURCE_URL:=@SF/nfs
@@ -150,6 +150,7 @@ HOST_CONFIGURE_VARS += \
        ac_cv_header_nfsidmap_h=yes \
        ac_cv_header_blkid_blkid_h=yes \
        ac_cv_lib_resolv___res_querydomain=yes \
+       ac_cv_func_prctl=yes \
        GSSGLUE_CFLAGS=" " \
        GSSGLUE_LIBS=" " \
        RPCSECGSS_CFLAGS=" " \
diff --git a/net/nfs-kernel-server/patches/200-fix-macos-build.patch b/net/nfs-kernel-server/patches/200-fix-macos-build.patch
new file mode 100644 (file)
index 0000000..42ef783
--- /dev/null
@@ -0,0 +1,17 @@
+fix stat64 issue for modern macos versions (including macos arm64)
+
+--- a/tools/rpcgen/rpc_main.c
++++ b/tools/rpcgen/rpc_main.c
+@@ -62,6 +62,12 @@
+ #define EXTEND        1               /* alias for TRUE */
+ #define DONT_EXTEND   0       /* alias for FALSE */
++#ifdef __APPLE__
++# if __DARWIN_ONLY_64_BIT_INO_T
++#  define stat64 stat
++# endif
++#endif
++
+ struct commandline
+   {
+     int cflag;                        /* xdr C routines */