Browse Source

nfs-kernel-server: fix build on macos arm64

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 <sergey@lobanov.in>
lilik-openwrt-22.03
Sergey V. Lobanov 3 years ago
committed by Rosen Penev
parent
commit
8457944e61
2 changed files with 19 additions and 1 deletions
  1. +2
    -1
      net/nfs-kernel-server/Makefile
  2. +17
    -0
      net/nfs-kernel-server/patches/200-fix-macos-build.patch

+ 2
- 1
net/nfs-kernel-server/Makefile View 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=" " \


+ 17
- 0
net/nfs-kernel-server/patches/200-fix-macos-build.patch View File

@ -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 */

Loading…
Cancel
Save