2021-12-14 17:01:32

by Sergey V. Lobanov

[permalink] [raw]
Subject: [PATCH] tools/rpcgen: fix build on macos arm64 (stat64 issue)

__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]>
---
tools/rpcgen/rpc_main.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/tools/rpcgen/rpc_main.c b/tools/rpcgen/rpc_main.c
index e97940b9..277adc6b 100644
--- 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 */
--
2.30.1 (Apple Git-130)



2022-01-10 15:05:58

by Steve Dickson

[permalink] [raw]
Subject: Re: [PATCH] tools/rpcgen: fix build on macos arm64 (stat64 issue)



On 12/14/21 11:55, Sergey V. Lobanov wrote:
> __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]>
Committed... (tag: nfs-utils-2-5-5-rc5)

steved.
> ---
> tools/rpcgen/rpc_main.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tools/rpcgen/rpc_main.c b/tools/rpcgen/rpc_main.c
> index e97940b9..277adc6b 100644
> --- 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 */
>