Re: [RFC2 PATCH 00/23] ARM64: support ILP32

From: Andreas Schwab
Date: Tue Jul 05 2016 - 03:34:03 EST


Yury Norov <ynorov@xxxxxxxxxxxxxxxxxx> writes:

> ABI details:
> - types are taken from AARCH32, next types turned to 64-bit,
> as modern requirement for new APIs tells:
> ino_t is u64 type
> off_t is s64 type
> blkcnt_t is s64 type
> fsblkcnt_t is u64 type
> fsfilcnt_t is u64 type

This is missing rlim_t, which is also controlled by _FILE_OFFSET_BITS.

Andreas.

diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h b/sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h
index 39c0c81..b386abe 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h
@@ -36,7 +36,7 @@
#define __OFF_T_TYPE __SQUAD_TYPE
#define __OFF64_T_TYPE __SQUAD_TYPE
#define __PID_T_TYPE __S32_TYPE
-#define __RLIM_T_TYPE __ULONGWORD_TYPE
+#define __RLIM_T_TYPE __UQUAD_TYPE
#define __RLIM64_T_TYPE __UQUAD_TYPE
#define __BLKCNT_T_TYPE __SQUAD_TYPE
#define __BLKCNT64_T_TYPE __SQUAD_TYPE
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit.c
new file mode 100644
index 0000000..b460f45
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit.c
@@ -0,0 +1 @@
+/* See sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit64.c */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit64.c
new file mode 100644
index 0000000..1bf982c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit64.c
@@ -0,0 +1,11 @@
+#define getrlimit __hide_getrlimit
+#define __getrlimit __hide___getrlimit
+#include <sysdeps/unix/sysv/linux/getrlimit64.c>
+#undef getrlimit
+#undef __getrlimit
+
+extern __typeof (__getrlimit64) __getrlimit;
+libc_hidden_proto (__getrlimit)
+strong_alias (__getrlimit64, __getrlimit)
+libc_hidden_def (__getrlimit)
+weak_alias (__getrlimit, getrlimit)
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/prlimit.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/prlimit.c
new file mode 100644
index 0000000..161589a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/prlimit.c
@@ -0,0 +1 @@
+/* prlimit is the same as prlimit64. */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit.c
new file mode 100644
index 0000000..ae9983c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit.c
@@ -0,0 +1 @@
+/* See sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit64.c */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit64.c
new file mode 100644
index 0000000..e8fb138
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit64.c
@@ -0,0 +1,11 @@
+#define setrlimit64 __setrlimit64
+#define setrlimit __hide_setrlimit
+#define __setrlimit __hide___setrlimit
+#include <sysdeps/unix/sysv/linux/setrlimit64.c>
+#undef setrlimit64
+#undef setrlimit
+#undef __setrlimit
+
+strong_alias (__setrlimit64, __setrlimit)
+weak_alias (__setrlimit64, setrlimit64)
+weak_alias (__setrlimit, setrlimit)
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list b/sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list
index e69de29..5fc55b4 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list
@@ -0,0 +1 @@
+prlimit64 EXTRA prlimit64 i:iipp prlimit64 prlimit
--
2.9.0


--
Andreas Schwab, SUSE Labs, schwab@xxxxxxx
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."