public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [RFC v4 13/24] RISC-V: Use 64-bit timespec in clock_gettime vdso calls
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (7 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 03/24] sysdeps/gettimeofday: Use clock_gettime64 if avaliable Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-10  1:03 ` [RFC v4 08/24] sysdeps/stat: Copy the statx struct to stat instead of stat64 Alistair Francis
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 sysdeps/unix/sysv/linux/riscv/init-first.c | 2 +-
 sysdeps/unix/sysv/linux/riscv/libc-vdso.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/riscv/init-first.c b/sysdeps/unix/sysv/linux/riscv/init-first.c
index 98a8ce33adb..35dc8a8d386 100644
--- a/sysdeps/unix/sysv/linux/riscv/init-first.c
+++ b/sysdeps/unix/sysv/linux/riscv/init-first.c
@@ -24,7 +24,7 @@ long int (*VDSO_SYMBOL (getcpu)) (unsigned int *, unsigned int *, void *)
     attribute_hidden;
 long int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
     attribute_hidden;
-long int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct timespec *)
+long int (*VDSO_SYMBOL (__clock_gettime64)) (clockid_t, struct __timespec64 *)
     attribute_hidden;
 long int (*VDSO_SYMBOL (clock_getres)) (clockid_t, struct timespec *)
     attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/riscv/libc-vdso.h b/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
index 2373292ab9e..16905d5b78d 100644
--- a/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
@@ -26,7 +26,7 @@ extern long int (*VDSO_SYMBOL (getcpu)) (unsigned int *, unsigned int *, void *)
     attribute_hidden;
 extern long int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
     attribute_hidden;
-extern long int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct timespec *)
+extern long int (*VDSO_SYMBOL (__clock_gettime64)) (clockid_t, struct __timespec64 *)
     attribute_hidden;
 extern long int (*VDSO_SYMBOL (clock_getres)) (clockid_t, struct timespec *)
     attribute_hidden;
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 09/24] Documentation for the RISC-V 32-bit port
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (13 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 02/24] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-12 20:02   ` Joseph Myers
  2019-08-10  1:04 ` [RFC v4 21/24] Add RISC-V 32-bit target to build-many-glibcs.py Alistair Francis
                   ` (8 subsequent siblings)
  23 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

From: Zong Li <zongbox@gmail.com>

There are RISC-V 64-bit port information in these documentations. I add
the small documentation entries about the RISC-V 32-bit port together.
---
 NEWS   | 6 ++++++
 README | 1 +
 2 files changed, 7 insertions(+)

diff --git a/NEWS b/NEWS
index 4326997dddf..27742944e9a 100644
--- a/NEWS
+++ b/NEWS
@@ -306,6 +306,12 @@ Major new features:
   "%EY" to control how the year number is formatted; they have the
   same effect that they would on "%Ey".
 
+* Support RISC-V port for 32-bit. The ISA and ABI pairs supported as follows:
+
+    - rv32imac ilp32
+    - rv32imafdc ilp32
+    - rv32imafdc ilp32d
+
 Deprecated and removed features, and other changes affecting compatibility:
 
 * The glibc.tune tunable namespace has been renamed to glibc.cpu and the
diff --git a/README b/README
index eb9b0b34a35..2dc80d0062e 100644
--- a/README
+++ b/README
@@ -38,6 +38,7 @@ The GNU C Library supports these configurations for using Linux kernels:
 	powerpc64*-*-linux-gnu	Big-endian and little-endian.
 	s390-*-linux-gnu
 	s390x-*-linux-gnu
+	riscv32-*-linux-gnu
 	riscv64-*-linux-gnu
 	sh[34]-*-linux-gnu
 	sparc*-*-linux-gnu
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 02/24] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (12 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 15/24] RISC-V: Add path of library directories for RV32 Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-12 17:22   ` Joseph Myers
  2019-08-10  1:03 ` [RFC v4 09/24] Documentation for the RISC-V 32-bit port Alistair Francis
                   ` (9 subsequent siblings)
  23 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

The nanosleep syscall is not supported on newer 32-bit platforms (such
as RV32). To fix this issue let's use clock_nanosleep_time64 if it is
avaliable.

Let's use CLOCK_REALTIME when calling clock_nanosleep_time64 as the
Linux specification says:
  "POSIX.1 specifies that nanosleep() should measure time against the
   CLOCK_REALTIME clock. However, Linux measures the time using the
   CLOCK_MONOTONIC clock. This probably does not matter, since the POSIX.1
   specification for clock_settime(2) says that discontinuous changes in
   CLOCK_REALTIME should not affect nanosleep()"

NOTE: We don't convert the struct timespec* remaining to a 64-bit value,
we need to kernel to provide __NR_clock_nanosleep_time64 and __TIMESIZE == 64
to get a 64bit timespec.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 ChangeLog                                    |  6 ++
 nptl/thrd_sleep.c                            | 60 +++++++++++++++-
 sysdeps/unix/sysv/linux/clock_nanosleep.c    | 61 +++++++++++++++-
 sysdeps/unix/sysv/linux/nanosleep.c          | 75 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/nanosleep_nocancel.c | 47 ++++++++++++
 5 files changed, 243 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a8186db3944..aab4469b3d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1419,6 +1419,12 @@
 
 	* support/xtime.h: Add xclock_now() helper function.
 
+2019-06-21  Alistair Francis  <alistair.francis@wdc.com>
+
+	* nptl/thrd_sleep.c: Use clock_nanosleep_time64 instead of nanosleep.
+	* sysdeps/unix/sysv/linux/nanosleep.c: Likewise.
+	* sysdeps/unix/sysv/linux/nanosleep_nocancel.c: Likewise.
+
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
 
diff --git a/nptl/thrd_sleep.c b/nptl/thrd_sleep.c
index 07a51808df2..fc495b56c67 100644
--- a/nptl/thrd_sleep.c
+++ b/nptl/thrd_sleep.c
@@ -25,14 +25,68 @@ int
 thrd_sleep (const struct timespec* time_point, struct timespec* remaining)
 {
   INTERNAL_SYSCALL_DECL (err);
-  int ret = INTERNAL_SYSCALL_CANCEL (nanosleep, err, time_point, remaining);
+  int ret = -1;
+
+#ifdef __ASSUME_TIME64_SYSCALLS
+  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, CLOCK_REALTIME,
+                                 0, time_point, remaining);
+#else
+# ifdef __NR_clock_nanosleep_time64
+#  if __TIMESIZE == 64
+  long int ret_64;
+
+  ret_64 = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, CLOCK_REALTIME,
+                                    0, time_point, remaining);
+
+  if (ret_64 == 0 || errno != ENOSYS)
+    ret = ret_64;
+#  else
+  timespec64 ts64;
+
+  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
+                                 CLOCK_REALTIME, 0, time_point,
+                                 ts64);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      remaining->tv_sec = ts64.tv_sec;
+      remaining->tv_nsec = ts64.tv_nsec;
+    }
+#  endif /* __TIMESIZE == 64 */
+# endif /* __NR_clock_nanosleep_time64 */
+# if __TIMESIZE == 64
+  if (ret < 0)
+    {
+      struct timespec ts32, tr32;
+
+      if (! in_time_t_range (time_point->tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      valid_timespec64_to_timespec (time_point, &ts32);
+      ret =  INTERNAL_SYSCALL_CANCEL (nanosleep, err, &ts32, &tr32);
+
+      if (ret == 0 || errno != ENOSYS)
+        {
+          remaining->tv_sec = tr32.tv_sec;
+          remaining->tv_nsec = tr32.tv_nsec;
+        }
+    }
+# else
+  if (ret < 0)
+      ret =  INTERNAL_SYSCALL_CANCEL (nanosleep, err, time_point, remaining);
+# endif /* __TIMESIZE == 64 */
+#endif /* __ASSUME_TIME64_SYSCALLS */
+
   if (INTERNAL_SYSCALL_ERROR_P (ret, err))
     {
       /* C11 states thrd_sleep function returns -1 if it has been interrupted
-	 by a signal, or a negative value if it fails.  */
+         by a signal, or a negative value if it fails.  */
       ret = INTERNAL_SYSCALL_ERRNO (ret, err);
       if (ret == EINTR)
-	return -1;
+        return -1;
       return -2;
     }
   return 0;
diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c b/sysdeps/unix/sysv/linux/clock_nanosleep.c
index 0cb6614dc92..4f9fc8b47b6 100644
--- a/sysdeps/unix/sysv/linux/clock_nanosleep.c
+++ b/sysdeps/unix/sysv/linux/clock_nanosleep.c
@@ -21,13 +21,14 @@
 #include <sysdep-cancel.h>
 #include "kernel-posix-cpu-timers.h"
 
-
 /* We can simply use the syscall.  The CPU clocks are not supported
    with this function.  */
 int
 __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
 		   struct timespec *rem)
 {
+  int r = -1;
+
   if (clock_id == CLOCK_THREAD_CPUTIME_ID)
     return EINVAL;
   if (clock_id == CLOCK_PROCESS_CPUTIME_ID)
@@ -36,8 +37,62 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
   /* If the call is interrupted by a signal handler or encounters an error,
      it returns a positive value similar to errno.  */
   INTERNAL_SYSCALL_DECL (err);
-  int r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep, err, clock_id, flags,
-				   req, rem);
+
+
+#ifdef __ASSUME_TIME64_SYSCALLS
+  r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, clock_id,
+                               flags, req, rem);
+#else
+# ifdef __NR_clock_nanosleep_time64
+#  if __TIMESIZE == 64
+  long int ret_64;
+
+  ret_64 = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, clock_id,
+                                    flags, req, rem);
+
+  if (ret_64 == 0 || errno != ENOSYS)
+    r = ret_64;
+#  else
+  timespec64 ts64;
+
+  r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
+                               clock_id, flags, req,
+                               ts64);
+
+  if (r == 0 || errno != ENOSYS)
+    {
+      rem->tv_sec = ts64.tv_sec;
+      rem->tv_nsec = ts64.tv_nsec;
+      return r;
+    }
+#  endif /* __TIMESIZE == 64 */
+# endif /* __NR_clock_nanosleep_time64 */
+# if __TIMESIZE == 64
+  struct timespec ts32, tr32;
+
+  if (r < 0)
+    {
+      if (! in_time_t_range (req->tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      valid_timespec64_to_timespec (req, &ts32);
+      r =  INTERNAL_SYSCALL_CANCEL (clock_nanosleep, err, &ts32, &tr32);
+
+      if (r == 0 || errno != ENOSYS)
+        {
+          rem->tv_sec = tr32.tv_sec;
+          rem->tv_nsec = tr32.tv_nsec;
+        }
+    }
+# else
+  if (r < 0)
+      r =  INTERNAL_SYSCALL_CANCEL (clock_nanosleep, err, req, rem);
+# endif /* __TIMESIZE == 64 */
+#endif /* __ASSUME_TIME64_SYSCALLS */
+
   return (INTERNAL_SYSCALL_ERROR_P (r, err)
 	  ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
 }
diff --git a/sysdeps/unix/sysv/linux/nanosleep.c b/sysdeps/unix/sysv/linux/nanosleep.c
index f14ae565af5..a894ccbc6dd 100644
--- a/sysdeps/unix/sysv/linux/nanosleep.c
+++ b/sysdeps/unix/sysv/linux/nanosleep.c
@@ -20,12 +20,87 @@
 #include <sysdep-cancel.h>
 #include <not-cancel.h>
 
+#if defined(__ASSUME_TIME64_SYSCALLS) || defined(__NR_clock_nanosleep_time64)
+static int
+__nanosleep_time64_64 (const struct timespec *requested_time,
+                       struct timespec *remaining)
+{
+  return SYSCALL_CANCEL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
+                         requested_time, remaining);
+}
+
+#if __TIMESIZE == 32
+struct timespec64
+{
+  long long int tv_sec;   /* Seconds.  */
+  long int tv_nsec;  /* Nanoseconds.  */
+};
+
+static int
+__nanosleep_time64_32 (const struct timespec *requested_time,
+                       struct timespec *remaining)
+{
+  timespec64 ts;
+
+  long int ret = SYSCALL_CANCEL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
+                                 requested_time, &ts);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      remaining->tv_sec = ts.tv_sec;
+      remaining->tv_nsec = ts.tv_nsec;
+    }
+
+  return ret;
+}
+#endif
+#endif
+
 /* Pause execution for a number of nanoseconds.  */
 int
 __nanosleep (const struct timespec *requested_time,
 	     struct timespec *remaining)
 {
+#ifdef __ASSUME_TIME64_SYSCALLS
+  return __nanosleep_time64_64 (requested_time, remaining);
+#else
+  long int ret;
+# ifdef __NR_clock_nanosleep_time64
+#  if __TIMESIZE == 64
+  ret = __nanosleep_time64_64 (requested_time, remaining);
+
+  if (ret == 0 || errno != ENOSYS)
+    return ret;
+#  else
+  ret = __nanosleep_time64_32 (requested_time, remaining);
+
+  if (ret == 0 || errno != ENOSYS)
+    return ret;
+#  endif /* __TIMESIZE == 64 */
+# endif /* __NR_clock_nanosleep_time64 */
+# if __TIMESIZE == 64
+  struct timespec ts32, tr32;
+
+  if (! in_time_t_range (requested_time->tv_sec))
+    {
+      __set_errno (EOVERFLOW);
+      return -1;
+    }
+
+  valid_timespec64_to_timespec (requested_time, &ts32);
+  ret =  SYSCALL_CANCEL (nanosleep, &ts32, &tr32);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      remaining->tv_sec = tr32.tv_sec;
+      remaining->tv_nsec = tr32.tv_nsec;
+    }
+
+  return ret;
+# else
   return SYSCALL_CANCEL (nanosleep, requested_time, remaining);
+# endif /* __TIMESIZE == 64 */
+#endif /* __ASSUME_TIME64_SYSCALLS */
 }
 hidden_def (__nanosleep)
 weak_alias (__nanosleep, nanosleep)
diff --git a/sysdeps/unix/sysv/linux/nanosleep_nocancel.c b/sysdeps/unix/sysv/linux/nanosleep_nocancel.c
index 122ba627ff3..f04e229e5ec 100644
--- a/sysdeps/unix/sysv/linux/nanosleep_nocancel.c
+++ b/sysdeps/unix/sysv/linux/nanosleep_nocancel.c
@@ -24,6 +24,53 @@ int
 __nanosleep_nocancel (const struct timespec *requested_time,
 		      struct timespec *remaining)
 {
+#ifdef __ASSUME_TIME64_SYSCALLS
+  return INLINE_SYSCALL_CALL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
+                         requested_time, remaining);
+#else
+  long int ret;
+# ifdef __NR_clock_nanosleep_time64
+#  if __TIMESIZE == 64
+  ret = INLINE_SYSCALL_CALL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
+                             requested_time, remaining);
+
+  if (ret_64 == 0 || errno != ENOSYS)
+    return ret;
+#  else
+  timespec64 ts64;
+
+  ret = INLINE_SYSCALL_CALL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
+                             time_point, ts64);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      remaining->tv_sec = ts64.tv_sec;
+      remaining->tv_nsec = ts64.tv_nsec;
+      return ret;
+    }
+#  endif /* __TIMESIZE == 64 */
+# endif /* __NR_clock_nanosleep_time64 */
+# if __TIMESIZE == 64
+  struct timespec ts32, tr32;
+
+  if (! in_time_t_range (requested_time->tv_sec))
+    {
+      __set_errno (EOVERFLOW);
+      return -1;
+    }
+
+  valid_timespec64_to_timespec (requested_time, &ts32);
+  ret = INLINE_SYSCALL_CALL (nanosleep, &ts32, &tr32);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      remaining->tv_sec = tr32.tv_sec;
+      remaining->tv_nsec = tr32.tv_nsec;
+    }
+  return ret;
+# else
   return INLINE_SYSCALL_CALL (nanosleep, requested_time, remaining);
+# endif /* __TIMESIZE == 64 */
+#endif /* __ASSUME_TIME64_SYSCALLS */
 }
 hidden_def (__nanosleep_nocancel)
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 04/24] sysdeps/wait: Use waitid if avaliable
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (10 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 12/24] RISC-V: define __NR_* as __NR_*_time64/64 for 32-bit Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-10  1:03 ` [RFC v4 15/24] RISC-V: Add path of library directories for RV32 Alistair Francis
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

If the waitid syscall is avaliable let's use that as waitpid
and wait4 aren't always avaliable (they aren't avaliable on RV32).

Unfortunately waitid is substantially differnt to waitpid and wait4, so
the conversion ends up being complex.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 ChangeLog                                  |  3 ++
 sysdeps/unix/sysv/linux/wait.c             | 41 +++++++++++++--
 sysdeps/unix/sysv/linux/waitpid.c          | 58 +++++++++++++++++++++-
 sysdeps/unix/sysv/linux/waitpid_nocancel.c | 55 +++++++++++++++++++-
 4 files changed, 152 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 82a2cdc746d..6daa6f259e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1425,6 +1425,9 @@
 	* sysdeps/unix/sysv/linux/nanosleep.c: Likewise.
 	* sysdeps/unix/sysv/linux/nanosleep_nocancel.c: Likewise.
 	* sysdeps/unix/sysv/linux/gettimeofday.c: Use clock_gettime64 syscall for gettimeofday.
+	* sysdeps/unix/sysv/linux/wait.c: Use __NR_waitid if avaliable.
+	* sysdeps/unix/sysv/linux/waitpid.c: Likewise.
+	* sysdeps/unix/sysv/linux/waitpid_nocancel.c: Likewise.
 
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
diff --git a/sysdeps/unix/sysv/linux/wait.c b/sysdeps/unix/sysv/linux/wait.c
index 498bd1c095e..cd124ed11fb 100644
--- a/sysdeps/unix/sysv/linux/wait.c
+++ b/sysdeps/unix/sysv/linux/wait.c
@@ -26,9 +26,44 @@
 pid_t
 __libc_wait (int *stat_loc)
 {
-  pid_t result = SYSCALL_CANCEL (wait4, WAIT_ANY, stat_loc, 0,
-				 (struct rusage *) NULL);
-  return result;
+#ifdef __NR_wait4
+  return SYSCALL_CANCEL (wait4, WAIT_ANY, stat_loc, 0,
+                         (struct rusage *) NULL);
+#else
+  siginfo_t infop;
+  __pid_t ret;
+
+  ret = SYSCALL_CANCEL (waitid, P_ALL, 0, &infop, WEXITED, NULL);
+
+  if (ret < 0)
+      return ret;
+
+  if (stat_loc)
+    {
+      *stat_loc = 0;
+      switch (infop.si_code)
+      {
+        case CLD_EXITED:
+            *stat_loc = infop.si_status << 8;
+            break;
+        case CLD_DUMPED:
+            *stat_loc = 0x80;
+            /* Fallthrough */
+        case CLD_KILLED:
+            *stat_loc |= infop.si_status;
+            break;
+        case CLD_TRAPPED:
+        case CLD_STOPPED:
+            *stat_loc = infop.si_status << 8 | 0x7f;
+            break;
+        case CLD_CONTINUED:
+            *stat_loc = 0xffff;
+            break;
+      }
+    }
+
+  return infop.si_pid;
+#endif
 }
 
 weak_alias (__libc_wait, __wait)
diff --git a/sysdeps/unix/sysv/linux/waitpid.c b/sysdeps/unix/sysv/linux/waitpid.c
index f0897574c0b..2add17b3023 100644
--- a/sysdeps/unix/sysv/linux/waitpid.c
+++ b/sysdeps/unix/sysv/linux/waitpid.c
@@ -20,14 +20,70 @@
 #include <sysdep-cancel.h>
 #include <stdlib.h>
 #include <sys/wait.h>
+#include <unistd.h>
 
 __pid_t
 __waitpid (__pid_t pid, int *stat_loc, int options)
 {
 #ifdef __NR_waitpid
   return SYSCALL_CANCEL (waitpid, pid, stat_loc, options);
-#else
+#elif defined(__NR_wait4)
   return SYSCALL_CANCEL (wait4, pid, stat_loc, options, NULL);
+#else
+  __pid_t ret;
+  idtype_t idtype = P_PID;
+  siginfo_t infop;
+
+  if (pid < -1)
+    {
+      idtype = P_PGID;
+      pid *= -1;
+    }
+  else if (pid == -1)
+    {
+      idtype = P_ALL;
+    }
+  else if (pid == 0)
+    {
+      /* FIXME: This can lead to a race condition */
+      idtype = P_PGID;
+      pid = getpgrp();
+    }
+
+  options |= WEXITED;
+
+  ret = SYSCALL_CANCEL (waitid, idtype, pid, &infop, options, NULL);
+
+  if (ret < 0)
+    {
+      return ret;
+    }
+
+  if (stat_loc)
+    {
+      *stat_loc = 0;
+      switch (infop.si_code)
+        {
+        case CLD_EXITED:
+            *stat_loc = infop.si_status << 8;
+            break;
+        case CLD_DUMPED:
+            *stat_loc = 0x80;
+            /* Fallthrough */
+        case CLD_KILLED:
+            *stat_loc |= infop.si_status;
+            break;
+        case CLD_TRAPPED:
+        case CLD_STOPPED:
+            *stat_loc = infop.si_status << 8 | 0x7f;
+            break;
+        case CLD_CONTINUED:
+            *stat_loc = 0xffff;
+            break;
+        }
+    }
+
+  return infop.si_pid;
 #endif
 }
 libc_hidden_def (__waitpid)
diff --git a/sysdeps/unix/sysv/linux/waitpid_nocancel.c b/sysdeps/unix/sysv/linux/waitpid_nocancel.c
index 89e36a5c0b1..00d566a9931 100644
--- a/sysdeps/unix/sysv/linux/waitpid_nocancel.c
+++ b/sysdeps/unix/sysv/linux/waitpid_nocancel.c
@@ -27,8 +27,61 @@ __waitpid_nocancel (__pid_t pid, int *stat_loc, int options)
 {
 #ifdef __NR_waitpid
   return INLINE_SYSCALL_CALL (waitpid, pid, stat_loc, options);
-#else
+#elif defined (__NR_wait4)
   return INLINE_SYSCALL_CALL (wait4, pid, stat_loc, options, NULL);
+#else
+  __pid_t ret;
+  idtype_t idtype = P_PID;
+  siginfo_t infop;
+
+  if (pid < -1)
+    {
+      idtype = P_PGID;
+      pid *= -1;
+    }
+  else if (pid == -1)
+    {
+      idtype = P_ALL;
+    }
+  else if (pid == 0)
+    {
+      /* FIXME: This can lead to a race condition */
+      idtype = P_PGID;
+      pid = getpgrp();
+    }
+
+  options |= WEXITED;
+
+  ret = INLINE_SYSCALL_CALL (waitid, idtype, pid, &infop, options, NULL);
+
+  if (ret < 0)
+      return ret;
+
+  if (stat_loc)
+    {
+      *stat_loc = 0;
+      switch (infop.si_code)
+        {
+        case CLD_EXITED:
+            *stat_loc = infop.si_status << 8;
+            break;
+        case CLD_DUMPED:
+            *stat_loc = 0x80;
+            /* Fallthrough */
+        case CLD_KILLED:
+            *stat_loc |= infop.si_status;
+            break;
+        case CLD_TRAPPED:
+        case CLD_STOPPED:
+            *stat_loc = infop.si_status << 8 | 0x7f;
+            break;
+        case CLD_CONTINUED:
+            *stat_loc = 0xffff;
+            break;
+        }
+    }
+
+  return infop.si_pid;
 #endif
 }
 libc_hidden_def (__waitpid_nocancel)
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 00/24]  RISC-V glibc port for the 32-bit
@ 2019-08-10  1:03 Alistair Francis
  2019-08-10  1:03 ` [RFC v4 17/24] RISC-V: Hard float support for the 32 bit Alistair Francis
                   ` (23 more replies)
  0 siblings, 24 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

This patch set contains the glibc port for the 32-bit RISC-V.

This is based on all of the work that Zong Li has done [1].

Unfortunately the Linux ABI has changed since Zong Li's latest
submission. The RISC-V 32-bit (RV32) ABI no longer defines
__ARCH_WANT_TIME32_SYSCALLS which means there are no 32-bit versions of
time_t, off_t or any struct resource or system calls that use them.

To mitigate this I have set the RV32 port to use 64-bit time_t and off_t
(as is done in x86-32) and also changed the syscall imvocation to handle
the missing syscalls. This means that the RV32 port will be y2038 safe.

This series applies ontop of Lukasz's __clock_settime64 implementation [2].

The ChangeLog will need to be updated, so don't worry too much
about that.

The waitid() call can result in a race condition. We are waiting for
kernel patches to allow passing a pid of 0 in [3]. This will need to be
updated once the kernel patches have landed.

The last two patches change the syscalls.list file. I'm not clear on the
correct way to handle this change. I would like to get some feedback on
what I should do here.

All testing has been done on a 5.1+ kernel (it won't work on earlier
kernels). I still haven't been able to reliably run the tests, so no
test results yet. I should have those when I send the first patch
series.

Importantly glibc is not the only project that needs to be updated to
work with a 32-bit kernel that doesn't define
__ARCH_WANT_TIME32_SYSCALLS. So far OpenSSL, busybox and systemd all
need patches to work with RV32. My hope here is that we can get a
reasonable agreement on how to handle this in glibc and then use that to
update other projects. This is why I would still really like feedback
even though this won't go into the next release.

Feedback on this series is very welcome!

1: https://sourceware.org/ml/libc-alpha/2018-07/msg00892.html
2: https://sourceware.org/ml/libc-alpha/2019-05/msg00661.html
3: https://sourceware.org/ml/libc-alpha/2019-07/msg00489.html

The latest version of my work can be found here: https://github.com/alistair23/glibc/tree/alistair/rv32.next

This specific version can be found here: https://github.com/alistair23/glibc/tree/alistair/rv32.rfc4

RFC v4:
 - Continue to fix things that weren't working
 - Update the coding style to match glibc
 - Update the __ASSUME_TIME64_SYSCALLS work to better match Lukasz's
 work
RFC v3:
 - Remove all "Hack" patches
 - Incorporate upstream comments
 - Ensure we don't break RV64
 - Lot's more testing and fixes
RFC v2:
 - Add Lukasz's patches
 - Update the non HACK syscalls after feedback
 - define __ASSUME_TIME64_SYSCALLS and __ASSUME_RLIM64_SYSCALLS
 - Remove lockf64.c
 - Other smaller changes from RFC v1



Alistair Francis (15):
  sunrpc/clnt_udp: Ensure total_deadline is initalised
  sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  sysdeps/gettimeofday: Use clock_gettime64 if avaliable
  sysdeps/wait: Use waitid if avaliable
  sysdeps/clock_gettime: Use clock_gettime64 if avaliable
  sysdeps/timespec_get: Use clock_gettime64 if avaliable
  time: Deprecate struct timezone members
  sysdeps/stat: Copy the statx struct to stat instead of stat64
  RISC-V: Use 64-bit time_t and off_t for RV32 and RV64
  RISC-V: define __NR_futex as __NR_futex_time64 for 32-bit
  RISC-V: define __NR_* as __NR_*_time64/64 for 32-bit
  RISC-V: Use 64-bit timespec in clock_gettime vdso calls
  RISC-V: Use 64-bit vdso syscalls for RV32
  WIP: syscall.list: Call 64-bit versions of syscalls
  timerfd_settime: Use 64-bit call if avaliable

Zong Li (9):
  Documentation for the RISC-V 32-bit port
  RISC-V: Support dynamic loader for the 32-bit
  RISC-V: Add path of library directories for RV32
  RISC-V: The ABI implementation for the 32-bit
  RISC-V: Hard float support for the 32 bit
  RISC-V: Add ABI lists
  RISC-V: Build Infastructure for the 32-bit
  RISC-V: Fix llrint and llround missing exceptions on RV32
  Add RISC-V 32-bit target to build-many-glibcs.py

 ChangeLog                                     |   94 +
 NEWS                                          |    6 +
 README                                        |    1 +
 nptl/thrd_sleep.c                             |   60 +-
 scripts/build-many-glibcs.py                  |   15 +
 sunrpc/clnt_udp.c                             |    2 +-
 sysdeps/riscv/bits/wordsize.h                 |    4 +-
 sysdeps/riscv/nptl/bits/pthreadtypes-arch.h   |   25 +-
 sysdeps/riscv/preconfigure                    |    6 +-
 sysdeps/riscv/rv32/Implies-after              |    1 +
 .../riscv/rv32/fix-fp-int-convert-overflow.h  |   38 +
 sysdeps/riscv/rv32/rvd/Implies                |    3 +
 sysdeps/riscv/rv32/rvd/s_lrint.c              |   31 +
 sysdeps/riscv/rv32/rvd/s_lround.c             |   31 +
 sysdeps/riscv/rv32/rvf/Implies                |    1 +
 sysdeps/riscv/rv32/rvf/s_lrintf.c             |   31 +
 sysdeps/riscv/rv32/rvf/s_lroundf.c            |   31 +
 sysdeps/riscv/sfp-machine.h                   |   27 +-
 sysdeps/riscv/sys/asm.h                       |    5 +-
 sysdeps/unix/bsd/ftime.c                      |    4 +-
 sysdeps/unix/sysv/linux/Makefile              |    2 +
 sysdeps/unix/sysv/linux/clock_getres.c        |    4 +
 sysdeps/unix/sysv/linux/clock_gettime.c       |   62 +-
 sysdeps/unix/sysv/linux/clock_nanosleep.c     |   61 +-
 .../sysv/linux/generic/wordsize-32/fxstat.c   |    2 +-
 .../sysv/linux/generic/wordsize-32/fxstatat.c |    2 +-
 .../sysv/linux/generic/wordsize-32/lxstat.c   |    2 +-
 .../sysv/linux/generic/wordsize-32/xstat.c    |    2 +-
 sysdeps/unix/sysv/linux/gettimeofday.c        |   51 +
 sysdeps/unix/sysv/linux/nanosleep.c           |   75 +
 sysdeps/unix/sysv/linux/nanosleep_nocancel.c  |   47 +
 sysdeps/unix/sysv/linux/riscv/Makefile        |    4 +-
 .../unix/sysv/linux/riscv/bits/environments.h |   85 +
 sysdeps/unix/sysv/linux/riscv/bits/time64.h   |   36 +
 sysdeps/unix/sysv/linux/riscv/bits/timesize.h |   22 +
 .../unix/sysv/linux/riscv/bits/typesizes.h    |   84 +
 sysdeps/unix/sysv/linux/riscv/configure       |   39 +
 sysdeps/unix/sysv/linux/riscv/configure.ac    |    8 +
 sysdeps/unix/sysv/linux/riscv/dl-cache.h      |   17 +-
 sysdeps/unix/sysv/linux/riscv/init-first.c    |   24 +-
 sysdeps/unix/sysv/linux/riscv/ldconfig.h      |    2 +-
 sysdeps/unix/sysv/linux/riscv/libc-vdso.h     |   10 +-
 sysdeps/unix/sysv/linux/riscv/rv32/Implies    |    3 +
 .../unix/sysv/linux/riscv/rv32/c++-types.data |   67 +
 .../sysv/linux/riscv/rv32/jmp_buf-macros.h    |   53 +
 sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist |    9 +
 .../linux/riscv/rv32/libBrokenLocale.abilist  |    1 +
 .../unix/sysv/linux/riscv/rv32/libanl.abilist |    4 +
 .../unix/sysv/linux/riscv/rv32/libc.abilist   | 2101 +++++++++++++++++
 .../sysv/linux/riscv/rv32/libcrypt.abilist    |    2 +
 .../unix/sysv/linux/riscv/rv32/libdl.abilist  |    9 +
 .../unix/sysv/linux/riscv/rv32/libm.abilist   | 1021 ++++++++
 .../sysv/linux/riscv/rv32/libpthread.abilist  |  235 ++
 .../sysv/linux/riscv/rv32/libresolv.abilist   |   79 +
 .../unix/sysv/linux/riscv/rv32/librt.abilist  |   35 +
 .../linux/riscv/rv32/libthread_db.abilist     |   40 +
 .../sysv/linux/riscv/rv32/libutil.abilist     |    6 +
 sysdeps/unix/sysv/linux/riscv/shlib-versions  |   10 +-
 sysdeps/unix/sysv/linux/riscv/sysdep.h        |   57 +
 sysdeps/unix/sysv/linux/statx_cp.c            |   24 +
 sysdeps/unix/sysv/linux/statx_cp.h            |    3 +
 sysdeps/unix/sysv/linux/sys/timerfd.h         |   21 +-
 sysdeps/unix/sysv/linux/syscalls.list         |    7 +-
 sysdeps/unix/sysv/linux/timerfd_settime.c     |  104 +
 sysdeps/unix/sysv/linux/timespec_get.c        |   56 +-
 sysdeps/unix/sysv/linux/wait.c                |   41 +-
 sysdeps/unix/sysv/linux/waitpid.c             |   58 +-
 sysdeps/unix/sysv/linux/waitpid_nocancel.c    |   55 +-
 time/sys/time.h                               |    4 +-
 69 files changed, 5106 insertions(+), 56 deletions(-)
 create mode 100644 sysdeps/riscv/rv32/Implies-after
 create mode 100644 sysdeps/riscv/rv32/fix-fp-int-convert-overflow.h
 create mode 100644 sysdeps/riscv/rv32/rvd/Implies
 create mode 100644 sysdeps/riscv/rv32/rvd/s_lrint.c
 create mode 100644 sysdeps/riscv/rv32/rvd/s_lround.c
 create mode 100644 sysdeps/riscv/rv32/rvf/Implies
 create mode 100644 sysdeps/riscv/rv32/rvf/s_lrintf.c
 create mode 100644 sysdeps/riscv/rv32/rvf/s_lroundf.c
 create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/environments.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/time64.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/timesize.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/typesizes.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/Implies
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libBrokenLocale.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libcrypt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libdl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libm.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libresolv.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libthread_db.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist
 create mode 100644 sysdeps/unix/sysv/linux/timerfd_settime.c

-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 10/24] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (5 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 16/24] RISC-V: The ABI implementation for the 32-bit Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-10  1:03 ` [RFC v4 03/24] sysdeps/gettimeofday: Use clock_gettime64 if avaliable Alistair Francis
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

Using the original glibc headers under bits/ let's make small
modifications to use 64-bit time_t and off_t for both RV32 and RV64.

For the typesizes.h, here are justifications for the changes from the
generic version (based on Arnd's very helpful feedback):
-  All the !__USE_FILE_OFFSET64  types (__off_t, __ino_t, __rlim_t, ...) are
  changed to match the 64-bit replacements.

- __time_t is defined to 64 bit, but no __time64_t is added. This makes sense
  as we don't have the time64 support for other 32-bit architectures yet, and
  it will be easy to change when that happens.

- __suseconds_t is 64-bit. This matches what we use the kerne ABI for the
  few drivers that are relying on 'struct timeval' input arguments in
  ioctl, as well as the adjtimex system call. It means that timeval has to
  be defined without the   padding, unlike timespec, which needs padding.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 ChangeLog                                     |  4 +
 .../unix/sysv/linux/riscv/bits/environments.h | 85 +++++++++++++++++++
 sysdeps/unix/sysv/linux/riscv/bits/time64.h   | 36 ++++++++
 sysdeps/unix/sysv/linux/riscv/bits/timesize.h | 22 +++++
 .../unix/sysv/linux/riscv/bits/typesizes.h    | 84 ++++++++++++++++++
 5 files changed, 231 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/environments.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/time64.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/timesize.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/typesizes.h

diff --git a/ChangeLog b/ChangeLog
index 6daa6f259e1..4c6b86456a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1428,6 +1428,10 @@
 	* sysdeps/unix/sysv/linux/wait.c: Use __NR_waitid if avaliable.
 	* sysdeps/unix/sysv/linux/waitpid.c: Likewise.
 	* sysdeps/unix/sysv/linux/waitpid_nocancel.c: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/bits/environments.h: Use 64-bit time_t and off_t for RV32 and RV64.
+	* sysdeps/unix/sysv/linux/riscv/bits/time64.h: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/bits/timesize.h: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/bits/typesizes.h: Likewise.
 
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
diff --git a/sysdeps/unix/sysv/linux/riscv/bits/environments.h b/sysdeps/unix/sysv/linux/riscv/bits/environments.h
new file mode 100644
index 00000000000..bdbf18fca09
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/bits/environments.h
@@ -0,0 +1,85 @@
+/* Copyright (C) 1999-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _UNISTD_H
+# error "Never include this file directly.  Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+   situations.  A value `1' means that the model is always supported,
+   `-1' means it is never supported.  Undefined means it cannot be
+   statically decided.
+
+   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
+   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
+
+   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
+   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
+
+   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
+   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
+   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
+   used in previous versions of the Unix standard and are available
+   only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* We can never provide environments with 32-bit wide pointers.  */
+# define _POSIX_V7_ILP32_OFF32	-1
+# define _POSIX_V7_ILP32_OFFBIG	-1
+# define _POSIX_V6_ILP32_OFF32	-1
+# define _POSIX_V6_ILP32_OFFBIG	-1
+# define _XBS5_ILP32_OFF32	-1
+# define _XBS5_ILP32_OFFBIG	-1
+/* We also have no use (for now) for an environment with bigger pointers
+   and offsets.  */
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
+# define _POSIX_V7_LP64_OFF64	1
+# define _POSIX_V6_LP64_OFF64	1
+# define _XBS5_LP64_OFF64	1
+
+#else /* __WORDSIZE == 32 */
+
+/* RISC-V requires 64-bit off_t
+  # undef _POSIX_V7_ILP32_OFF32
+  # undef _POSIX_V6_ILP32_OFF32
+  # undef _XBS5_ILP32_OFF32
+ */
+
+# define _POSIX_V7_ILP32_OFFBIG  1
+# define _POSIX_V6_ILP32_OFFBIG  1
+# define _XBS5_ILP32_OFFBIG   1
+
+/* We can never provide environments with 64-bit wide pointers.  */
+# define _POSIX_V7_LP64_OFF64	-1
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LP64_OFF64	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LP64_OFF64	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* CFLAGS.  */
+#define __ILP32_OFFBIG_CFLAGS   "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+
+#endif /* __WORDSIZE == 32 */
diff --git a/sysdeps/unix/sysv/linux/riscv/bits/time64.h b/sysdeps/unix/sysv/linux/riscv/bits/time64.h
new file mode 100644
index 00000000000..4be26d32d47
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/bits/time64.h
@@ -0,0 +1,36 @@
+/* bits/time64.h -- underlying types for __time64_t.  Generic version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/time64.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef	_BITS_TIME64_H
+#define	_BITS_TIME64_H	1
+
+/* Define __TIME64_T_TYPE so that it is always a 64-bit type.  */
+
+#if __WORDSIZE == 64
+/* If we already have 64-bit time type then use it.  */
+# define __TIME64_T_TYPE		__TIME_T_TYPE
+#else
+/* Define a 64-bit time type alongsize the 32-bit one.  */
+# define __TIME64_T_TYPE		__SQUAD_TYPE
+#endif
+
+#endif /* bits/time64.h */
diff --git a/sysdeps/unix/sysv/linux/riscv/bits/timesize.h b/sysdeps/unix/sysv/linux/riscv/bits/timesize.h
new file mode 100644
index 00000000000..150af80f86f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/bits/timesize.h
@@ -0,0 +1,22 @@
+/* Bit size of the time_t type at glibc build time, general case.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <bits/wordsize.h>
+
+/* RV32 and RV64 both use 64-bit time_t */
+#define __TIMESIZE	64
diff --git a/sysdeps/unix/sysv/linux/riscv/bits/typesizes.h b/sysdeps/unix/sysv/linux/riscv/bits/typesizes.h
new file mode 100644
index 00000000000..bd52fd9e2a6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/bits/typesizes.h
@@ -0,0 +1,84 @@
+/* bits/typesizes.h -- underlying types for *_t.  Generic version.
+   Copyright (C) 2002-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef	_BITS_TYPESIZES_H
+#define	_BITS_TYPESIZES_H	1
+
+/* See <bits/types.h> for the meaning of these macros.  This file exists so
+   that <bits/types.h> need not vary across different GNU platforms.  */
+#define __DEV_T_TYPE    __UQUAD_TYPE
+#define __UID_T_TYPE    __U32_TYPE
+#define __GID_T_TYPE    __U32_TYPE
+#define __INO_T_TYPE    __UQUAD_TYPE
+#define __INO64_T_TYPE     __UQUAD_TYPE
+#define __MODE_T_TYPE      __U32_TYPE
+#define __NLINK_T_TYPE    __U32_TYPE
+#define __OFF_T_TYPE    __SQUAD_TYPE
+#define __OFF64_T_TYPE     __SQUAD_TYPE
+#define __PID_T_TYPE    __S32_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
+#define __FSBLKCNT_T_TYPE  __UQUAD_TYPE
+#define __FSBLKCNT64_T_TYPE   __UQUAD_TYPE
+#define __FSFILCNT_T_TYPE  __UQUAD_TYPE
+#define __FSFILCNT64_T_TYPE   __UQUAD_TYPE
+#define __FSWORD_T_TYPE   __SWORD_TYPE
+#define __ID_T_TYPE     __U32_TYPE
+#define __CLOCK_T_TYPE     __SLONGWORD_TYPE
+#define __TIME_T_TYPE      __SQUAD_TYPE
+#define __USECONDS_T_TYPE  __U32_TYPE
+#define __SUSECONDS_T_TYPE __SQUAD_TYPE
+#define __DADDR_T_TYPE     __S32_TYPE
+#define __KEY_T_TYPE    __S32_TYPE
+#define __CLOCKID_T_TYPE   __S32_TYPE
+#define __TIMER_T_TYPE     void *
+#define __BLKSIZE_T_TYPE   __S32_TYPE
+#define __FSID_T_TYPE      struct { int __val[2]; }
+#define __SSIZE_T_TYPE     __SWORD_TYPE
+#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
+#define __CPU_MASK_TYPE    __ULONGWORD_TYPE
+
+/* Tell the libc code that off_t and off64_t are actually the same type
+   for all ABI purposes, even if possibly expressed as different base types
+   for C type-checking purposes.  */
+# define __OFF_T_MATCHES_OFF64_T 1
+
+/* Same for ino_t and ino64_t.  */
+# define __INO_T_MATCHES_INO64_T 1
+
+/* And for rlim_t and rlim64_t.  */
+# define __RLIM_T_MATCHES_RLIM64_T  1
+
+/* Define these as RV32 requires 64-bit syscall. */
+#if __riscv_xlen == 32
+#define __ASSUME_TIME64_SYSCALLS 1
+#define __ASSUME_RLIM64_SYSCALLS 1
+#endif
+
+/* Number of descriptors that can fit in an `fd_set'.  */
+#define	__FD_SETSIZE		1024
+
+
+#endif /* bits/typesizes.h */
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 05/24] sysdeps/clock_gettime: Use clock_gettime64 if avaliable
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (2 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-12 19:46   ` Joseph Myers
  2019-08-10  1:03 ` [RFC v4 07/24] time: Deprecate struct timezone members Alistair Francis
                   ` (19 subsequent siblings)
  23 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 sysdeps/unix/sysv/linux/clock_gettime.c | 62 ++++++++++++++++++++++++-
 1 file changed, 61 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c
index 5fc47fb7dc7..c090797e461 100644
--- a/sysdeps/unix/sysv/linux/clock_gettime.c
+++ b/sysdeps/unix/sysv/linux/clock_gettime.c
@@ -27,10 +27,70 @@
 #include <sysdep-vdso.h>
 
 /* Get current value of CLOCK and store it in TP.  */
+
 int
 __clock_gettime (clockid_t clock_id, struct timespec *tp)
 {
-  return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp);
+
+#ifdef __ASSUME_TIME64_SYSCALLS
+   return INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp);
+#else
+   int ret;
+# ifdef __NR_clock_gettime64
+#  if __TIMESIZE == 64
+  ret = INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      return ret;
+    }
+#  else
+  struct __timespec64 tp64;
+  ret = INLINE_VSYSCALL (clock_gettime64, 2, clock_id, &tp64);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      tp->tv_sec = tp64.tv_sec;
+      tp->tv_nsec = tp64.tv_nsec;
+      if (! in_time_t_range (tp->tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      return 0;
+    }
+#  endif /* __TIMESIZE == 64 */
+# endif /* __NR_clock_gettime64 */
+# if __TIMESIZE == 64
+  struct timespec ts32;
+
+  if (! in_time_t_range (tp->tv_sec))
+    {
+      __set_errno (EOVERFLOW);
+      return -1;
+    }
+
+  ret = INLINE_VSYSCALL (clock_gettime, 2, clock_id, &ts32);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      tp->tv_sec = ts32.tv_sec;
+      tp->tv_nsec = ts32.tv_nsec;
+      if (! in_time_t_range (tp->tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      return 0;
+    }
+  return ret;
+# else
+    return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp);
+# endif /* __TIMESIZE == 64 */
+#endif /* __ASSUME_TIME64_SYSCALLS */
 }
+
 weak_alias (__clock_gettime, clock_gettime)
 libc_hidden_def (__clock_gettime)
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
  2019-08-10  1:03 ` [RFC v4 17/24] RISC-V: Hard float support for the 32 bit Alistair Francis
  2019-08-10  1:03 ` [RFC v4 01/24] sunrpc/clnt_udp: Ensure total_deadline is initalised Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-12 19:46   ` Joseph Myers
  2019-08-10  1:03 ` [RFC v4 05/24] sysdeps/clock_gettime: " Alistair Francis
                   ` (20 subsequent siblings)
  23 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 sysdeps/unix/sysv/linux/timespec_get.c | 56 +++++++++++++++++++++++++-
 1 file changed, 54 insertions(+), 2 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/timespec_get.c b/sysdeps/unix/sysv/linux/timespec_get.c
index 52080ddf08a..97ef9c5f799 100644
--- a/sysdeps/unix/sysv/linux/timespec_get.c
+++ b/sysdeps/unix/sysv/linux/timespec_get.c
@@ -24,6 +24,58 @@
 #endif
 #include <sysdep-vdso.h>
 
+int
+__timespec_get (struct timespec *ts, int base)
+{
+#ifdef __ASSUME_TIME64_SYSCALLS
+  return INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
+#else
+  long int ret;
+# ifdef __NR_clock_gettime64
+#  if __TIMESIZE == 64
+  ret = INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      return ret;
+    }
+#  else
+  struct __timespec64 ts64;
+
+  ret = INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, &ts64);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      ts->tv_sec = ts64.tv_sec;
+      ts->tv_nsec = ts64.tv_nsec;
+      return ret;
+    }
+#  endif /* __TIMESIZE == 64 */
+# endif /* __NR_clock_gettime64 */
+# if __TIMESIZE == 64
+  struct timespec ts32;
+
+  if (! in_time_t_range (ts->tv_sec))
+    {
+      __set_errno (EOVERFLOW);
+      return -1;
+    }
+
+  valid_timespec64_to_timespec (ts, &ts32);
+  ret = INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts32);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      ts->tv_sec = ts32.tv_sec;
+      ts->tv_nsec = ts32.tv_nsec;
+    }
+  return ret;
+# else
+  return INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, ts);
+# endif /* __TIMESIZE == 64 */
+#endif
+}
+
 /* Set TS to calendar time based in time base BASE.  */
 int
 timespec_get (struct timespec *ts, int base)
@@ -33,9 +85,9 @@ timespec_get (struct timespec *ts, int base)
       int res;
       INTERNAL_SYSCALL_DECL (err);
     case TIME_UTC:
-      res = INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, ts);
+      res = __timespec_get (ts, base);
       if (INTERNAL_SYSCALL_ERROR_P (res, err))
-	return 0;
+        return 0;
       break;
 
     default:
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 12/24] RISC-V: define __NR_* as __NR_*_time64/64 for 32-bit
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (9 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 08/24] sysdeps/stat: Copy the statx struct to stat instead of stat64 Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-10  1:03 ` [RFC v4 04/24] sysdeps/wait: Use waitid if avaliable Alistair Francis
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 sysdeps/unix/sysv/linux/riscv/sysdep.h | 50 +++++++++++++++++++++++++-
 1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h
index b7607ef9f17..3ef6f61aa44 100644
--- a/sysdeps/unix/sysv/linux/riscv/sysdep.h
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h
@@ -123,7 +123,55 @@
 # ifndef __NR_futex
 #  define __NR_futex __NR_futex_time64
 # endif
-#endif
+
+# ifndef __NR_rt_sigtimedwait
+#  define __NR_rt_sigtimedwait __NR_rt_sigtimedwait_time64
+# endif
+
+# ifndef __NR_ppoll
+#  define __NR_ppoll __NR_ppoll_time64
+# endif
+
+# ifndef __NR_utimensat
+#  define __NR_utimensat __NR_utimensat_time64
+# endif
+
+# ifndef __NR_pselect6
+#  define __NR_pselect6 __NR_pselect6_time64
+# endif
+
+# ifndef __NR_recvmmsg
+#  define __NR_recvmmsg __NR_recvmmsg_time64
+# endif
+
+# ifndef __NR_semtimedop
+#  define __NR_semtimedop __NR_semtimedop_time64
+# endif
+
+# ifndef __NR_mq_timedreceive
+#  define __NR_mq_timedreceive __NR_mq_timedreceive_time64
+# endif
+
+# ifndef __NR_mq_timedsend
+#  define __NR_mq_timedsend __NR_mq_timedsend_time64
+# endif
+
+# ifndef __NR_timer_gettime
+#  define __NR_timer_gettime __NR_timer_gettime64
+# endif
+
+# ifndef __NR_timer_settime
+#  define __NR_timer_settime __NR_timer_settime64
+# endif
+
+# ifndef __NR_clock_getres
+#  define __NR_clock_getres __NR_clock_getres_time64
+# endif
+
+# ifndef __NR_clock_gettime
+#  define __NR_clock_gettime __NR_clock_gettime64
+# endif
+#endif /* __riscv_xlen == 32 */
 
 #undef SYS_ify
 #define SYS_ify(syscall_name)	__NR_##syscall_name
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 01/24] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
  2019-08-10  1:03 ` [RFC v4 17/24] RISC-V: Hard float support for the 32 bit Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-10  1:03 ` [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable Alistair Francis
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

Even though total_deadline won't be accessed uninitalised GCC can still
complain that it is accessed unitalised, to avod those errors let's make
sure we initalise it to 0.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 sunrpc/clnt_udp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c
index c2436e3ebcc..311b1734733 100644
--- a/sunrpc/clnt_udp.c
+++ b/sunrpc/clnt_udp.c
@@ -290,7 +290,7 @@ clntudp_call (/* client handle */
   int anyup;			/* any network interface up */
 
   struct deadline_current_time current_time = __deadline_current_time ();
-  struct deadline total_deadline; /* Determined once by overall timeout.  */
+  struct deadline total_deadline = { 0 }; /* Determined once by overall timeout.  */
   struct deadline response_deadline; /* Determined anew for each query.  */
 
   /* Choose the timeout value.  For non-sending usage (xargs == NULL),
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 16/24] RISC-V: The ABI implementation for the 32-bit
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (4 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 07/24] time: Deprecate struct timezone members Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-10  1:03 ` [RFC v4 10/24] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64 Alistair Francis
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

From: Zong Li <zongbox@gmail.com>

This patch adds the ABI implementation about 32 bit version. It contains
the Linux-specific and RISC-V architecture code, I've collected here.

2018-11-29  Zong Li  <zong@andestech.com>

	* sysdeps/riscv/bits/wordsize.h: Supprt rv32.
	* sysdeps/riscv/nptl/bits/pthreadtypes-arch.h: Likewise.
	* sysdeps/riscv/sfp-machine.h: Likewise.
	* sysdeps/riscv/sys/asm.h: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h: New file.

[ Changes by AF:
 - Remove lock64.c
]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 ChangeLog                                     |  8 +++
 sysdeps/riscv/bits/wordsize.h                 |  4 +-
 sysdeps/riscv/nptl/bits/pthreadtypes-arch.h   | 25 ++++++++-
 sysdeps/riscv/sfp-machine.h                   | 27 +++++++++-
 sysdeps/riscv/sys/asm.h                       |  5 +-
 .../sysv/linux/riscv/rv32/jmp_buf-macros.h    | 53 +++++++++++++++++++
 6 files changed, 118 insertions(+), 4 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h

diff --git a/ChangeLog b/ChangeLog
index cc9526ee7ed..4faa11ab454 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1438,6 +1438,14 @@
 	* sysdeps/unix/sysv/linux/riscv/ldconfig.h (LD_SO_ABI): Support rv32.
 	* sysdeps/unix/sysv/linux/riscv/dl-cache.h (add_system_dir): Add
 	libraries path for rv32.
+	* sysdeps/unix/sysv/linux/riscv/ldconfig.h (LD_SO_ABI): Support rv32.
+	* sysdeps/unix/sysv/linux/riscv/dl-cache.h (add_system_dir): Add
+	libraries path for rv32.
+	* sysdeps/riscv/bits/wordsize.h: Supprt rv32.
+	* sysdeps/riscv/nptl/bits/pthreadtypes-arch.h: Likewise.
+	* sysdeps/riscv/sfp-machine.h: Likewise.
+	* sysdeps/riscv/sys/asm.h: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h: New file.
 
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
diff --git a/sysdeps/riscv/bits/wordsize.h b/sysdeps/riscv/bits/wordsize.h
index 0b8cd8fefdb..f10be0144c4 100644
--- a/sysdeps/riscv/bits/wordsize.h
+++ b/sysdeps/riscv/bits/wordsize.h
@@ -25,5 +25,7 @@
 #if __riscv_xlen == 64
 # define __WORDSIZE_TIME64_COMPAT32 1
 #else
-# error "rv32i-based targets are not supported"
+# define __WORDSIZE_TIME64_COMPAT32 0
+# define __WORDSIZE32_SIZE_ULONG    0
+# define __WORDSIZE32_PTRDIFF_LONG  0
 #endif
diff --git a/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h b/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h
index e3fecc32082..4b08f7c692b 100644
--- a/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h
+++ b/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h
@@ -32,7 +32,15 @@
 # define __SIZEOF_PTHREAD_BARRIER_T 		32
 # define __SIZEOF_PTHREAD_BARRIERATTR_T 	 4
 #else
-# error "rv32i-based systems are not supported"
+# define __SIZEOF_PTHREAD_ATTR_T 		32
+# define __SIZEOF_PTHREAD_MUTEX_T 		32
+# define __SIZEOF_PTHREAD_MUTEXATTR_T 		 4
+# define __SIZEOF_PTHREAD_COND_T 		48
+# define __SIZEOF_PTHREAD_CONDATTR_T 		 4
+# define __SIZEOF_PTHREAD_RWLOCK_T 		48
+# define __SIZEOF_PTHREAD_RWLOCKATTR_T 		 8
+# define __SIZEOF_PTHREAD_BARRIER_T 		20
+# define __SIZEOF_PTHREAD_BARRIERATTR_T 	 4
 #endif
 
 #define __PTHREAD_COMPAT_PADDING_MID
@@ -56,11 +64,26 @@ struct __pthread_rwlock_arch_t
   unsigned int __writers_futex;
   unsigned int __pad3;
   unsigned int __pad4;
+#if __riscv_xlen == 64
   int __cur_writer;
   int __shared;
   unsigned long int __pad1;
   unsigned long int __pad2;
   unsigned int __flags;
+#else
+# if __BYTE_ORDER == __BIG_ENDIAN
+  unsigned char __pad1;
+  unsigned char __pad2;
+  unsigned char __shared;
+  unsigned char __flags;
+# else
+  unsigned char __flags;
+  unsigned char __shared;
+  unsigned char __pad1;
+  unsigned char __pad2;
+# endif
+  int __cur_writer;
+#endif
 };
 
 #define __PTHREAD_RWLOCK_ELISION_EXTRA 		0
diff --git a/sysdeps/riscv/sfp-machine.h b/sysdeps/riscv/sfp-machine.h
index fa0b8fa41a1..98e1f84370d 100644
--- a/sysdeps/riscv/sfp-machine.h
+++ b/sysdeps/riscv/sfp-machine.h
@@ -22,7 +22,32 @@
 
 #if __riscv_xlen == 32
 
-# error "rv32i-based targets are not supported"
+# define _FP_W_TYPE_SIZE		32
+# define _FP_W_TYPE		unsigned long
+# define _FP_WS_TYPE		signed long
+# define _FP_I_TYPE		long
+
+# define _FP_MUL_MEAT_S(R, X, Y)				\
+  _FP_MUL_MEAT_1_wide (_FP_WFRACBITS_S, R, X, Y, umul_ppmm)
+# define _FP_MUL_MEAT_D(R, X, Y)				\
+  _FP_MUL_MEAT_2_wide (_FP_WFRACBITS_D, R, X, Y, umul_ppmm)
+# define _FP_MUL_MEAT_Q(R, X, Y)				\
+  _FP_MUL_MEAT_4_wide (_FP_WFRACBITS_Q, R, X, Y, umul_ppmm)
+
+# define _FP_MUL_MEAT_DW_S(R, X, Y)					\
+  _FP_MUL_MEAT_DW_1_wide (_FP_WFRACBITS_S, R, X, Y, umul_ppmm)
+# define _FP_MUL_MEAT_DW_D(R, X, Y)					\
+  _FP_MUL_MEAT_DW_2_wide (_FP_WFRACBITS_D, R, X, Y, umul_ppmm)
+# define _FP_MUL_MEAT_DW_Q(R, X, Y)					\
+  _FP_MUL_MEAT_DW_4_wide (_FP_WFRACBITS_Q, R, X, Y, umul_ppmm)
+
+# define _FP_DIV_MEAT_S(R, X, Y)	_FP_DIV_MEAT_1_udiv_norm (S, R, X, Y)
+# define _FP_DIV_MEAT_D(R, X, Y)	_FP_DIV_MEAT_2_udiv (D, R, X, Y)
+# define _FP_DIV_MEAT_Q(R, X, Y)	_FP_DIV_MEAT_4_udiv (Q, R, X, Y)
+
+# define _FP_NANFRAC_S		_FP_QNANBIT_S
+# define _FP_NANFRAC_D		_FP_QNANBIT_D, 0
+# define _FP_NANFRAC_Q		_FP_QNANBIT_Q, 0, 0, 0
 
 #else
 
diff --git a/sysdeps/riscv/sys/asm.h b/sysdeps/riscv/sys/asm.h
index b8f90a44cea..7ea34afd6d1 100644
--- a/sysdeps/riscv/sys/asm.h
+++ b/sysdeps/riscv/sys/asm.h
@@ -26,7 +26,10 @@
 # define REG_S sd
 # define REG_L ld
 #elif __riscv_xlen == 32
-# error "rv32i-based targets are not supported"
+# define PTRLOG 2
+# define SZREG	4
+# define REG_S sw
+# define REG_L lw
 #else
 # error __riscv_xlen must equal 32 or 64
 #endif
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h
new file mode 100644
index 00000000000..e0042b9f01b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h
@@ -0,0 +1,53 @@
+/* jump buffer constants for RISC-V
+   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Produced by this program:
+
+   #include <stdio.h>
+   #include <unistd.h>
+   #include <setjmp.h>
+   #include <stddef.h>
+
+   int main (int argc, char **argv)
+   {
+       printf ("#define JMP_BUF_SIZE %d\n", sizeof (jmp_buf));
+       printf ("#define JMP_BUF_ALIGN %d\n", __alignof__ (jmp_buf));
+       printf ("#define SIGJMP_BUF_SIZE %d\n", sizeof (sigjmp_buf));
+       printf ("#define SIGJMP_BUF_ALIGN %d\n", __alignof__ (sigjmp_buf));
+       printf ("#define MASK_WAS_SAVED_OFFSET %d\n", offsetof (struct __jmp_buf_tag, __mask_was_saved));
+       printf ("#define SAVED_MASK_OFFSET %d\n", offsetof (struct __jmp_buf_tag, __saved_mask));
+   } */
+
+#if defined __riscv_float_abi_soft
+# define JMP_BUF_SIZE 188
+# define JMP_BUF_ALIGN 4
+# define SIGJMP_BUF_SIZE 188
+# define SIGJMP_BUF_ALIGN 4
+# define MASK_WAS_SAVED_OFFSET 56
+# define SAVED_MASK_OFFSET 60
+#elif defined __riscv_float_abi_double
+# define JMP_BUF_SIZE 288
+# define JMP_BUF_ALIGN 8
+# define SIGJMP_BUF_SIZE 288
+# define SIGJMP_BUF_ALIGN 8
+# define MASK_WAS_SAVED_OFFSET 152
+# define SAVED_MASK_OFFSET 156
+#else
+# error "Unknown RISC-V floating-point ABI"
+#endif
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 03/24] sysdeps/gettimeofday: Use clock_gettime64 if avaliable
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (6 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 10/24] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64 Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-12 17:27   ` Joseph Myers
  2019-08-10  1:03 ` [RFC v4 13/24] RISC-V: Use 64-bit timespec in clock_gettime vdso calls Alistair Francis
                   ` (15 subsequent siblings)
  23 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

Not all architectures support the obsolete gettimeofday so use the
newer clock_gettime64 syscall if it is avaliable. This fixes RV32
build issues.

This has the side effect of not setting the struct timezone *tz variable
if __ASSUME_TIME64_SYSCALLS or __NR_clock_gettime64 is defined!!!

The struct timezone *tz variable contaions information on the current
timezone, in this structure:
    struct timezone {
        int tz_minuteswest;     /* minutes west of Greenwich */
        int tz_dsttime;         /* type of DST correction */
    };

On 32-bit systems with __ARCH_WANT_TIME32_SYSCALLS not defined there is
no way way to get the struct timezone via a syscall. AFAIK there are no
plans to add suppor to a future kernel.

The Linux documentation says that "The use of the timezone structure
is obsolete; the tz argument should normally be specified as NULL."

Most callers of gettimeofday() don't use the timezone data, see
example code from Debian below.

If __ASSUME_TIME64_SYSCALLS and __NR_clock_gettime64 are not defined
then struct timezone *tz will be set as usual.

Example code from Debian:
struct timeval my_gettime(void)
{
     struct timezone tz_ignored;
     struct timeval tv;
     gettimeofday(&tv, &tz_ignored);
     return tv;
}

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 ChangeLog                              |  1 +
 sysdeps/unix/sysv/linux/gettimeofday.c | 51 ++++++++++++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index aab4469b3d4..82a2cdc746d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1424,6 +1424,7 @@
 	* nptl/thrd_sleep.c: Use clock_nanosleep_time64 instead of nanosleep.
 	* sysdeps/unix/sysv/linux/nanosleep.c: Likewise.
 	* sysdeps/unix/sysv/linux/nanosleep_nocancel.c: Likewise.
+	* sysdeps/unix/sysv/linux/gettimeofday.c: Use clock_gettime64 syscall for gettimeofday.
 
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
diff --git a/sysdeps/unix/sysv/linux/gettimeofday.c b/sysdeps/unix/sysv/linux/gettimeofday.c
index a74f03825a5..bfbe7216198 100644
--- a/sysdeps/unix/sysv/linux/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/gettimeofday.c
@@ -32,7 +32,58 @@
 int
 __gettimeofday (struct timeval *tv, struct timezone *tz)
 {
+#ifdef __ASSUME_TIME64_SYSCALLS
+  long int ret;
+  struct timespec now;
+
+  ret = INLINE_VSYSCALL (clock_gettime64, 2, CLOCK_REALTIME,
+                         &now);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      /* Convert from timespec to timeval */
+      tv->tv_sec = now.tv_sec;
+      tv->tv_usec = now.tv_nsec / 1000;
+    }
+  return ret;
+#else
+# ifdef __NR_clock_nanosleep_time64
+  long int ret;
+#  if __TIMESIZE == 64
+  ret = INLINE_VSYSCALL (clock_gettime64, 2, CLOCK_REALTIME,
+                         &now);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      /* Convert from timespec to timeval */
+      tv->tv_sec = now.tv_sec;
+      tv->tv_usec = now.tv_nsec / 1000;
+      return ret;
+    }
+#  else
+  struct __timespec64 now;
+
+  ret = INLINE_VSYSCALL (clock_gettime64, 2, CLOCK_REALTIME,
+                         &now);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      /* Convert from timespec to timeval */
+      tv->tv_sec = now.tv_sec;
+      tv->tv_usec = now.tv_nsec / 1000;
+      return ret;
+    }
+#  endif /* __TIMESIZE == 64 */
+# endif /* __NR_clock_nanosleep_time64 */
+# if __TIMESIZE == 64
+  if (! in_time_t_range (tv->tv_sec))
+    {
+      __set_errno (EOVERFLOW);
+      return -1;
+    }
+# endif /* __TIMESIZE == 64 */
   return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
+#endif
 }
 libc_hidden_def (__gettimeofday)
 weak_alias (__gettimeofday, gettimeofday)
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 08/24] sysdeps/stat: Copy the statx struct to stat instead of stat64
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (8 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 13/24] RISC-V: Use 64-bit timespec in clock_gettime vdso calls Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-12 20:01   ` Joseph Myers
  2019-08-10  1:03 ` [RFC v4 12/24] RISC-V: define __NR_* as __NR_*_time64/64 for 32-bit Alistair Francis
                   ` (13 subsequent siblings)
  23 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

When copying the statx struct to the stat stuct use the original stat
struct instead of the stat64 struct. As the padding in the original is
type 'unsigned short int' but the padding in the stat64 is 'unsigned int'
the copy  can result in misallgined data. This would then incorrectly
trigger the stat_overflow() failure.

This would be very obvious when using a 64-bit ino_t type on a 32-bit
system, such as the RV32 port.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 .../sysv/linux/generic/wordsize-32/fxstat.c   |  2 +-
 .../sysv/linux/generic/wordsize-32/fxstatat.c |  2 +-
 .../sysv/linux/generic/wordsize-32/lxstat.c   |  2 +-
 .../sysv/linux/generic/wordsize-32/xstat.c    |  2 +-
 sysdeps/unix/sysv/linux/statx_cp.c            | 24 +++++++++++++++++++
 sysdeps/unix/sysv/linux/statx_cp.h            |  3 +++
 6 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c
index 81e137c585b..234098b5199 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c
@@ -43,7 +43,7 @@ __fxstat (int vers, int fd, struct stat *buf)
       int rc = INLINE_SYSCALL (statx, 5, fd, "", AT_EMPTY_PATH,
                                STATX_BASIC_STATS, &tmp);
       if (rc == 0)
-        __cp_stat64_statx ((struct stat64 *)buf, &tmp);
+        __cp_stat_statx (buf, &tmp);
 # endif
       return rc ?: stat_overflow (buf);
     }
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c
index e203260485c..bd3bfc101cd 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c
@@ -44,7 +44,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *buf, int flag)
                                AT_NO_AUTOMOUNT | flag,
                                STATX_BASIC_STATS, &tmp);
       if (rc == 0)
-        __cp_stat64_statx ((struct stat64 *)buf, &tmp);
+        __cp_stat_statx (buf, &tmp);
 # endif
       return rc ?: stat_overflow (buf);
     }
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c
index 2d4dfbaf527..01edf9f22cc 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c
@@ -44,7 +44,7 @@ __lxstat (int vers, const char *name, struct stat *buf)
                                AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW,
                                STATX_BASIC_STATS, &tmp);
       if (rc == 0)
-        __cp_stat64_statx ((struct stat64 *)buf, &tmp);
+        __cp_stat_statx (buf, &tmp);
 #endif
       return rc ?: stat_overflow (buf);
     }
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c
index 5f1f53c0f3f..dea6ec525e9 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c
@@ -42,7 +42,7 @@ __xstat (int vers, const char *name, struct stat *buf)
       int rc = INLINE_SYSCALL (statx, 5, AT_FDCWD, name, AT_NO_AUTOMOUNT,
                                STATX_BASIC_STATS, &tmp);
       if (rc == 0)
-        __cp_stat64_statx ((struct stat64 *)buf, &tmp);
+        __cp_stat_statx (buf, &tmp);
 # endif
       return rc ?: stat_overflow (buf);
     }
diff --git a/sysdeps/unix/sysv/linux/statx_cp.c b/sysdeps/unix/sysv/linux/statx_cp.c
index 3b4e5583e9a..2574d05563c 100644
--- a/sysdeps/unix/sysv/linux/statx_cp.c
+++ b/sysdeps/unix/sysv/linux/statx_cp.c
@@ -46,4 +46,28 @@ __cp_stat64_statx (struct stat64 *to, struct statx *from)
   to->st_blocks = from->stx_blocks;
   to->st_blksize = from->stx_blksize;
 }
+
+void
+__cp_stat_statx (struct stat *to, struct statx *from)
+{
+  memset (to, 0, sizeof (struct stat64));
+  to->st_dev = ((from->stx_dev_minor & 0xff) | (from->stx_dev_major << 8)
+    | ((from->stx_dev_minor & ~0xff) << 12));
+  to->st_rdev = ((from->stx_rdev_minor & 0xff) | (from->stx_rdev_major << 8)
+     | ((from->stx_rdev_minor & ~0xff) << 12));
+  to->st_ino = from->stx_ino;
+  to->st_mode = from->stx_mode;
+  to->st_nlink = from->stx_nlink;
+  to->st_uid = from->stx_uid;
+  to->st_gid = from->stx_gid;
+  to->st_atime = from->stx_atime.tv_sec;
+  to->st_atim.tv_nsec = from->stx_atime.tv_nsec;
+  to->st_mtime = from->stx_mtime.tv_sec;
+  to->st_mtim.tv_nsec = from->stx_mtime.tv_nsec;
+  to->st_ctime = from->stx_ctime.tv_sec;
+  to->st_ctim.tv_nsec = from->stx_ctime.tv_nsec;
+  to->st_size = from->stx_size;
+  to->st_blocks = from->stx_blocks;
+  to->st_blksize = from->stx_blksize;
+}
 #endif
diff --git a/sysdeps/unix/sysv/linux/statx_cp.h b/sysdeps/unix/sysv/linux/statx_cp.h
index f08a7a8dcc8..2bb1d0605fd 100644
--- a/sysdeps/unix/sysv/linux/statx_cp.h
+++ b/sysdeps/unix/sysv/linux/statx_cp.h
@@ -18,3 +18,6 @@
 
 extern void __cp_stat64_statx (struct stat64 *to, struct statx *from)
   attribute_hidden;
+
+extern void __cp_stat_statx (struct stat *to, struct statx *from)
+  attribute_hidden;
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (3 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 05/24] sysdeps/clock_gettime: " Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-10  1:20   ` Paul Eggert
  2019-08-12 15:42   ` Zack Weinberg
  2019-08-10  1:03 ` [RFC v4 16/24] RISC-V: The ABI implementation for the 32-bit Alistair Francis
                   ` (18 subsequent siblings)
  23 siblings, 2 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

Append the struct timezone members with '_dep'. This indicates that
these members are deprecated and will cause build failures on code that
is currently using the members.

The struct timezone *tz variable contaions information on the current
timezone, in this structure:
    struct timezone {
        int tz_minuteswest;     /* minutes west of Greenwich */
        int tz_dsttime;         /* type of DST correction */
    };

The members are being renamed to create compilation failures for anyone
who is using them. This is being done for the following reasons.

On 32-bit systems with __ARCH_WANT_TIME32_SYSCALLS not defined there is
no way way to get the struct timezone via a syscall. AFAIK there are no
plans to add suppor to a future kernel.

The Linux documentation says that "The use of the timezone structure
is obsolete; the tz argument should normally be specified as NULL."

Most callers of gettimeofday() don't use the timezone data, see
example code from Debian below.

If __ASSUME_TIME64_SYSCALLS and __NR_clock_gettime64 are not defined
then struct timezone *tz will be set as usual.

Example code from Debian:
struct timeval my_gettime(void)
{
     struct timezone tz_ignored;
     struct timeval tv;
     gettimeofday(&tv, &tz_ignored);
     return tv;
}

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 sysdeps/unix/bsd/ftime.c | 4 ++--
 time/sys/time.h          | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sysdeps/unix/bsd/ftime.c b/sysdeps/unix/bsd/ftime.c
index 3a1c6e9b01c..bc4dfdab945 100644
--- a/sysdeps/unix/bsd/ftime.c
+++ b/sysdeps/unix/bsd/ftime.c
@@ -34,7 +34,7 @@ ftime (struct timeb *timebuf)
       ++timebuf->time;
       timebuf->millitm = 0;
     }
-  timebuf->timezone = tz.tz_minuteswest;
-  timebuf->dstflag = tz.tz_dsttime;
+  timebuf->timezone = tz.tz_minuteswest_dep;
+  timebuf->dstflag = tz.tz_dsttime_dep;
   return 0;
 }
diff --git a/time/sys/time.h b/time/sys/time.h
index 5dbc7fc627f..a35ccb7a58b 100644
--- a/time/sys/time.h
+++ b/time/sys/time.h
@@ -51,8 +51,8 @@ __BEGIN_DECLS
    This is obsolete and should never be used.  */
 struct timezone
   {
-    int tz_minuteswest;		/* Minutes west of GMT.  */
-    int tz_dsttime;		/* Nonzero if DST is ever in effect.  */
+    int tz_minuteswest_dep;		/* Minutes west of GMT.  */
+    int tz_dsttime_dep;		/* Nonzero if DST is ever in effect.  */
   };
 
 typedef struct timezone *__restrict __timezone_ptr_t;
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 17/24] RISC-V: Hard float support for the 32 bit
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-10  1:03 ` [RFC v4 01/24] sunrpc/clnt_udp: Ensure total_deadline is initalised Alistair Francis
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

From: Zong Li <zongbox@gmail.com>

This patch contains hardware floating-point support for the RV32IF and
RV32IFD

2018-11-29  Zong Li  <zong@andestech.com>

	* sysdeps/riscv/rv32/rvd/s_lrint.c: New file.
	* sysdeps/riscv/rv32/rvd/s_lround.c: Likewise.
	* sysdeps/riscv/rv32/rvf/s_lrintf.c: Likewise.
	* sysdeps/riscv/rv32/rvf/s_lroundf.c: Likewise.
---
 ChangeLog                          |  4 ++++
 sysdeps/riscv/rv32/rvd/s_lrint.c   | 31 ++++++++++++++++++++++++++++++
 sysdeps/riscv/rv32/rvd/s_lround.c  | 31 ++++++++++++++++++++++++++++++
 sysdeps/riscv/rv32/rvf/s_lrintf.c  | 31 ++++++++++++++++++++++++++++++
 sysdeps/riscv/rv32/rvf/s_lroundf.c | 31 ++++++++++++++++++++++++++++++
 5 files changed, 128 insertions(+)
 create mode 100644 sysdeps/riscv/rv32/rvd/s_lrint.c
 create mode 100644 sysdeps/riscv/rv32/rvd/s_lround.c
 create mode 100644 sysdeps/riscv/rv32/rvf/s_lrintf.c
 create mode 100644 sysdeps/riscv/rv32/rvf/s_lroundf.c

diff --git a/ChangeLog b/ChangeLog
index 4faa11ab454..4c926088ba3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1446,6 +1446,10 @@
 	* sysdeps/riscv/sfp-machine.h: Likewise.
 	* sysdeps/riscv/sys/asm.h: Likewise.
 	* sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h: New file.
+	* sysdeps/riscv/rv32/rvd/s_lrint.c: New file.
+	* sysdeps/riscv/rv32/rvd/s_lround.c: Likewise.
+	* sysdeps/riscv/rv32/rvf/s_lrintf.c: Likewise.
+	* sysdeps/riscv/rv32/rvf/s_lroundf.c: Likewise.
 
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
diff --git a/sysdeps/riscv/rv32/rvd/s_lrint.c b/sysdeps/riscv/rv32/rvd/s_lrint.c
new file mode 100644
index 00000000000..4d5bdbc200e
--- /dev/null
+++ b/sysdeps/riscv/rv32/rvd/s_lrint.c
@@ -0,0 +1,31 @@
+/* lrint().  RISC-V version.
+   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <libm-alias-double.h>
+#include <stdint.h>
+
+long int
+__lrint (double x)
+{
+  int32_t res;
+  asm ("fcvt.w.d %0, %1" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_double (__lrint, lrint)
diff --git a/sysdeps/riscv/rv32/rvd/s_lround.c b/sysdeps/riscv/rv32/rvd/s_lround.c
new file mode 100644
index 00000000000..f5d9cf2e070
--- /dev/null
+++ b/sysdeps/riscv/rv32/rvd/s_lround.c
@@ -0,0 +1,31 @@
+/* lround().  RISC-V version.
+   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <libm-alias-double.h>
+#include <stdint.h>
+
+long int
+__lround (double x)
+{
+  int32_t res;
+  asm ("fcvt.w.d %0, %1, rmm" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_double (__lround, lround)
diff --git a/sysdeps/riscv/rv32/rvf/s_lrintf.c b/sysdeps/riscv/rv32/rvf/s_lrintf.c
new file mode 100644
index 00000000000..08d44fa7385
--- /dev/null
+++ b/sysdeps/riscv/rv32/rvf/s_lrintf.c
@@ -0,0 +1,31 @@
+/* lrintf().  RISC-V version.
+   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <libm-alias-float.h>
+#include <stdint.h>
+
+long int
+__lrintf (float x)
+{
+  int32_t res;
+  asm ("fcvt.w.s %0, %1" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/riscv/rv32/rvf/s_lroundf.c b/sysdeps/riscv/rv32/rvf/s_lroundf.c
new file mode 100644
index 00000000000..f31b4329362
--- /dev/null
+++ b/sysdeps/riscv/rv32/rvf/s_lroundf.c
@@ -0,0 +1,31 @@
+/* lroundf().  RISC-V version.
+   Copyright (C) 2017-2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <libm-alias-float.h>
+#include <stdint.h>
+
+long int
+__lroundf (float x)
+{
+  int32_t res;
+  asm ("fcvt.w.s %0, %1, rmm" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_float (__lround, lround)
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 15/24] RISC-V: Add path of library directories for RV32
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (11 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 04/24] sysdeps/wait: Use waitid if avaliable Alistair Francis
@ 2019-08-10  1:03 ` Alistair Francis
  2019-08-10  1:03 ` [RFC v4 02/24] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable Alistair Francis
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:03 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

From: Zong Li <zongbox@gmail.com>

For the recommand of 64 bit version, we add the libraries path of 32 bit
in this patch. This includes a fix to avoid an out of bound array check
when building with GCC 8.2.

2018-11-29  Zong Li  <zong@andestech.com>

	* sysdeps/unix/sysv/linux/riscv/dl-cache.h (add_system_dir): Add
	libraries path for rv32.

[ Changes by AF:
 - Fix bound array check when building with GCC 8.2
]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 ChangeLog                                |  2 ++
 sysdeps/unix/sysv/linux/riscv/dl-cache.h | 17 +++++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c3ddcfaf9d7..cc9526ee7ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1436,6 +1436,8 @@
 2018-06-20  Zong Li  <zong@andestech.com>
 
 	* sysdeps/unix/sysv/linux/riscv/ldconfig.h (LD_SO_ABI): Support rv32.
+	* sysdeps/unix/sysv/linux/riscv/dl-cache.h (add_system_dir): Add
+	libraries path for rv32.
 
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
diff --git a/sysdeps/unix/sysv/linux/riscv/dl-cache.h b/sysdeps/unix/sysv/linux/riscv/dl-cache.h
index 2a15e28e3bd..5943060536d 100644
--- a/sysdeps/unix/sysv/linux/riscv/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/riscv/dl-cache.h
@@ -34,6 +34,8 @@
    RISC-V, libraries can be found in paths ending in:
      - /lib64/lp64d
      - /lib64/lp64
+     - /lib32/ilp32d
+     - /lib32/ilp32
      - /lib (only ld.so)
    so this will add all of those paths.
 
@@ -49,9 +51,16 @@
   do							    		\
     {									\
       size_t len = strlen (dir);					\
-      char path[len + 9];						\
+      char path[len + 10];						\
       memcpy (path, dir, len + 1);					\
-      if (len >= 12 && ! memcmp(path + len - 12, "/lib64/lp64d", 12))	\
+      if (len >= 13 && ! memcmp(path + len - 13, "/lib32/ilp32d", 13))	\
+        {								\
+          len -= 9;							\
+	  path[len] = '\0';						\
+        }								\
+      if (len >= 12							\
+          && (! memcmp(path + len - 12, "/lib32/ilp32", 12)		\
+              || ! memcmp(path + len - 12, "/lib64/lp64d", 12)))	\
 	{								\
 	  len -= 8;							\
 	  path[len] = '\0';						\
@@ -64,6 +73,10 @@
       add_dir (path);							\
       if (len >= 4 && ! memcmp(path + len - 4, "/lib", 4))		\
 	{								\
+	  memcpy (path + len, "32/ilp32d", 10);				\
+	  add_dir (path);						\
+	  memcpy (path + len, "32/ilp32", 9);				\
+	  add_dir (path);						\
 	  memcpy (path + len, "64/lp64d", 9);				\
 	  add_dir (path);						\
 	  memcpy (path + len, "64/lp64", 8);				\
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 20/24] RISC-V: Fix llrint and llround missing exceptions on RV32
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (19 preceding siblings ...)
  2019-08-10  1:04 ` [RFC v4 22/24] RISC-V: Use 64-bit vdso syscalls for RV32 Alistair Francis
@ 2019-08-10  1:04 ` Alistair Francis
  2019-08-10  1:04 ` [RFC v4 11/24] RISC-V: define __NR_futex as __NR_futex_time64 for 32-bit Alistair Francis
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:04 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

From: Zong Li <zongbox@gmail.com>

Similar to the recent fix for MIPS, ARM and S/390, RV32 is missing
correct exception on overflow from llrint and llround functions because
cast from floating-point types to long long do not result in correct
exceptions on overflow.

2018-11-29  Zong Li  <zong@andestech.com>

	* sysdeps/riscv/rv32/fix-fp-int-convert-overflow.h: New file.
---
 ChangeLog                                     | 10 +++++
 .../riscv/rv32/fix-fp-int-convert-overflow.h  | 38 +++++++++++++++++++
 2 files changed, 48 insertions(+)
 create mode 100644 sysdeps/riscv/rv32/fix-fp-int-convert-overflow.h

diff --git a/ChangeLog b/ChangeLog
index a0399acdcbc..3316d22efaf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1491,6 +1491,16 @@
 	* sysdeps/unix/sysv/linux/riscv/configure.ac: Likewise.
 	* sysdeps/unix/sysv/linux/riscv/shlib-versions: Likewise.
 	* sysdeps/riscv/preconfigure: Likewise.
+	* sysdeps/riscv/rv32/Implies-after: New file.
+	* sysdeps/riscv/rv32/rvd/Implies: Likewise.
+	* sysdeps/riscv/rv32/rvf/Implies: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/Implies: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/Makefile: Support rv32.
+	* sysdeps/unix/sysv/linux/riscv/configure: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/configure.ac: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/shlib-versions: Likewise.
+	* sysdeps/riscv/preconfigure: Likewise.
+	* sysdeps/riscv/rv32/fix-fp-int-convert-overflow.h: New file.
 
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
diff --git a/sysdeps/riscv/rv32/fix-fp-int-convert-overflow.h b/sysdeps/riscv/rv32/fix-fp-int-convert-overflow.h
new file mode 100644
index 00000000000..42155048382
--- /dev/null
+++ b/sysdeps/riscv/rv32/fix-fp-int-convert-overflow.h
@@ -0,0 +1,38 @@
+/* Fix for conversion of floating point to integer overflow.  ARM version.
+   Copyright (C) 2015-2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef FIX_FP_INT_CONVERT_OVERFLOW_H
+#define FIX_FP_INT_CONVERT_OVERFLOW_H	1
+
+/* The generic libgcc2.c conversions from floating point
+   to long long may not raise the correct exceptions on overflow (and
+   may raise spurious "inexact" exceptions even in non-overflow cases,
+   see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59412>).  */
+#define FIX_FLT_LONG_CONVERT_OVERFLOW 0
+#define FIX_FLT_LLONG_CONVERT_OVERFLOW 1
+
+#define FIX_DBL_LONG_CONVERT_OVERFLOW 0
+#define FIX_DBL_LLONG_CONVERT_OVERFLOW 1
+
+#define FIX_LDBL_LONG_CONVERT_OVERFLOW 0
+#define FIX_LDBL_LLONG_CONVERT_OVERFLOW 0
+
+#define FIX_FLT128_LONG_CONVERT_OVERFLOW 0
+#define FIX_FLT128_LLONG_CONVERT_OVERFLOW 0
+
+#endif /* fix-fp-int-convert-overflow.h */
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 19/24] RISC-V: Build Infastructure for the 32-bit
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (17 preceding siblings ...)
  2019-08-10  1:04 ` [RFC v4 23/24] WIP: syscall.list: Call 64-bit versions of syscalls Alistair Francis
@ 2019-08-10  1:04 ` Alistair Francis
  2019-08-10  1:04 ` [RFC v4 22/24] RISC-V: Use 64-bit vdso syscalls for RV32 Alistair Francis
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:04 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

From: Zong Li <zongbox@gmail.com>

This patch lays out the top-level orginazition of the RISC-V 32-bit port. It
contains all the Implies files as well as various other fragments of
build infastructure for the RISC-V 32-bit port.

2018-11-29  Zong Li  <zong@andestech.com>

	* sysdeps/riscv/rv32/Implies-after: New file.
	* sysdeps/riscv/rv32/rvd/Implies: Likewise.
	* sysdeps/riscv/rv32/rvf/Implies: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/Implies: Likewise.
	* sysdeps/unix/sysv/linux/riscv/Makefile: Support rv32.
	* sysdeps/unix/sysv/linux/riscv/configure: Likewise.
	* sysdeps/unix/sysv/linux/riscv/configure.ac: Likewise.
	* sysdeps/unix/sysv/linux/riscv/shlib-versions: Likewise.
	* sysdeps/riscv/preconfigure: Likewise.
---
 ChangeLog                                    |  9 +++++
 sysdeps/riscv/preconfigure                   |  6 +--
 sysdeps/riscv/rv32/Implies-after             |  1 +
 sysdeps/riscv/rv32/rvd/Implies               |  3 ++
 sysdeps/riscv/rv32/rvf/Implies               |  1 +
 sysdeps/unix/sysv/linux/riscv/Makefile       |  4 +-
 sysdeps/unix/sysv/linux/riscv/configure      | 39 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/riscv/configure.ac   |  8 ++++
 sysdeps/unix/sysv/linux/riscv/rv32/Implies   |  3 ++
 sysdeps/unix/sysv/linux/riscv/shlib-versions | 10 ++++-
 10 files changed, 76 insertions(+), 8 deletions(-)
 create mode 100644 sysdeps/riscv/rv32/Implies-after
 create mode 100644 sysdeps/riscv/rv32/rvd/Implies
 create mode 100644 sysdeps/riscv/rv32/rvf/Implies
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/Implies

diff --git a/ChangeLog b/ChangeLog
index 6896401d0e9..a0399acdcbc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1482,6 +1482,15 @@
 	* sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist: Likewise.
 	* sysdeps/unix/sysv/linux/riscv/rv32/libBrokenLocale.abilist:
 	Likewise.
+	* sysdeps/riscv/rv32/Implies-after: New file.
+	* sysdeps/riscv/rv32/rvd/Implies: Likewise.
+	* sysdeps/riscv/rv32/rvf/Implies: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/Implies: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/Makefile: Support rv32.
+	* sysdeps/unix/sysv/linux/riscv/configure: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/configure.ac: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/shlib-versions: Likewise.
+	* sysdeps/riscv/preconfigure: Likewise.
 
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
diff --git a/sysdeps/riscv/preconfigure b/sysdeps/riscv/preconfigure
index d9adb31b649..1ab5d20f0ec 100644
--- a/sysdeps/riscv/preconfigure
+++ b/sysdeps/riscv/preconfigure
@@ -6,11 +6,7 @@ riscv*)
     atomic=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep '#define __riscv_atomic' | cut -d' ' -f2`
 
     case "$xlen" in
-    32)
-	echo "glibc does not yet support 32-bit systems" >&2
-	exit 1
-	;;
-    64)
+    64 | 32)
 	;;
     *)
 	echo "Unable to determine XLEN" >&2
diff --git a/sysdeps/riscv/rv32/Implies-after b/sysdeps/riscv/rv32/Implies-after
new file mode 100644
index 00000000000..39a34c5f574
--- /dev/null
+++ b/sysdeps/riscv/rv32/Implies-after
@@ -0,0 +1 @@
+wordsize-32
diff --git a/sysdeps/riscv/rv32/rvd/Implies b/sysdeps/riscv/rv32/rvd/Implies
new file mode 100644
index 00000000000..1151214e8f4
--- /dev/null
+++ b/sysdeps/riscv/rv32/rvd/Implies
@@ -0,0 +1,3 @@
+riscv/rv32/rvf
+riscv/rvd
+riscv/rvf
diff --git a/sysdeps/riscv/rv32/rvf/Implies b/sysdeps/riscv/rv32/rvf/Implies
new file mode 100644
index 00000000000..66c401443b8
--- /dev/null
+++ b/sysdeps/riscv/rv32/rvf/Implies
@@ -0,0 +1 @@
+riscv/rvf
diff --git a/sysdeps/unix/sysv/linux/riscv/Makefile b/sysdeps/unix/sysv/linux/riscv/Makefile
index b47858769f5..bf9c24ad77d 100644
--- a/sysdeps/unix/sysv/linux/riscv/Makefile
+++ b/sysdeps/unix/sysv/linux/riscv/Makefile
@@ -15,11 +15,13 @@ ifeq ($(subdir),stdlib)
 gen-as-const-headers += ucontext_i.sym
 endif
 
-abi-variants := lp64 lp64d
+abi-variants := ilp32 ilp32d lp64 lp64d
 
 ifeq (,$(filter $(default-abi),$(abi-variants)))
 $(error Unknown ABI $(default-abi), must be one of $(abi-variants))
 endif
 
+abi-ilp32-condition   := !defined __LP64__ && defined __riscv_float_abi_soft
+abi-ilp32d-condition  := !defined __LP64__ && defined __riscv_float_abi_double
 abi-lp64-condition    := defined __LP64__ && defined __riscv_float_abi_soft
 abi-lp64d-condition   := defined __LP64__ && defined __riscv_float_abi_double
diff --git a/sysdeps/unix/sysv/linux/riscv/configure b/sysdeps/unix/sysv/linux/riscv/configure
index 3018ca8f1b8..2b3c77f18cb 100755
--- a/sysdeps/unix/sysv/linux/riscv/configure
+++ b/sysdeps/unix/sysv/linux/riscv/configure
@@ -147,6 +147,17 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 fi
 rm -f conftest*
 
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+__SIZEOF_INT__ __SIZEOF_LONG__ __SIZEOF_POINTER__
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "4 4 4" >/dev/null 2>&1; then :
+  libc_cv_riscv_int_abi=ilp32
+fi
+rm -f conftest*
+
 if test $libc_cv_riscv_int_abi = no; then
   as_fn_error $? "Unable to determine integer ABI" "$LINENO" 5
 fi
@@ -214,6 +225,34 @@ case "$prefix" in
   ;;
 esac
   ;;
+ilp32-riscv/rv32/*)
+  test -n "$libc_cv_slibdir" ||
+case "$prefix" in
+/usr | /usr/)
+  libc_cv_slibdir='/lib32/ilp32'
+  libc_cv_rtlddir='/lib'
+  if test "$libdir" = '${exec_prefix}/lib'; then
+    libdir='${exec_prefix}/lib32/ilp32';
+    # Locale data can be shared between 32-bit and 64-bit libraries.
+    libc_cv_complocaledir='${exec_prefix}/lib/locale'
+  fi
+  ;;
+esac
+  ;;
+ilp32d-riscv/rv32/*)
+  test -n "$libc_cv_slibdir" ||
+case "$prefix" in
+/usr | /usr/)
+  libc_cv_slibdir='/lib32/ilp32d'
+  libc_cv_rtlddir='/lib'
+  if test "$libdir" = '${exec_prefix}/lib'; then
+    libdir='${exec_prefix}/lib32/ilp32d';
+    # Locale data can be shared between 32-bit and 64-bit libraries.
+    libc_cv_complocaledir='${exec_prefix}/lib/locale'
+  fi
+  ;;
+esac
+  ;;
 esac
 
 ldd_rewrite_script=sysdeps/unix/sysv/linux/riscv/ldd-rewrite.sed
diff --git a/sysdeps/unix/sysv/linux/riscv/configure.ac b/sysdeps/unix/sysv/linux/riscv/configure.ac
index d4819931ca3..710d46afcd3 100644
--- a/sysdeps/unix/sysv/linux/riscv/configure.ac
+++ b/sysdeps/unix/sysv/linux/riscv/configure.ac
@@ -7,6 +7,8 @@ arch_minimum_kernel=4.15.0
 libc_cv_riscv_int_abi=no
 AC_EGREP_CPP(4 8 8, [__SIZEOF_INT__ __SIZEOF_LONG__ __SIZEOF_POINTER__
   ], libc_cv_riscv_int_abi=lp64)
+AC_EGREP_CPP(4 4 4, [__SIZEOF_INT__ __SIZEOF_LONG__ __SIZEOF_POINTER__
+  ], libc_cv_riscv_int_abi=ilp32)
 if test $libc_cv_riscv_int_abi = no; then
   AC_MSG_ERROR([Unable to determine integer ABI])
 fi
@@ -33,6 +35,12 @@ lp64-riscv/rv64/*)
 lp64d-riscv/rv64/*)
   LIBC_SLIBDIR_RTLDDIR([lib64/lp64d], [lib])
   ;;
+ilp32-riscv/rv32/*)
+  LIBC_SLIBDIR_RTLDDIR([lib32/ilp32], [lib])
+  ;;
+ilp32d-riscv/rv32/*)
+  LIBC_SLIBDIR_RTLDDIR([lib32/ilp32d], [lib])
+  ;;
 esac
 
 ldd_rewrite_script=sysdeps/unix/sysv/linux/riscv/ldd-rewrite.sed
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/Implies b/sysdeps/unix/sysv/linux/riscv/rv32/Implies
new file mode 100644
index 00000000000..8b7deb33cd5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/Implies
@@ -0,0 +1,3 @@
+unix/sysv/linux/riscv
+unix/sysv/linux/generic/wordsize-32
+unix/sysv/linux/generic
diff --git a/sysdeps/unix/sysv/linux/riscv/shlib-versions b/sysdeps/unix/sysv/linux/riscv/shlib-versions
index 98c9b29cc4d..0f9552a1dd5 100644
--- a/sysdeps/unix/sysv/linux/riscv/shlib-versions
+++ b/sysdeps/unix/sysv/linux/riscv/shlib-versions
@@ -1,9 +1,15 @@
-DEFAULT		GLIBC_2.27
-
 %if RISCV_ABI_XLEN == 64 && RISCV_ABI_FLEN == 64
+DEFAULT		GLIBC_2.27
 ld=ld-linux-riscv64-lp64d.so.1
 %elif RISCV_ABI_XLEN == 64 && RISCV_ABI_FLEN == 0
+DEFAULT		GLIBC_2.27
 ld=ld-linux-riscv64-lp64.so.1
+%elif RISCV_ABI_XLEN == 32 && RISCV_ABI_FLEN == 64
+DEFAULT		GLIBC_2.31
+ld=ld-linux-riscv32-ilp32d.so.1
+%elif RISCV_ABI_XLEN == 32 && RISCV_ABI_FLEN == 0
+DEFAULT		GLIBC_2.31
+ld=ld-linux-riscv32-ilp32.so.1
 %else
 %error cannot determine ABI
 %endif
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 24/24] timerfd_settime: Use 64-bit call if avaliable
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (15 preceding siblings ...)
  2019-08-10  1:04 ` [RFC v4 21/24] Add RISC-V 32-bit target to build-many-glibcs.py Alistair Francis
@ 2019-08-10  1:04 ` Alistair Francis
  2019-08-10  1:28   ` Alistair Francis
  2019-08-12 20:09   ` Joseph Myers
  2019-08-10  1:04 ` [RFC v4 23/24] WIP: syscall.list: Call 64-bit versions of syscalls Alistair Francis
                   ` (6 subsequent siblings)
  23 siblings, 2 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:04 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 sysdeps/unix/sysv/linux/Makefile          |   2 +
 sysdeps/unix/sysv/linux/sys/timerfd.h     |  21 +++--
 sysdeps/unix/sysv/linux/syscalls.list     |   1 -
 sysdeps/unix/sysv/linux/timerfd_settime.c | 104 ++++++++++++++++++++++
 4 files changed, 120 insertions(+), 8 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/timerfd_settime.c

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 1ab6bcbfc81..89128e80868 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -19,6 +19,8 @@ sysdep_routines += clone umount umount2 readahead \
 		   eventfd eventfd_read eventfd_write prlimit \
 		   personality epoll_wait tee vmsplice splice \
 		   open_by_handle_at mlock2 pkey_mprotect pkey_set pkey_get
+		   timerfd_settime
+
 
 CFLAGS-gethostid.c = -fexceptions
 CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables
diff --git a/sysdeps/unix/sysv/linux/sys/timerfd.h b/sysdeps/unix/sysv/linux/sys/timerfd.h
index 5e5ad351a0d..51f63b357c1 100644
--- a/sysdeps/unix/sysv/linux/sys/timerfd.h
+++ b/sysdeps/unix/sysv/linux/sys/timerfd.h
@@ -24,6 +24,13 @@
 /* Get the platform-dependent flags.  */
 #include <bits/timerfd.h>
 
+#if __TIMESIZE == 32
+struct __itimerspec64
+  {
+    struct __timespec64 it_interval;
+    struct __timespec64 it_value;
+  };
+#endif
 
 /* Bits to be set in the FLAGS parameter of `timerfd_settime'.  */
 enum
@@ -40,16 +47,16 @@ __BEGIN_DECLS
 /* Return file descriptor for new interval timer source.  */
 extern int timerfd_create (__clockid_t __clock_id, int __flags) __THROW;
 
-/* Set next expiration time of interval timer source UFD to UTMR.  If
-   FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
-   absolute.  Optionally return the old expiration time in OTMR.  */
-extern int timerfd_settime (int __ufd, int __flags,
-			    const struct itimerspec *__utmr,
-			    struct itimerspec *__otmr) __THROW;
-
 /* Return the next expiration time of UFD.  */
 extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
 
 __END_DECLS
 
+/* Set next expiration time of interval timer source UFD to UTMR.  If
+   FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
+   absolute.  Optionally return the old expiration time in OTMR.  */
+int timerfd_settime (int __ufd, int __flags,
+        const struct itimerspec *__utmr,
+        struct itimerspec *__otmr) __THROW;
+
 #endif /* sys/timerfd.h */
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index 4844d1a9a3b..3fa1a5de63a 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -96,7 +96,6 @@ fremovexattr	-	fremovexattr	i:is	fremovexattr
 mq_setattr	-	mq_getsetattr	i:ipp	mq_setattr
 
 timerfd_create	EXTRA	timerfd_create	i:ii	timerfd_create
-timerfd_settime	EXTRA	timerfd_settime64	i:iipp	timerfd_settime
 timerfd_gettime	EXTRA	timerfd_gettime64	i:ip	timerfd_gettime
 
 fanotify_init	EXTRA	fanotify_init	i:ii	fanotify_init
diff --git a/sysdeps/unix/sysv/linux/timerfd_settime.c b/sysdeps/unix/sysv/linux/timerfd_settime.c
new file mode 100644
index 00000000000..830faeada77
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/timerfd_settime.c
@@ -0,0 +1,104 @@
+/* Copyright (C) 2003-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, see <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sysdep.h>
+
+int
+timerfd_settime (int __ufd, int __flags, const struct itimerspec *__utmr,
+                 struct itimerspec *__otmr)
+{
+#ifdef __ASSUME_TIME64_SYSCALLS
+  /* Delete the kernel timer object.  */
+   return INLINE_SYSCALL (timerfd_settime64, 4, __ufd, __flags, __utmr, __otmr);
+#else
+   int ret;
+# ifdef __NR_timerfd_settime64
+#  if __TIMESIZE == 64
+  ret = INLINE_SYSCALL (timerfd_settime64, 4, __ufd, __flags, __utmr, __otmr);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      return ret;
+    }
+#  else
+  struct __itimerspec64 ts64;
+  ret = INLINE_SYSCALL (timerfd_settime64, 4, __ufd, __flags, __utmr, &ts64);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      __utmr->it_interval.tv_sec = ts64.it_interval.tv_sec
+      __utmr->it_interval.tv_nsec = ts64.it_interval.tv_nsec
+      if (! in_time_t_range (__utmr->it_interval.tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      __utmr->it_value.tv_sec = ts64.it_value.tv_sec
+      __utmr->it_value.tv_nsec = ts64.it_value.tv_nsec
+      if (! in_time_t_range (__utmr->it_value.tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      return 0;
+    }
+#  endif /* __TIMESIZE == 64 */
+# endif /* __NR_timerfd_settime */
+# if __TIMESIZE == 64
+  struct itimerspec ts32;
+
+  if (! in_time_t_range (__utmr->it_interval.tv_sec) ||
+      ! in_time_t_range (__utmr->it_value.tv_sec))
+    {
+      __set_errno (EOVERFLOW);
+      return -1;
+    }
+
+  ret = INLINE_SYSCALL (timerfd_settime, 4, __ufd, __flags, __utmr, &ts32);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      __utmr->it_interval.tv_sec = ts32.it_interval.tv_sec
+      __utmr->it_interval.tv_nsec = ts32.it_interval.tv_nsec
+      if (! in_time_t_range (__utmr->it_interval.tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      __utmr->it_value.tv_sec = ts32.it_value.tv_sec
+      __utmr->it_value.tv_nsec = ts32.it_value.tv_nsec
+      if (! in_time_t_range (__utmr->it_value.tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      return 0;
+    }
+  return ret;
+# else
+    return INLINE_SYSCALL (timerfd_settime, 4, __ufd, __flags, __utmr, __otmr);
+# endif /* __TIMESIZE == 64 */
+#endif /* __ASSUME_TIME64_SYSCALLS */
+}
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 23/24] WIP: syscall.list: Call 64-bit versions of syscalls
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (16 preceding siblings ...)
  2019-08-10  1:04 ` [RFC v4 24/24] timerfd_settime: Use 64-bit call if avaliable Alistair Francis
@ 2019-08-10  1:04 ` Alistair Francis
  2019-08-14 18:39   ` Alistair Francis
  2019-08-10  1:04 ` [RFC v4 19/24] RISC-V: Build Infastructure for the 32-bit Alistair Francis
                   ` (5 subsequent siblings)
  23 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:04 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 sysdeps/unix/sysv/linux/syscalls.list | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index e374f97b5f8..4844d1a9a3b 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -5,7 +5,7 @@ alarm		-	alarm		i:i	alarm
 bdflush		EXTRA	bdflush		i:ii	__compat_bdflush	bdflush@GLIBC_2.0:GLIBC_2.23
 capget		EXTRA	capget		i:pp	capget
 capset		EXTRA	capset		i:pp	capset
-clock_adjtime	EXTRA	clock_adjtime	i:ip	clock_adjtime
+clock_adjtime	EXTRA	clock_adjtime64	i:ip	clock_adjtime
 create_module	EXTRA	create_module	3	__compat_create_module	create_module@GLIBC_2.0:GLIBC_2.23
 delete_module	EXTRA	delete_module	3	delete_module
 epoll_create	EXTRA	epoll_create	i:i	epoll_create
@@ -52,7 +52,7 @@ sched_getp	-	sched_getparam	i:ip	__sched_getparam	sched_getparam
 sched_gets	-	sched_getscheduler	i:i	__sched_getscheduler	sched_getscheduler
 sched_primax	-	sched_get_priority_max	i:i	__sched_get_priority_max	sched_get_priority_max
 sched_primin	-	sched_get_priority_min	i:i	__sched_get_priority_min	sched_get_priority_min
-sched_rr_gi	-	sched_rr_get_interval	i:ip	__sched_rr_get_interval	sched_rr_get_interval
+sched_rr_gi	-	sched_rr_get_interval_time64	i:ip	__sched_rr_get_interval	sched_rr_get_interval
 sched_setp	-	sched_setparam	i:ip	__sched_setparam	sched_setparam
 sched_sets	-	sched_setscheduler	i:iip	__sched_setscheduler	sched_setscheduler
 sched_yield	-	sched_yield	i:	__sched_yield	sched_yield
@@ -96,8 +96,8 @@ fremovexattr	-	fremovexattr	i:is	fremovexattr
 mq_setattr	-	mq_getsetattr	i:ipp	mq_setattr
 
 timerfd_create	EXTRA	timerfd_create	i:ii	timerfd_create
-timerfd_settime	EXTRA	timerfd_settime	i:iipp	timerfd_settime
-timerfd_gettime	EXTRA	timerfd_gettime	i:ip	timerfd_gettime
+timerfd_settime	EXTRA	timerfd_settime64	i:iipp	timerfd_settime
+timerfd_gettime	EXTRA	timerfd_gettime64	i:ip	timerfd_gettime
 
 fanotify_init	EXTRA	fanotify_init	i:ii	fanotify_init
 
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 14/24] RISC-V: Support dynamic loader for the 32-bit
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (22 preceding siblings ...)
  2019-08-10  1:04 ` [RFC v4 18/24] RISC-V: Add ABI lists Alistair Francis
@ 2019-08-10  1:04 ` Alistair Francis
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:04 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

From: Zong Li <zongbox@gmail.com>

Add the LD_SO_ABI definition for RISC-V 32-bit.

2018-11-29  Zong Li  <zong@andestech.com>

	* sysdeps/unix/sysv/linux/riscv/ldconfig.h (LD_SO_ABI): Support
	rv32.
---
 ChangeLog                                | 4 ++++
 sysdeps/unix/sysv/linux/riscv/ldconfig.h | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 4c6b86456a3..c3ddcfaf9d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1433,6 +1433,10 @@
 	* sysdeps/unix/sysv/linux/riscv/bits/timesize.h: Likewise.
 	* sysdeps/unix/sysv/linux/riscv/bits/typesizes.h: Likewise.
 
+2018-06-20  Zong Li  <zong@andestech.com>
+
+	* sysdeps/unix/sysv/linux/riscv/ldconfig.h (LD_SO_ABI): Support rv32.
+
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
 
diff --git a/sysdeps/unix/sysv/linux/riscv/ldconfig.h b/sysdeps/unix/sysv/linux/riscv/ldconfig.h
index 20fbd16c591..360f35fb28c 100644
--- a/sysdeps/unix/sysv/linux/riscv/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/riscv/ldconfig.h
@@ -24,7 +24,7 @@
 #if __riscv_xlen == 64
 # define LD_SO_ABI "riscv64-lp64"
 #else
-# error "rv32i-based targets are not supported"
+# define LD_SO_ABI "riscv32-ilp32"
 #endif
 
 #define SYSDEP_KNOWN_INTERPRETER_NAMES				\
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 21/24] Add RISC-V 32-bit target to build-many-glibcs.py
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (14 preceding siblings ...)
  2019-08-10  1:03 ` [RFC v4 09/24] Documentation for the RISC-V 32-bit port Alistair Francis
@ 2019-08-10  1:04 ` Alistair Francis
  2019-08-10  1:04 ` [RFC v4 24/24] timerfd_settime: Use 64-bit call if avaliable Alistair Francis
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:04 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

From: Zong Li <zongbox@gmail.com>

Support building three variant of 32 bit RISC-V glibc as follows:
- riscv32-linux-gnu-rv32imac-ilp32
- riscv32-linux-gnu-rv32imafdc-ilp32
- riscv32-linux-gnu-rv32imafdc-ilp32d

2018-11-29  Zong Li  <zong@andestech.com>

	* scripts/build-many-glibcs.py (Context): Add rv32 targets.
---
 ChangeLog                    | 11 +++++++++++
 scripts/build-many-glibcs.py | 15 +++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 3316d22efaf..a3c2443d090 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1501,6 +1501,17 @@
 	* sysdeps/unix/sysv/linux/riscv/shlib-versions: Likewise.
 	* sysdeps/riscv/preconfigure: Likewise.
 	* sysdeps/riscv/rv32/fix-fp-int-convert-overflow.h: New file.
+	* sysdeps/riscv/rv32/Implies-after: New file.
+	* sysdeps/riscv/rv32/rvd/Implies: Likewise.
+	* sysdeps/riscv/rv32/rvf/Implies: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/Implies: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/Makefile: Support rv32.
+	* sysdeps/unix/sysv/linux/riscv/configure: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/configure.ac: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/shlib-versions: Likewise.
+	* sysdeps/riscv/preconfigure: Likewise.
+	* sysdeps/riscv/rv32/fix-fp-int-convert-overflow.h: New file.
+	* scripts/build-many-glibcs.py (Context): Add rv32 targets.
 
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index aa6884e046d..205f70168ed 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -320,6 +320,21 @@ class Context(object):
         self.add_config(arch='powerpc64le',
                         os_name='linux-gnu',
                         gcc_cfg=['--disable-multilib', '--enable-secureplt'])
+        self.add_config(arch='riscv32',
+                        os_name='linux-gnu',
+                        variant='rv32imac-ilp32',
+                        gcc_cfg=['--with-arch=rv32imac', '--with-abi=ilp32',
+                                 '--disable-multilib'])
+        self.add_config(arch='riscv32',
+                        os_name='linux-gnu',
+                        variant='rv32imafdc-ilp32',
+                        gcc_cfg=['--with-arch=rv32imafdc', '--with-abi=ilp32',
+                                 '--disable-multilib'])
+        self.add_config(arch='riscv32',
+                        os_name='linux-gnu',
+                        variant='rv32imafdc-ilp32d',
+                        gcc_cfg=['--with-arch=rv32imafdc', '--with-abi=ilp32d',
+                                 '--disable-multilib'])
         self.add_config(arch='riscv64',
                         os_name='linux-gnu',
                         variant='rv64imac-lp64',
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 18/24] RISC-V: Add ABI lists
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (21 preceding siblings ...)
  2019-08-10  1:04 ` [RFC v4 11/24] RISC-V: define __NR_futex as __NR_futex_time64 for 32-bit Alistair Francis
@ 2019-08-10  1:04 ` Alistair Francis
  2019-08-10  1:04 ` [RFC v4 14/24] RISC-V: Support dynamic loader for the 32-bit Alistair Francis
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:04 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

From: Zong Li <zongbox@gmail.com>

Use the check-api and update-abi to generate the abilist for rv32.

2018-11-29  Zong Li  <zong@andestech.com>

	* sysdeps/unix/sysv/linux/riscv/rv32/c++-types.data: New file.
	* sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv32/libBrokenLocale.abilist:
	Likewise.
---
 ChangeLog                                     |   32 +
 .../unix/sysv/linux/riscv/rv32/c++-types.data |   67 +
 sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist |    9 +
 .../linux/riscv/rv32/libBrokenLocale.abilist  |    1 +
 .../unix/sysv/linux/riscv/rv32/libanl.abilist |    4 +
 .../unix/sysv/linux/riscv/rv32/libc.abilist   | 2101 +++++++++++++++++
 .../sysv/linux/riscv/rv32/libcrypt.abilist    |    2 +
 .../unix/sysv/linux/riscv/rv32/libdl.abilist  |    9 +
 .../unix/sysv/linux/riscv/rv32/libm.abilist   | 1021 ++++++++
 .../sysv/linux/riscv/rv32/libpthread.abilist  |  235 ++
 .../sysv/linux/riscv/rv32/libresolv.abilist   |   79 +
 .../unix/sysv/linux/riscv/rv32/librt.abilist  |   35 +
 .../linux/riscv/rv32/libthread_db.abilist     |   40 +
 .../sysv/linux/riscv/rv32/libutil.abilist     |    6 +
 14 files changed, 3641 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libBrokenLocale.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libcrypt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libdl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libm.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libresolv.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libthread_db.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist

diff --git a/ChangeLog b/ChangeLog
index 4c926088ba3..6896401d0e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1450,6 +1450,38 @@
 	* sysdeps/riscv/rv32/rvd/s_lround.c: Likewise.
 	* sysdeps/riscv/rv32/rvf/s_lrintf.c: Likewise.
 	* sysdeps/riscv/rv32/rvf/s_lroundf.c: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/ldconfig.h (LD_SO_ABI): Support rv32.
+	* sysdeps/unix/sysv/linux/riscv/dl-cache.h (add_system_dir): Add
+	libraries path for rv32.
+	* sysdeps/riscv/bits/wordsize.h: Supprt rv32.
+	* sysdeps/riscv/nptl/bits/pthreadtypes-arch.h: Likewise.
+	* sysdeps/riscv/sfp-machine.h: Likewise.
+	* sysdeps/riscv/sys/asm.h: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h: New file.
+	* sysdeps/unix/sysv/linux/riscv/rv32/lockf64.c: Likewise.
+	* sysdeps/riscv/rv32/rvd/s_lrint.c: New file.
+	* sysdeps/riscv/rv32/rvd/s_lround.c: Likewise.
+	* sysdeps/riscv/rv32/rvf/s_lrintf.c: Likewise.
+	* sysdeps/riscv/rv32/rvf/s_lroundf.c: Likewise.
+	* sysdeps/riscv/nofpu/libm-test-ulps: Regenerate.
+	* sysdeps/riscv/rvd/libm-test-ulps: New file.
+	* sysdeps/riscv/rvd/libm-test-ulps-name: New file.
+	* sysdeps/riscv/rv64/rvd/libm-test-ulps: Remove file.
+	* sysdeps/riscv/rv64/rvd/libm-test-ulps-name: Remove file.
+	* sysdeps/unix/sysv/linux/riscv/rv32/c++-types.data: New file.
+	* sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/libanl.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/libcrypt.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/libdl.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/libm.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/libresolv.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/librt.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/libthread_db.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/libBrokenLocale.abilist:
+	Likewise.
 
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/c++-types.data b/sysdeps/unix/sysv/linux/riscv/rv32/c++-types.data
new file mode 100644
index 00000000000..303f4570c8e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:l
+blksize_t:i
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:y
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:m
+fsfilcnt64_t:y
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:j
+off64_t:x
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:i
+rlim64_t:y
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist
new file mode 100644
index 00000000000..1515b0977c8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist
@@ -0,0 +1,9 @@
+GLIBC_2.31 __libc_stack_end D 0x4
+GLIBC_2.31 __stack_chk_guard D 0x4
+GLIBC_2.31 __tls_get_addr F
+GLIBC_2.31 _dl_mcount F
+GLIBC_2.31 _r_debug D 0x14
+GLIBC_2.31 calloc F
+GLIBC_2.31 free F
+GLIBC_2.31 malloc F
+GLIBC_2.31 realloc F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libBrokenLocale.abilist
new file mode 100644
index 00000000000..55b5eb8193a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libBrokenLocale.abilist
@@ -0,0 +1 @@
+GLIBC_2.31 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libanl.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libanl.abilist
new file mode 100644
index 00000000000..2b096eb1f03
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libanl.abilist
@@ -0,0 +1,4 @@
+GLIBC_2.31 gai_cancel F
+GLIBC_2.31 gai_error F
+GLIBC_2.31 gai_suspend F
+GLIBC_2.31 getaddrinfo_a F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
new file mode 100644
index 00000000000..250fed20dae
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -0,0 +1,2101 @@
+GLIBC_2.31 _Exit F
+GLIBC_2.31 _IO_2_1_stderr_ D 0xa0
+GLIBC_2.31 _IO_2_1_stdin_ D 0xa0
+GLIBC_2.31 _IO_2_1_stdout_ D 0xa0
+GLIBC_2.31 _IO_adjust_column F
+GLIBC_2.31 _IO_adjust_wcolumn F
+GLIBC_2.31 _IO_default_doallocate F
+GLIBC_2.31 _IO_default_finish F
+GLIBC_2.31 _IO_default_pbackfail F
+GLIBC_2.31 _IO_default_uflow F
+GLIBC_2.31 _IO_default_xsgetn F
+GLIBC_2.31 _IO_default_xsputn F
+GLIBC_2.31 _IO_do_write F
+GLIBC_2.31 _IO_doallocbuf F
+GLIBC_2.31 _IO_fclose F
+GLIBC_2.31 _IO_fdopen F
+GLIBC_2.31 _IO_feof F
+GLIBC_2.31 _IO_ferror F
+GLIBC_2.31 _IO_fflush F
+GLIBC_2.31 _IO_fgetpos F
+GLIBC_2.31 _IO_fgetpos64 F
+GLIBC_2.31 _IO_fgets F
+GLIBC_2.31 _IO_file_attach F
+GLIBC_2.31 _IO_file_close F
+GLIBC_2.31 _IO_file_close_it F
+GLIBC_2.31 _IO_file_doallocate F
+GLIBC_2.31 _IO_file_finish F
+GLIBC_2.31 _IO_file_fopen F
+GLIBC_2.31 _IO_file_init F
+GLIBC_2.31 _IO_file_jumps D 0x54
+GLIBC_2.31 _IO_file_open F
+GLIBC_2.31 _IO_file_overflow F
+GLIBC_2.31 _IO_file_read F
+GLIBC_2.31 _IO_file_seek F
+GLIBC_2.31 _IO_file_seekoff F
+GLIBC_2.31 _IO_file_setbuf F
+GLIBC_2.31 _IO_file_stat F
+GLIBC_2.31 _IO_file_sync F
+GLIBC_2.31 _IO_file_underflow F
+GLIBC_2.31 _IO_file_write F
+GLIBC_2.31 _IO_file_xsputn F
+GLIBC_2.31 _IO_flockfile F
+GLIBC_2.31 _IO_flush_all F
+GLIBC_2.31 _IO_flush_all_linebuffered F
+GLIBC_2.31 _IO_fopen F
+GLIBC_2.31 _IO_fprintf F
+GLIBC_2.31 _IO_fputs F
+GLIBC_2.31 _IO_fread F
+GLIBC_2.31 _IO_free_backup_area F
+GLIBC_2.31 _IO_free_wbackup_area F
+GLIBC_2.31 _IO_fsetpos F
+GLIBC_2.31 _IO_fsetpos64 F
+GLIBC_2.31 _IO_ftell F
+GLIBC_2.31 _IO_ftrylockfile F
+GLIBC_2.31 _IO_funlockfile F
+GLIBC_2.31 _IO_fwrite F
+GLIBC_2.31 _IO_getc F
+GLIBC_2.31 _IO_getline F
+GLIBC_2.31 _IO_getline_info F
+GLIBC_2.31 _IO_gets F
+GLIBC_2.31 _IO_init F
+GLIBC_2.31 _IO_init_marker F
+GLIBC_2.31 _IO_init_wmarker F
+GLIBC_2.31 _IO_iter_begin F
+GLIBC_2.31 _IO_iter_end F
+GLIBC_2.31 _IO_iter_file F
+GLIBC_2.31 _IO_iter_next F
+GLIBC_2.31 _IO_least_wmarker F
+GLIBC_2.31 _IO_link_in F
+GLIBC_2.31 _IO_list_all D 0x4
+GLIBC_2.31 _IO_list_lock F
+GLIBC_2.31 _IO_list_resetlock F
+GLIBC_2.31 _IO_list_unlock F
+GLIBC_2.31 _IO_marker_delta F
+GLIBC_2.31 _IO_marker_difference F
+GLIBC_2.31 _IO_padn F
+GLIBC_2.31 _IO_peekc_locked F
+GLIBC_2.31 _IO_popen F
+GLIBC_2.31 _IO_printf F
+GLIBC_2.31 _IO_proc_close F
+GLIBC_2.31 _IO_proc_open F
+GLIBC_2.31 _IO_putc F
+GLIBC_2.31 _IO_puts F
+GLIBC_2.31 _IO_remove_marker F
+GLIBC_2.31 _IO_seekmark F
+GLIBC_2.31 _IO_seekoff F
+GLIBC_2.31 _IO_seekpos F
+GLIBC_2.31 _IO_seekwmark F
+GLIBC_2.31 _IO_setb F
+GLIBC_2.31 _IO_setbuffer F
+GLIBC_2.31 _IO_setvbuf F
+GLIBC_2.31 _IO_sgetn F
+GLIBC_2.31 _IO_sprintf F
+GLIBC_2.31 _IO_sputbackc F
+GLIBC_2.31 _IO_sputbackwc F
+GLIBC_2.31 _IO_sscanf F
+GLIBC_2.31 _IO_str_init_readonly F
+GLIBC_2.31 _IO_str_init_static F
+GLIBC_2.31 _IO_str_overflow F
+GLIBC_2.31 _IO_str_pbackfail F
+GLIBC_2.31 _IO_str_seekoff F
+GLIBC_2.31 _IO_str_underflow F
+GLIBC_2.31 _IO_sungetc F
+GLIBC_2.31 _IO_sungetwc F
+GLIBC_2.31 _IO_switch_to_get_mode F
+GLIBC_2.31 _IO_switch_to_main_wget_area F
+GLIBC_2.31 _IO_switch_to_wbackup_area F
+GLIBC_2.31 _IO_switch_to_wget_mode F
+GLIBC_2.31 _IO_un_link F
+GLIBC_2.31 _IO_ungetc F
+GLIBC_2.31 _IO_unsave_markers F
+GLIBC_2.31 _IO_unsave_wmarkers F
+GLIBC_2.31 _IO_vfprintf F
+GLIBC_2.31 _IO_vsprintf F
+GLIBC_2.31 _IO_wdefault_doallocate F
+GLIBC_2.31 _IO_wdefault_finish F
+GLIBC_2.31 _IO_wdefault_pbackfail F
+GLIBC_2.31 _IO_wdefault_uflow F
+GLIBC_2.31 _IO_wdefault_xsgetn F
+GLIBC_2.31 _IO_wdefault_xsputn F
+GLIBC_2.31 _IO_wdo_write F
+GLIBC_2.31 _IO_wdoallocbuf F
+GLIBC_2.31 _IO_wfile_jumps D 0x54
+GLIBC_2.31 _IO_wfile_overflow F
+GLIBC_2.31 _IO_wfile_seekoff F
+GLIBC_2.31 _IO_wfile_sync F
+GLIBC_2.31 _IO_wfile_underflow F
+GLIBC_2.31 _IO_wfile_xsputn F
+GLIBC_2.31 _IO_wmarker_delta F
+GLIBC_2.31 _IO_wsetb F
+GLIBC_2.31 ___brk_addr D 0x4
+GLIBC_2.31 __adjtimex F
+GLIBC_2.31 __after_morecore_hook D 0x4
+GLIBC_2.31 __argz_count F
+GLIBC_2.31 __argz_next F
+GLIBC_2.31 __argz_stringify F
+GLIBC_2.31 __asprintf F
+GLIBC_2.31 __asprintf_chk F
+GLIBC_2.31 __assert F
+GLIBC_2.31 __assert_fail F
+GLIBC_2.31 __assert_perror_fail F
+GLIBC_2.31 __backtrace F
+GLIBC_2.31 __backtrace_symbols F
+GLIBC_2.31 __backtrace_symbols_fd F
+GLIBC_2.31 __bsd_getpgrp F
+GLIBC_2.31 __bzero F
+GLIBC_2.31 __check_rhosts_file D 0x4
+GLIBC_2.31 __chk_fail F
+GLIBC_2.31 __clone F
+GLIBC_2.31 __close F
+GLIBC_2.31 __cmsg_nxthdr F
+GLIBC_2.31 __confstr_chk F
+GLIBC_2.31 __connect F
+GLIBC_2.31 __ctype_b_loc F
+GLIBC_2.31 __ctype_get_mb_cur_max F
+GLIBC_2.31 __ctype_tolower_loc F
+GLIBC_2.31 __ctype_toupper_loc F
+GLIBC_2.31 __curbrk D 0x4
+GLIBC_2.31 __cxa_at_quick_exit F
+GLIBC_2.31 __cxa_atexit F
+GLIBC_2.31 __cxa_finalize F
+GLIBC_2.31 __cxa_thread_atexit_impl F
+GLIBC_2.31 __cyg_profile_func_enter F
+GLIBC_2.31 __cyg_profile_func_exit F
+GLIBC_2.31 __daylight D 0x4
+GLIBC_2.31 __dcgettext F
+GLIBC_2.31 __default_morecore F
+GLIBC_2.31 __dgettext F
+GLIBC_2.31 __dprintf_chk F
+GLIBC_2.31 __dup2 F
+GLIBC_2.31 __duplocale F
+GLIBC_2.31 __endmntent F
+GLIBC_2.31 __environ D 0x4
+GLIBC_2.31 __errno_location F
+GLIBC_2.31 __explicit_bzero_chk F
+GLIBC_2.31 __fbufsize F
+GLIBC_2.31 __fcntl F
+GLIBC_2.31 __fdelt_chk F
+GLIBC_2.31 __fdelt_warn F
+GLIBC_2.31 __ffs F
+GLIBC_2.31 __fgets_chk F
+GLIBC_2.31 __fgets_unlocked_chk F
+GLIBC_2.31 __fgetws_chk F
+GLIBC_2.31 __fgetws_unlocked_chk F
+GLIBC_2.31 __finite F
+GLIBC_2.31 __finitef F
+GLIBC_2.31 __finitel F
+GLIBC_2.31 __flbf F
+GLIBC_2.31 __fork F
+GLIBC_2.31 __fpending F
+GLIBC_2.31 __fprintf_chk F
+GLIBC_2.31 __fpu_control D 0x4
+GLIBC_2.31 __fpurge F
+GLIBC_2.31 __fread_chk F
+GLIBC_2.31 __fread_unlocked_chk F
+GLIBC_2.31 __freadable F
+GLIBC_2.31 __freading F
+GLIBC_2.31 __free_hook D 0x4
+GLIBC_2.31 __freelocale F
+GLIBC_2.31 __fsetlocking F
+GLIBC_2.31 __fwprintf_chk F
+GLIBC_2.31 __fwritable F
+GLIBC_2.31 __fwriting F
+GLIBC_2.31 __fxstat F
+GLIBC_2.31 __fxstat64 F
+GLIBC_2.31 __fxstatat F
+GLIBC_2.31 __fxstatat64 F
+GLIBC_2.31 __getauxval F
+GLIBC_2.31 __getcwd_chk F
+GLIBC_2.31 __getdelim F
+GLIBC_2.31 __getdomainname_chk F
+GLIBC_2.31 __getgroups_chk F
+GLIBC_2.31 __gethostname_chk F
+GLIBC_2.31 __getlogin_r_chk F
+GLIBC_2.31 __getmntent_r F
+GLIBC_2.31 __getpagesize F
+GLIBC_2.31 __getpgid F
+GLIBC_2.31 __getpid F
+GLIBC_2.31 __gets_chk F
+GLIBC_2.31 __gettimeofday F
+GLIBC_2.31 __getwd_chk F
+GLIBC_2.31 __gmtime_r F
+GLIBC_2.31 __h_errno_location F
+GLIBC_2.31 __isalnum_l F
+GLIBC_2.31 __isalpha_l F
+GLIBC_2.31 __isascii_l F
+GLIBC_2.31 __isblank_l F
+GLIBC_2.31 __iscntrl_l F
+GLIBC_2.31 __isctype F
+GLIBC_2.31 __isdigit_l F
+GLIBC_2.31 __isgraph_l F
+GLIBC_2.31 __isinf F
+GLIBC_2.31 __isinff F
+GLIBC_2.31 __isinfl F
+GLIBC_2.31 __islower_l F
+GLIBC_2.31 __isnan F
+GLIBC_2.31 __isnanf F
+GLIBC_2.31 __isnanl F
+GLIBC_2.31 __isoc99_fscanf F
+GLIBC_2.31 __isoc99_fwscanf F
+GLIBC_2.31 __isoc99_scanf F
+GLIBC_2.31 __isoc99_sscanf F
+GLIBC_2.31 __isoc99_swscanf F
+GLIBC_2.31 __isoc99_vfscanf F
+GLIBC_2.31 __isoc99_vfwscanf F
+GLIBC_2.31 __isoc99_vscanf F
+GLIBC_2.31 __isoc99_vsscanf F
+GLIBC_2.31 __isoc99_vswscanf F
+GLIBC_2.31 __isoc99_vwscanf F
+GLIBC_2.31 __isoc99_wscanf F
+GLIBC_2.31 __isprint_l F
+GLIBC_2.31 __ispunct_l F
+GLIBC_2.31 __isspace_l F
+GLIBC_2.31 __isupper_l F
+GLIBC_2.31 __iswalnum_l F
+GLIBC_2.31 __iswalpha_l F
+GLIBC_2.31 __iswblank_l F
+GLIBC_2.31 __iswcntrl_l F
+GLIBC_2.31 __iswctype F
+GLIBC_2.31 __iswctype_l F
+GLIBC_2.31 __iswdigit_l F
+GLIBC_2.31 __iswgraph_l F
+GLIBC_2.31 __iswlower_l F
+GLIBC_2.31 __iswprint_l F
+GLIBC_2.31 __iswpunct_l F
+GLIBC_2.31 __iswspace_l F
+GLIBC_2.31 __iswupper_l F
+GLIBC_2.31 __iswxdigit_l F
+GLIBC_2.31 __isxdigit_l F
+GLIBC_2.31 __ivaliduser F
+GLIBC_2.31 __key_decryptsession_pk_LOCAL D 0x4
+GLIBC_2.31 __key_encryptsession_pk_LOCAL D 0x4
+GLIBC_2.31 __key_gendes_LOCAL D 0x4
+GLIBC_2.31 __libc_allocate_rtsig F
+GLIBC_2.31 __libc_calloc F
+GLIBC_2.31 __libc_current_sigrtmax F
+GLIBC_2.31 __libc_current_sigrtmin F
+GLIBC_2.31 __libc_free F
+GLIBC_2.31 __libc_freeres F
+GLIBC_2.31 __libc_init_first F
+GLIBC_2.31 __libc_mallinfo F
+GLIBC_2.31 __libc_malloc F
+GLIBC_2.31 __libc_mallopt F
+GLIBC_2.31 __libc_memalign F
+GLIBC_2.31 __libc_pvalloc F
+GLIBC_2.31 __libc_realloc F
+GLIBC_2.31 __libc_sa_len F
+GLIBC_2.31 __libc_start_main F
+GLIBC_2.31 __libc_valloc F
+GLIBC_2.31 __longjmp_chk F
+GLIBC_2.31 __lseek F
+GLIBC_2.31 __lxstat F
+GLIBC_2.31 __lxstat64 F
+GLIBC_2.31 __malloc_hook D 0x4
+GLIBC_2.31 __mbrlen F
+GLIBC_2.31 __mbrtowc F
+GLIBC_2.31 __mbsnrtowcs_chk F
+GLIBC_2.31 __mbsrtowcs_chk F
+GLIBC_2.31 __mbstowcs_chk F
+GLIBC_2.31 __memalign_hook D 0x4
+GLIBC_2.31 __memcpy_chk F
+GLIBC_2.31 __memmove_chk F
+GLIBC_2.31 __mempcpy F
+GLIBC_2.31 __mempcpy_chk F
+GLIBC_2.31 __memset_chk F
+GLIBC_2.31 __monstartup F
+GLIBC_2.31 __morecore D 0x4
+GLIBC_2.31 __nanosleep F
+GLIBC_2.31 __newlocale F
+GLIBC_2.31 __nl_langinfo_l F
+GLIBC_2.31 __nss_configure_lookup F
+GLIBC_2.31 __nss_database_lookup F
+GLIBC_2.31 __nss_hostname_digits_dots F
+GLIBC_2.31 __nss_next F
+GLIBC_2.31 __obstack_printf_chk F
+GLIBC_2.31 __obstack_vprintf_chk F
+GLIBC_2.31 __open F
+GLIBC_2.31 __open64 F
+GLIBC_2.31 __open64_2 F
+GLIBC_2.31 __open_2 F
+GLIBC_2.31 __openat64_2 F
+GLIBC_2.31 __openat_2 F
+GLIBC_2.31 __overflow F
+GLIBC_2.31 __pipe F
+GLIBC_2.31 __poll F
+GLIBC_2.31 __poll_chk F
+GLIBC_2.31 __posix_getopt F
+GLIBC_2.31 __ppoll_chk F
+GLIBC_2.31 __pread64 F
+GLIBC_2.31 __pread64_chk F
+GLIBC_2.31 __pread_chk F
+GLIBC_2.31 __printf_chk F
+GLIBC_2.31 __printf_fp F
+GLIBC_2.31 __profile_frequency F
+GLIBC_2.31 __progname D 0x4
+GLIBC_2.31 __progname_full D 0x4
+GLIBC_2.31 __ptsname_r_chk F
+GLIBC_2.31 __pwrite64 F
+GLIBC_2.31 __rawmemchr F
+GLIBC_2.31 __rcmd_errstr D 0x4
+GLIBC_2.31 __read F
+GLIBC_2.31 __read_chk F
+GLIBC_2.31 __readlink_chk F
+GLIBC_2.31 __readlinkat_chk F
+GLIBC_2.31 __realloc_hook D 0x4
+GLIBC_2.31 __realpath_chk F
+GLIBC_2.31 __recv_chk F
+GLIBC_2.31 __recvfrom_chk F
+GLIBC_2.31 __register_atfork F
+GLIBC_2.31 __res_init F
+GLIBC_2.31 __res_nclose F
+GLIBC_2.31 __res_ninit F
+GLIBC_2.31 __res_randomid F
+GLIBC_2.31 __res_state F
+GLIBC_2.31 __riscv_flush_icache F
+GLIBC_2.31 __rpc_thread_createerr F
+GLIBC_2.31 __rpc_thread_svc_fdset F
+GLIBC_2.31 __rpc_thread_svc_max_pollfd F
+GLIBC_2.31 __rpc_thread_svc_pollfd F
+GLIBC_2.31 __sbrk F
+GLIBC_2.31 __sched_cpualloc F
+GLIBC_2.31 __sched_cpucount F
+GLIBC_2.31 __sched_cpufree F
+GLIBC_2.31 __sched_get_priority_max F
+GLIBC_2.31 __sched_get_priority_min F
+GLIBC_2.31 __sched_getparam F
+GLIBC_2.31 __sched_getscheduler F
+GLIBC_2.31 __sched_setscheduler F
+GLIBC_2.31 __sched_yield F
+GLIBC_2.31 __select F
+GLIBC_2.31 __send F
+GLIBC_2.31 __setmntent F
+GLIBC_2.31 __setpgid F
+GLIBC_2.31 __sigaction F
+GLIBC_2.31 __signbit F
+GLIBC_2.31 __signbitf F
+GLIBC_2.31 __signbitl F
+GLIBC_2.31 __sigpause F
+GLIBC_2.31 __sigsetjmp F
+GLIBC_2.31 __sigsuspend F
+GLIBC_2.31 __snprintf_chk F
+GLIBC_2.31 __sprintf_chk F
+GLIBC_2.31 __stack_chk_fail F
+GLIBC_2.31 __statfs F
+GLIBC_2.31 __stpcpy F
+GLIBC_2.31 __stpcpy_chk F
+GLIBC_2.31 __stpncpy F
+GLIBC_2.31 __stpncpy_chk F
+GLIBC_2.31 __strcasecmp F
+GLIBC_2.31 __strcasecmp_l F
+GLIBC_2.31 __strcasestr F
+GLIBC_2.31 __strcat_chk F
+GLIBC_2.31 __strcoll_l F
+GLIBC_2.31 __strcpy_chk F
+GLIBC_2.31 __strdup F
+GLIBC_2.31 __strerror_r F
+GLIBC_2.31 __strfmon_l F
+GLIBC_2.31 __strftime_l F
+GLIBC_2.31 __strncasecmp_l F
+GLIBC_2.31 __strncat_chk F
+GLIBC_2.31 __strncpy_chk F
+GLIBC_2.31 __strndup F
+GLIBC_2.31 __strsep_g F
+GLIBC_2.31 __strtod_internal F
+GLIBC_2.31 __strtod_l F
+GLIBC_2.31 __strtof_internal F
+GLIBC_2.31 __strtof_l F
+GLIBC_2.31 __strtok_r F
+GLIBC_2.31 __strtol_internal F
+GLIBC_2.31 __strtol_l F
+GLIBC_2.31 __strtold_internal F
+GLIBC_2.31 __strtold_l F
+GLIBC_2.31 __strtoll_internal F
+GLIBC_2.31 __strtoll_l F
+GLIBC_2.31 __strtoul_internal F
+GLIBC_2.31 __strtoul_l F
+GLIBC_2.31 __strtoull_internal F
+GLIBC_2.31 __strtoull_l F
+GLIBC_2.31 __strverscmp F
+GLIBC_2.31 __strxfrm_l F
+GLIBC_2.31 __swprintf_chk F
+GLIBC_2.31 __sysconf F
+GLIBC_2.31 __syslog_chk F
+GLIBC_2.31 __sysv_signal F
+GLIBC_2.31 __timezone D 0x4
+GLIBC_2.31 __toascii_l F
+GLIBC_2.31 __tolower_l F
+GLIBC_2.31 __toupper_l F
+GLIBC_2.31 __towctrans F
+GLIBC_2.31 __towctrans_l F
+GLIBC_2.31 __towlower_l F
+GLIBC_2.31 __towupper_l F
+GLIBC_2.31 __ttyname_r_chk F
+GLIBC_2.31 __tzname D 0x8
+GLIBC_2.31 __uflow F
+GLIBC_2.31 __underflow F
+GLIBC_2.31 __uselocale F
+GLIBC_2.31 __vasprintf_chk F
+GLIBC_2.31 __vdprintf_chk F
+GLIBC_2.31 __vfork F
+GLIBC_2.31 __vfprintf_chk F
+GLIBC_2.31 __vfscanf F
+GLIBC_2.31 __vfwprintf_chk F
+GLIBC_2.31 __vprintf_chk F
+GLIBC_2.31 __vsnprintf F
+GLIBC_2.31 __vsnprintf_chk F
+GLIBC_2.31 __vsprintf_chk F
+GLIBC_2.31 __vsscanf F
+GLIBC_2.31 __vswprintf_chk F
+GLIBC_2.31 __vsyslog_chk F
+GLIBC_2.31 __vwprintf_chk F
+GLIBC_2.31 __wait F
+GLIBC_2.31 __waitpid F
+GLIBC_2.31 __wcpcpy_chk F
+GLIBC_2.31 __wcpncpy_chk F
+GLIBC_2.31 __wcrtomb_chk F
+GLIBC_2.31 __wcscasecmp_l F
+GLIBC_2.31 __wcscat_chk F
+GLIBC_2.31 __wcscoll_l F
+GLIBC_2.31 __wcscpy_chk F
+GLIBC_2.31 __wcsftime_l F
+GLIBC_2.31 __wcsncasecmp_l F
+GLIBC_2.31 __wcsncat_chk F
+GLIBC_2.31 __wcsncpy_chk F
+GLIBC_2.31 __wcsnrtombs_chk F
+GLIBC_2.31 __wcsrtombs_chk F
+GLIBC_2.31 __wcstod_internal F
+GLIBC_2.31 __wcstod_l F
+GLIBC_2.31 __wcstof_internal F
+GLIBC_2.31 __wcstof_l F
+GLIBC_2.31 __wcstol_internal F
+GLIBC_2.31 __wcstol_l F
+GLIBC_2.31 __wcstold_internal F
+GLIBC_2.31 __wcstold_l F
+GLIBC_2.31 __wcstoll_internal F
+GLIBC_2.31 __wcstoll_l F
+GLIBC_2.31 __wcstombs_chk F
+GLIBC_2.31 __wcstoul_internal F
+GLIBC_2.31 __wcstoul_l F
+GLIBC_2.31 __wcstoull_internal F
+GLIBC_2.31 __wcstoull_l F
+GLIBC_2.31 __wcsxfrm_l F
+GLIBC_2.31 __wctomb_chk F
+GLIBC_2.31 __wctrans_l F
+GLIBC_2.31 __wctype_l F
+GLIBC_2.31 __wmemcpy_chk F
+GLIBC_2.31 __wmemmove_chk F
+GLIBC_2.31 __wmempcpy_chk F
+GLIBC_2.31 __wmemset_chk F
+GLIBC_2.31 __woverflow F
+GLIBC_2.31 __wprintf_chk F
+GLIBC_2.31 __write F
+GLIBC_2.31 __wuflow F
+GLIBC_2.31 __wunderflow F
+GLIBC_2.31 __xmknod F
+GLIBC_2.31 __xmknodat F
+GLIBC_2.31 __xpg_basename F
+GLIBC_2.31 __xpg_sigpause F
+GLIBC_2.31 __xpg_strerror_r F
+GLIBC_2.31 __xstat F
+GLIBC_2.31 __xstat64 F
+GLIBC_2.31 _authenticate F
+GLIBC_2.31 _dl_mcount_wrapper F
+GLIBC_2.31 _dl_mcount_wrapper_check F
+GLIBC_2.31 _environ D 0x4
+GLIBC_2.31 _exit F
+GLIBC_2.31 _flushlbf F
+GLIBC_2.31 _libc_intl_domainname D 0x5
+GLIBC_2.31 _longjmp F
+GLIBC_2.31 _mcleanup F
+GLIBC_2.31 _mcount F
+GLIBC_2.31 _nl_default_dirname D 0x12
+GLIBC_2.31 _nl_domain_bindings D 0x4
+GLIBC_2.31 _nl_msg_cat_cntr D 0x4
+GLIBC_2.31 _null_auth D 0xc
+GLIBC_2.31 _obstack_allocated_p F
+GLIBC_2.31 _obstack_begin F
+GLIBC_2.31 _obstack_begin_1 F
+GLIBC_2.31 _obstack_free F
+GLIBC_2.31 _obstack_memory_used F
+GLIBC_2.31 _obstack_newchunk F
+GLIBC_2.31 _res D 0x200
+GLIBC_2.31 _res_hconf D 0x30
+GLIBC_2.31 _rpc_dtablesize F
+GLIBC_2.31 _seterr_reply F
+GLIBC_2.31 _setjmp F
+GLIBC_2.31 _sys_errlist D 0x21c
+GLIBC_2.31 _sys_nerr D 0x4
+GLIBC_2.31 _sys_siglist D 0x104
+GLIBC_2.31 _tolower F
+GLIBC_2.31 _toupper F
+GLIBC_2.31 a64l F
+GLIBC_2.31 abort F
+GLIBC_2.31 abs F
+GLIBC_2.31 accept F
+GLIBC_2.31 accept4 F
+GLIBC_2.31 access F
+GLIBC_2.31 acct F
+GLIBC_2.31 addmntent F
+GLIBC_2.31 addseverity F
+GLIBC_2.31 adjtime F
+GLIBC_2.31 adjtimex F
+GLIBC_2.31 alarm F
+GLIBC_2.31 aligned_alloc F
+GLIBC_2.31 alphasort F
+GLIBC_2.31 alphasort64 F
+GLIBC_2.31 argp_err_exit_status D 0x4
+GLIBC_2.31 argp_error F
+GLIBC_2.31 argp_failure F
+GLIBC_2.31 argp_help F
+GLIBC_2.31 argp_parse F
+GLIBC_2.31 argp_program_bug_address D 0x4
+GLIBC_2.31 argp_program_version D 0x4
+GLIBC_2.31 argp_program_version_hook D 0x4
+GLIBC_2.31 argp_state_help F
+GLIBC_2.31 argp_usage F
+GLIBC_2.31 argz_add F
+GLIBC_2.31 argz_add_sep F
+GLIBC_2.31 argz_append F
+GLIBC_2.31 argz_count F
+GLIBC_2.31 argz_create F
+GLIBC_2.31 argz_create_sep F
+GLIBC_2.31 argz_delete F
+GLIBC_2.31 argz_extract F
+GLIBC_2.31 argz_insert F
+GLIBC_2.31 argz_next F
+GLIBC_2.31 argz_replace F
+GLIBC_2.31 argz_stringify F
+GLIBC_2.31 asctime F
+GLIBC_2.31 asctime_r F
+GLIBC_2.31 asprintf F
+GLIBC_2.31 atof F
+GLIBC_2.31 atoi F
+GLIBC_2.31 atol F
+GLIBC_2.31 atoll F
+GLIBC_2.31 authdes_create F
+GLIBC_2.31 authdes_getucred F
+GLIBC_2.31 authdes_pk_create F
+GLIBC_2.31 authnone_create F
+GLIBC_2.31 authunix_create F
+GLIBC_2.31 authunix_create_default F
+GLIBC_2.31 backtrace F
+GLIBC_2.31 backtrace_symbols F
+GLIBC_2.31 backtrace_symbols_fd F
+GLIBC_2.31 basename F
+GLIBC_2.31 bcmp F
+GLIBC_2.31 bcopy F
+GLIBC_2.31 bind F
+GLIBC_2.31 bind_textdomain_codeset F
+GLIBC_2.31 bindresvport F
+GLIBC_2.31 bindtextdomain F
+GLIBC_2.31 brk F
+GLIBC_2.31 bsd_signal F
+GLIBC_2.31 bsearch F
+GLIBC_2.31 btowc F
+GLIBC_2.31 bzero F
+GLIBC_2.31 c16rtomb F
+GLIBC_2.31 c32rtomb F
+GLIBC_2.31 calloc F
+GLIBC_2.31 callrpc F
+GLIBC_2.31 canonicalize_file_name F
+GLIBC_2.31 capget F
+GLIBC_2.31 capset F
+GLIBC_2.31 catclose F
+GLIBC_2.31 catgets F
+GLIBC_2.31 catopen F
+GLIBC_2.31 cbc_crypt F
+GLIBC_2.31 cfgetispeed F
+GLIBC_2.31 cfgetospeed F
+GLIBC_2.31 cfmakeraw F
+GLIBC_2.31 cfsetispeed F
+GLIBC_2.31 cfsetospeed F
+GLIBC_2.31 cfsetspeed F
+GLIBC_2.31 chdir F
+GLIBC_2.31 chflags F
+GLIBC_2.31 chmod F
+GLIBC_2.31 chown F
+GLIBC_2.31 chroot F
+GLIBC_2.31 clearenv F
+GLIBC_2.31 clearerr F
+GLIBC_2.31 clearerr_unlocked F
+GLIBC_2.31 clnt_broadcast F
+GLIBC_2.31 clnt_create F
+GLIBC_2.31 clnt_pcreateerror F
+GLIBC_2.31 clnt_perrno F
+GLIBC_2.31 clnt_perror F
+GLIBC_2.31 clnt_spcreateerror F
+GLIBC_2.31 clnt_sperrno F
+GLIBC_2.31 clnt_sperror F
+GLIBC_2.31 clntraw_create F
+GLIBC_2.31 clnttcp_create F
+GLIBC_2.31 clntudp_bufcreate F
+GLIBC_2.31 clntudp_create F
+GLIBC_2.31 clntunix_create F
+GLIBC_2.31 clock F
+GLIBC_2.31 clock_adjtime F
+GLIBC_2.31 clock_getcpuclockid F
+GLIBC_2.31 clock_getres F
+GLIBC_2.31 clock_gettime F
+GLIBC_2.31 clock_nanosleep F
+GLIBC_2.31 clock_settime F
+GLIBC_2.31 clone F
+GLIBC_2.31 close F
+GLIBC_2.31 closedir F
+GLIBC_2.31 closelog F
+GLIBC_2.31 confstr F
+GLIBC_2.31 connect F
+GLIBC_2.31 copy_file_range F
+GLIBC_2.31 copysign F
+GLIBC_2.31 copysignf F
+GLIBC_2.31 copysignl F
+GLIBC_2.31 creat F
+GLIBC_2.31 creat64 F
+GLIBC_2.31 ctermid F
+GLIBC_2.31 ctime F
+GLIBC_2.31 ctime_r F
+GLIBC_2.31 cuserid F
+GLIBC_2.31 daemon F
+GLIBC_2.31 daylight D 0x4
+GLIBC_2.31 dcgettext F
+GLIBC_2.31 dcngettext F
+GLIBC_2.31 delete_module F
+GLIBC_2.31 des_setparity F
+GLIBC_2.31 dgettext F
+GLIBC_2.31 difftime F
+GLIBC_2.31 dirfd F
+GLIBC_2.31 dirname F
+GLIBC_2.31 div F
+GLIBC_2.31 dl_iterate_phdr F
+GLIBC_2.31 dngettext F
+GLIBC_2.31 dprintf F
+GLIBC_2.31 drand48 F
+GLIBC_2.31 drand48_r F
+GLIBC_2.31 dup F
+GLIBC_2.31 dup2 F
+GLIBC_2.31 dup3 F
+GLIBC_2.31 duplocale F
+GLIBC_2.31 dysize F
+GLIBC_2.31 eaccess F
+GLIBC_2.31 ecb_crypt F
+GLIBC_2.31 ecvt F
+GLIBC_2.31 ecvt_r F
+GLIBC_2.31 endaliasent F
+GLIBC_2.31 endfsent F
+GLIBC_2.31 endgrent F
+GLIBC_2.31 endhostent F
+GLIBC_2.31 endmntent F
+GLIBC_2.31 endnetent F
+GLIBC_2.31 endnetgrent F
+GLIBC_2.31 endprotoent F
+GLIBC_2.31 endpwent F
+GLIBC_2.31 endrpcent F
+GLIBC_2.31 endservent F
+GLIBC_2.31 endsgent F
+GLIBC_2.31 endspent F
+GLIBC_2.31 endttyent F
+GLIBC_2.31 endusershell F
+GLIBC_2.31 endutent F
+GLIBC_2.31 endutxent F
+GLIBC_2.31 environ D 0x4
+GLIBC_2.31 envz_add F
+GLIBC_2.31 envz_entry F
+GLIBC_2.31 envz_get F
+GLIBC_2.31 envz_merge F
+GLIBC_2.31 envz_remove F
+GLIBC_2.31 envz_strip F
+GLIBC_2.31 epoll_create F
+GLIBC_2.31 epoll_create1 F
+GLIBC_2.31 epoll_ctl F
+GLIBC_2.31 epoll_pwait F
+GLIBC_2.31 epoll_wait F
+GLIBC_2.31 erand48 F
+GLIBC_2.31 erand48_r F
+GLIBC_2.31 err F
+GLIBC_2.31 error F
+GLIBC_2.31 error_at_line F
+GLIBC_2.31 error_message_count D 0x4
+GLIBC_2.31 error_one_per_line D 0x4
+GLIBC_2.31 error_print_progname D 0x4
+GLIBC_2.31 errx F
+GLIBC_2.31 ether_aton F
+GLIBC_2.31 ether_aton_r F
+GLIBC_2.31 ether_hostton F
+GLIBC_2.31 ether_line F
+GLIBC_2.31 ether_ntoa F
+GLIBC_2.31 ether_ntoa_r F
+GLIBC_2.31 ether_ntohost F
+GLIBC_2.31 euidaccess F
+GLIBC_2.31 eventfd F
+GLIBC_2.31 eventfd_read F
+GLIBC_2.31 eventfd_write F
+GLIBC_2.31 execl F
+GLIBC_2.31 execle F
+GLIBC_2.31 execlp F
+GLIBC_2.31 execv F
+GLIBC_2.31 execve F
+GLIBC_2.31 execvp F
+GLIBC_2.31 execvpe F
+GLIBC_2.31 exit F
+GLIBC_2.31 explicit_bzero F
+GLIBC_2.31 faccessat F
+GLIBC_2.31 fallocate F
+GLIBC_2.31 fallocate64 F
+GLIBC_2.31 fanotify_init F
+GLIBC_2.31 fanotify_mark F
+GLIBC_2.31 fattach F
+GLIBC_2.31 fchdir F
+GLIBC_2.31 fchflags F
+GLIBC_2.31 fchmod F
+GLIBC_2.31 fchmodat F
+GLIBC_2.31 fchown F
+GLIBC_2.31 fchownat F
+GLIBC_2.31 fclose F
+GLIBC_2.31 fcloseall F
+GLIBC_2.31 fcntl F
+GLIBC_2.31 fcntl64 F
+GLIBC_2.31 fcvt F
+GLIBC_2.31 fcvt_r F
+GLIBC_2.31 fdatasync F
+GLIBC_2.31 fdetach F
+GLIBC_2.31 fdopen F
+GLIBC_2.31 fdopendir F
+GLIBC_2.31 feof F
+GLIBC_2.31 feof_unlocked F
+GLIBC_2.31 ferror F
+GLIBC_2.31 ferror_unlocked F
+GLIBC_2.31 fexecve F
+GLIBC_2.31 fflush F
+GLIBC_2.31 fflush_unlocked F
+GLIBC_2.31 ffs F
+GLIBC_2.31 ffsl F
+GLIBC_2.31 ffsll F
+GLIBC_2.31 fgetc F
+GLIBC_2.31 fgetc_unlocked F
+GLIBC_2.31 fgetgrent F
+GLIBC_2.31 fgetgrent_r F
+GLIBC_2.31 fgetpos F
+GLIBC_2.31 fgetpos64 F
+GLIBC_2.31 fgetpwent F
+GLIBC_2.31 fgetpwent_r F
+GLIBC_2.31 fgets F
+GLIBC_2.31 fgets_unlocked F
+GLIBC_2.31 fgetsgent F
+GLIBC_2.31 fgetsgent_r F
+GLIBC_2.31 fgetspent F
+GLIBC_2.31 fgetspent_r F
+GLIBC_2.31 fgetwc F
+GLIBC_2.31 fgetwc_unlocked F
+GLIBC_2.31 fgetws F
+GLIBC_2.31 fgetws_unlocked F
+GLIBC_2.31 fgetxattr F
+GLIBC_2.31 fileno F
+GLIBC_2.31 fileno_unlocked F
+GLIBC_2.31 finite F
+GLIBC_2.31 finitef F
+GLIBC_2.31 finitel F
+GLIBC_2.31 flistxattr F
+GLIBC_2.31 flock F
+GLIBC_2.31 flockfile F
+GLIBC_2.31 fmemopen F
+GLIBC_2.31 fmtmsg F
+GLIBC_2.31 fnmatch F
+GLIBC_2.31 fopen F
+GLIBC_2.31 fopen64 F
+GLIBC_2.31 fopencookie F
+GLIBC_2.31 fork F
+GLIBC_2.31 fpathconf F
+GLIBC_2.31 fprintf F
+GLIBC_2.31 fputc F
+GLIBC_2.31 fputc_unlocked F
+GLIBC_2.31 fputs F
+GLIBC_2.31 fputs_unlocked F
+GLIBC_2.31 fputwc F
+GLIBC_2.31 fputwc_unlocked F
+GLIBC_2.31 fputws F
+GLIBC_2.31 fputws_unlocked F
+GLIBC_2.31 fread F
+GLIBC_2.31 fread_unlocked F
+GLIBC_2.31 free F
+GLIBC_2.31 freeaddrinfo F
+GLIBC_2.31 freeifaddrs F
+GLIBC_2.31 freelocale F
+GLIBC_2.31 fremovexattr F
+GLIBC_2.31 freopen F
+GLIBC_2.31 freopen64 F
+GLIBC_2.31 frexp F
+GLIBC_2.31 frexpf F
+GLIBC_2.31 frexpl F
+GLIBC_2.31 fscanf F
+GLIBC_2.31 fseek F
+GLIBC_2.31 fseeko F
+GLIBC_2.31 fseeko64 F
+GLIBC_2.31 fsetpos F
+GLIBC_2.31 fsetpos64 F
+GLIBC_2.31 fsetxattr F
+GLIBC_2.31 fstatfs F
+GLIBC_2.31 fstatfs64 F
+GLIBC_2.31 fstatvfs F
+GLIBC_2.31 fstatvfs64 F
+GLIBC_2.31 fsync F
+GLIBC_2.31 ftell F
+GLIBC_2.31 ftello F
+GLIBC_2.31 ftello64 F
+GLIBC_2.31 ftime F
+GLIBC_2.31 ftok F
+GLIBC_2.31 ftruncate F
+GLIBC_2.31 ftruncate64 F
+GLIBC_2.31 ftrylockfile F
+GLIBC_2.31 fts64_children F
+GLIBC_2.31 fts64_close F
+GLIBC_2.31 fts64_open F
+GLIBC_2.31 fts64_read F
+GLIBC_2.31 fts64_set F
+GLIBC_2.31 fts_children F
+GLIBC_2.31 fts_close F
+GLIBC_2.31 fts_open F
+GLIBC_2.31 fts_read F
+GLIBC_2.31 fts_set F
+GLIBC_2.31 ftw F
+GLIBC_2.31 ftw64 F
+GLIBC_2.31 funlockfile F
+GLIBC_2.31 futimens F
+GLIBC_2.31 futimes F
+GLIBC_2.31 futimesat F
+GLIBC_2.31 fwide F
+GLIBC_2.31 fwprintf F
+GLIBC_2.31 fwrite F
+GLIBC_2.31 fwrite_unlocked F
+GLIBC_2.31 fwscanf F
+GLIBC_2.31 gai_strerror F
+GLIBC_2.31 gcvt F
+GLIBC_2.31 get_avphys_pages F
+GLIBC_2.31 get_current_dir_name F
+GLIBC_2.31 get_myaddress F
+GLIBC_2.31 get_nprocs F
+GLIBC_2.31 get_nprocs_conf F
+GLIBC_2.31 get_phys_pages F
+GLIBC_2.31 getaddrinfo F
+GLIBC_2.31 getaliasbyname F
+GLIBC_2.31 getaliasbyname_r F
+GLIBC_2.31 getaliasent F
+GLIBC_2.31 getaliasent_r F
+GLIBC_2.31 getauxval F
+GLIBC_2.31 getc F
+GLIBC_2.31 getc_unlocked F
+GLIBC_2.31 getchar F
+GLIBC_2.31 getchar_unlocked F
+GLIBC_2.31 getcontext F
+GLIBC_2.31 getcpu F
+GLIBC_2.31 getcwd F
+GLIBC_2.31 getdate F
+GLIBC_2.31 getdate_err D 0x4
+GLIBC_2.31 getdate_r F
+GLIBC_2.31 getdelim F
+GLIBC_2.31 getdirentries F
+GLIBC_2.31 getdirentries64 F
+GLIBC_2.31 getdomainname F
+GLIBC_2.31 getdtablesize F
+GLIBC_2.31 getegid F
+GLIBC_2.31 getentropy F
+GLIBC_2.31 getenv F
+GLIBC_2.31 geteuid F
+GLIBC_2.31 getfsent F
+GLIBC_2.31 getfsfile F
+GLIBC_2.31 getfsspec F
+GLIBC_2.31 getgid F
+GLIBC_2.31 getgrent F
+GLIBC_2.31 getgrent_r F
+GLIBC_2.31 getgrgid F
+GLIBC_2.31 getgrgid_r F
+GLIBC_2.31 getgrnam F
+GLIBC_2.31 getgrnam_r F
+GLIBC_2.31 getgrouplist F
+GLIBC_2.31 getgroups F
+GLIBC_2.31 gethostbyaddr F
+GLIBC_2.31 gethostbyaddr_r F
+GLIBC_2.31 gethostbyname F
+GLIBC_2.31 gethostbyname2 F
+GLIBC_2.31 gethostbyname2_r F
+GLIBC_2.31 gethostbyname_r F
+GLIBC_2.31 gethostent F
+GLIBC_2.31 gethostent_r F
+GLIBC_2.31 gethostid F
+GLIBC_2.31 gethostname F
+GLIBC_2.31 getifaddrs F
+GLIBC_2.31 getipv4sourcefilter F
+GLIBC_2.31 getitimer F
+GLIBC_2.31 getline F
+GLIBC_2.31 getloadavg F
+GLIBC_2.31 getlogin F
+GLIBC_2.31 getlogin_r F
+GLIBC_2.31 getmntent F
+GLIBC_2.31 getmntent_r F
+GLIBC_2.31 getmsg F
+GLIBC_2.31 getnameinfo F
+GLIBC_2.31 getnetbyaddr F
+GLIBC_2.31 getnetbyaddr_r F
+GLIBC_2.31 getnetbyname F
+GLIBC_2.31 getnetbyname_r F
+GLIBC_2.31 getnetent F
+GLIBC_2.31 getnetent_r F
+GLIBC_2.31 getnetgrent F
+GLIBC_2.31 getnetgrent_r F
+GLIBC_2.31 getnetname F
+GLIBC_2.31 getopt F
+GLIBC_2.31 getopt_long F
+GLIBC_2.31 getopt_long_only F
+GLIBC_2.31 getpagesize F
+GLIBC_2.31 getpass F
+GLIBC_2.31 getpeername F
+GLIBC_2.31 getpgid F
+GLIBC_2.31 getpgrp F
+GLIBC_2.31 getpid F
+GLIBC_2.31 getpmsg F
+GLIBC_2.31 getppid F
+GLIBC_2.31 getpriority F
+GLIBC_2.31 getprotobyname F
+GLIBC_2.31 getprotobyname_r F
+GLIBC_2.31 getprotobynumber F
+GLIBC_2.31 getprotobynumber_r F
+GLIBC_2.31 getprotoent F
+GLIBC_2.31 getprotoent_r F
+GLIBC_2.31 getpt F
+GLIBC_2.31 getpublickey F
+GLIBC_2.31 getpw F
+GLIBC_2.31 getpwent F
+GLIBC_2.31 getpwent_r F
+GLIBC_2.31 getpwnam F
+GLIBC_2.31 getpwnam_r F
+GLIBC_2.31 getpwuid F
+GLIBC_2.31 getpwuid_r F
+GLIBC_2.31 getrandom F
+GLIBC_2.31 getresgid F
+GLIBC_2.31 getresuid F
+GLIBC_2.31 getrlimit F
+GLIBC_2.31 getrlimit64 F
+GLIBC_2.31 getrpcbyname F
+GLIBC_2.31 getrpcbyname_r F
+GLIBC_2.31 getrpcbynumber F
+GLIBC_2.31 getrpcbynumber_r F
+GLIBC_2.31 getrpcent F
+GLIBC_2.31 getrpcent_r F
+GLIBC_2.31 getrpcport F
+GLIBC_2.31 getrusage F
+GLIBC_2.31 gets F
+GLIBC_2.31 getsecretkey F
+GLIBC_2.31 getservbyname F
+GLIBC_2.31 getservbyname_r F
+GLIBC_2.31 getservbyport F
+GLIBC_2.31 getservbyport_r F
+GLIBC_2.31 getservent F
+GLIBC_2.31 getservent_r F
+GLIBC_2.31 getsgent F
+GLIBC_2.31 getsgent_r F
+GLIBC_2.31 getsgnam F
+GLIBC_2.31 getsgnam_r F
+GLIBC_2.31 getsid F
+GLIBC_2.31 getsockname F
+GLIBC_2.31 getsockopt F
+GLIBC_2.31 getsourcefilter F
+GLIBC_2.31 getspent F
+GLIBC_2.31 getspent_r F
+GLIBC_2.31 getspnam F
+GLIBC_2.31 getspnam_r F
+GLIBC_2.31 getsubopt F
+GLIBC_2.31 gettext F
+GLIBC_2.31 gettimeofday F
+GLIBC_2.31 getttyent F
+GLIBC_2.31 getttynam F
+GLIBC_2.31 getuid F
+GLIBC_2.31 getusershell F
+GLIBC_2.31 getutent F
+GLIBC_2.31 getutent_r F
+GLIBC_2.31 getutid F
+GLIBC_2.31 getutid_r F
+GLIBC_2.31 getutline F
+GLIBC_2.31 getutline_r F
+GLIBC_2.31 getutmp F
+GLIBC_2.31 getutmpx F
+GLIBC_2.31 getutxent F
+GLIBC_2.31 getutxid F
+GLIBC_2.31 getutxline F
+GLIBC_2.31 getw F
+GLIBC_2.31 getwc F
+GLIBC_2.31 getwc_unlocked F
+GLIBC_2.31 getwchar F
+GLIBC_2.31 getwchar_unlocked F
+GLIBC_2.31 getwd F
+GLIBC_2.31 getxattr F
+GLIBC_2.31 glob F
+GLIBC_2.31 glob64 F
+GLIBC_2.31 glob_pattern_p F
+GLIBC_2.31 globfree F
+GLIBC_2.31 globfree64 F
+GLIBC_2.31 gmtime F
+GLIBC_2.31 gmtime_r F
+GLIBC_2.31 gnu_dev_major F
+GLIBC_2.31 gnu_dev_makedev F
+GLIBC_2.31 gnu_dev_minor F
+GLIBC_2.31 gnu_get_libc_release F
+GLIBC_2.31 gnu_get_libc_version F
+GLIBC_2.31 grantpt F
+GLIBC_2.31 group_member F
+GLIBC_2.31 gsignal F
+GLIBC_2.31 gtty F
+GLIBC_2.31 h_errlist D 0x14
+GLIBC_2.31 h_nerr D 0x4
+GLIBC_2.31 hasmntopt F
+GLIBC_2.31 hcreate F
+GLIBC_2.31 hcreate_r F
+GLIBC_2.31 hdestroy F
+GLIBC_2.31 hdestroy_r F
+GLIBC_2.31 herror F
+GLIBC_2.31 host2netname F
+GLIBC_2.31 hsearch F
+GLIBC_2.31 hsearch_r F
+GLIBC_2.31 hstrerror F
+GLIBC_2.31 htonl F
+GLIBC_2.31 htons F
+GLIBC_2.31 iconv F
+GLIBC_2.31 iconv_close F
+GLIBC_2.31 iconv_open F
+GLIBC_2.31 if_freenameindex F
+GLIBC_2.31 if_indextoname F
+GLIBC_2.31 if_nameindex F
+GLIBC_2.31 if_nametoindex F
+GLIBC_2.31 imaxabs F
+GLIBC_2.31 imaxdiv F
+GLIBC_2.31 in6addr_any D 0x10
+GLIBC_2.31 in6addr_loopback D 0x10
+GLIBC_2.31 index F
+GLIBC_2.31 inet6_opt_append F
+GLIBC_2.31 inet6_opt_find F
+GLIBC_2.31 inet6_opt_finish F
+GLIBC_2.31 inet6_opt_get_val F
+GLIBC_2.31 inet6_opt_init F
+GLIBC_2.31 inet6_opt_next F
+GLIBC_2.31 inet6_opt_set_val F
+GLIBC_2.31 inet6_option_alloc F
+GLIBC_2.31 inet6_option_append F
+GLIBC_2.31 inet6_option_find F
+GLIBC_2.31 inet6_option_init F
+GLIBC_2.31 inet6_option_next F
+GLIBC_2.31 inet6_option_space F
+GLIBC_2.31 inet6_rth_add F
+GLIBC_2.31 inet6_rth_getaddr F
+GLIBC_2.31 inet6_rth_init F
+GLIBC_2.31 inet6_rth_reverse F
+GLIBC_2.31 inet6_rth_segments F
+GLIBC_2.31 inet6_rth_space F
+GLIBC_2.31 inet_addr F
+GLIBC_2.31 inet_aton F
+GLIBC_2.31 inet_lnaof F
+GLIBC_2.31 inet_makeaddr F
+GLIBC_2.31 inet_netof F
+GLIBC_2.31 inet_network F
+GLIBC_2.31 inet_nsap_addr F
+GLIBC_2.31 inet_nsap_ntoa F
+GLIBC_2.31 inet_ntoa F
+GLIBC_2.31 inet_ntop F
+GLIBC_2.31 inet_pton F
+GLIBC_2.31 init_module F
+GLIBC_2.31 initgroups F
+GLIBC_2.31 initstate F
+GLIBC_2.31 initstate_r F
+GLIBC_2.31 innetgr F
+GLIBC_2.31 inotify_add_watch F
+GLIBC_2.31 inotify_init F
+GLIBC_2.31 inotify_init1 F
+GLIBC_2.31 inotify_rm_watch F
+GLIBC_2.31 insque F
+GLIBC_2.31 ioctl F
+GLIBC_2.31 iruserok F
+GLIBC_2.31 iruserok_af F
+GLIBC_2.31 isalnum F
+GLIBC_2.31 isalnum_l F
+GLIBC_2.31 isalpha F
+GLIBC_2.31 isalpha_l F
+GLIBC_2.31 isascii F
+GLIBC_2.31 isastream F
+GLIBC_2.31 isatty F
+GLIBC_2.31 isblank F
+GLIBC_2.31 isblank_l F
+GLIBC_2.31 iscntrl F
+GLIBC_2.31 iscntrl_l F
+GLIBC_2.31 isctype F
+GLIBC_2.31 isdigit F
+GLIBC_2.31 isdigit_l F
+GLIBC_2.31 isfdtype F
+GLIBC_2.31 isgraph F
+GLIBC_2.31 isgraph_l F
+GLIBC_2.31 isinf F
+GLIBC_2.31 isinff F
+GLIBC_2.31 isinfl F
+GLIBC_2.31 islower F
+GLIBC_2.31 islower_l F
+GLIBC_2.31 isnan F
+GLIBC_2.31 isnanf F
+GLIBC_2.31 isnanl F
+GLIBC_2.31 isprint F
+GLIBC_2.31 isprint_l F
+GLIBC_2.31 ispunct F
+GLIBC_2.31 ispunct_l F
+GLIBC_2.31 isspace F
+GLIBC_2.31 isspace_l F
+GLIBC_2.31 isupper F
+GLIBC_2.31 isupper_l F
+GLIBC_2.31 iswalnum F
+GLIBC_2.31 iswalnum_l F
+GLIBC_2.31 iswalpha F
+GLIBC_2.31 iswalpha_l F
+GLIBC_2.31 iswblank F
+GLIBC_2.31 iswblank_l F
+GLIBC_2.31 iswcntrl F
+GLIBC_2.31 iswcntrl_l F
+GLIBC_2.31 iswctype F
+GLIBC_2.31 iswctype_l F
+GLIBC_2.31 iswdigit F
+GLIBC_2.31 iswdigit_l F
+GLIBC_2.31 iswgraph F
+GLIBC_2.31 iswgraph_l F
+GLIBC_2.31 iswlower F
+GLIBC_2.31 iswlower_l F
+GLIBC_2.31 iswprint F
+GLIBC_2.31 iswprint_l F
+GLIBC_2.31 iswpunct F
+GLIBC_2.31 iswpunct_l F
+GLIBC_2.31 iswspace F
+GLIBC_2.31 iswspace_l F
+GLIBC_2.31 iswupper F
+GLIBC_2.31 iswupper_l F
+GLIBC_2.31 iswxdigit F
+GLIBC_2.31 iswxdigit_l F
+GLIBC_2.31 isxdigit F
+GLIBC_2.31 isxdigit_l F
+GLIBC_2.31 jrand48 F
+GLIBC_2.31 jrand48_r F
+GLIBC_2.31 key_decryptsession F
+GLIBC_2.31 key_decryptsession_pk F
+GLIBC_2.31 key_encryptsession F
+GLIBC_2.31 key_encryptsession_pk F
+GLIBC_2.31 key_gendes F
+GLIBC_2.31 key_get_conv F
+GLIBC_2.31 key_secretkey_is_set F
+GLIBC_2.31 key_setnet F
+GLIBC_2.31 key_setsecret F
+GLIBC_2.31 kill F
+GLIBC_2.31 killpg F
+GLIBC_2.31 klogctl F
+GLIBC_2.31 l64a F
+GLIBC_2.31 labs F
+GLIBC_2.31 lchmod F
+GLIBC_2.31 lchown F
+GLIBC_2.31 lckpwdf F
+GLIBC_2.31 lcong48 F
+GLIBC_2.31 lcong48_r F
+GLIBC_2.31 ldexp F
+GLIBC_2.31 ldexpf F
+GLIBC_2.31 ldexpl F
+GLIBC_2.31 ldiv F
+GLIBC_2.31 lfind F
+GLIBC_2.31 lgetxattr F
+GLIBC_2.31 link F
+GLIBC_2.31 linkat F
+GLIBC_2.31 listen F
+GLIBC_2.31 listxattr F
+GLIBC_2.31 llabs F
+GLIBC_2.31 lldiv F
+GLIBC_2.31 llistxattr F
+GLIBC_2.31 localeconv F
+GLIBC_2.31 localtime F
+GLIBC_2.31 localtime_r F
+GLIBC_2.31 lockf F
+GLIBC_2.31 lockf64 F
+GLIBC_2.31 longjmp F
+GLIBC_2.31 lrand48 F
+GLIBC_2.31 lrand48_r F
+GLIBC_2.31 lremovexattr F
+GLIBC_2.31 lsearch F
+GLIBC_2.31 lseek F
+GLIBC_2.31 lseek64 F
+GLIBC_2.31 lsetxattr F
+GLIBC_2.31 lutimes F
+GLIBC_2.31 madvise F
+GLIBC_2.31 makecontext F
+GLIBC_2.31 mallinfo F
+GLIBC_2.31 malloc F
+GLIBC_2.31 malloc_info F
+GLIBC_2.31 malloc_stats F
+GLIBC_2.31 malloc_trim F
+GLIBC_2.31 malloc_usable_size F
+GLIBC_2.31 mallopt F
+GLIBC_2.31 mallwatch D 0x4
+GLIBC_2.31 mblen F
+GLIBC_2.31 mbrlen F
+GLIBC_2.31 mbrtoc16 F
+GLIBC_2.31 mbrtoc32 F
+GLIBC_2.31 mbrtowc F
+GLIBC_2.31 mbsinit F
+GLIBC_2.31 mbsnrtowcs F
+GLIBC_2.31 mbsrtowcs F
+GLIBC_2.31 mbstowcs F
+GLIBC_2.31 mbtowc F
+GLIBC_2.31 mcheck F
+GLIBC_2.31 mcheck_check_all F
+GLIBC_2.31 mcheck_pedantic F
+GLIBC_2.31 memalign F
+GLIBC_2.31 memccpy F
+GLIBC_2.31 memchr F
+GLIBC_2.31 memcmp F
+GLIBC_2.31 memcpy F
+GLIBC_2.31 memfd_create F
+GLIBC_2.31 memfrob F
+GLIBC_2.31 memmem F
+GLIBC_2.31 memmove F
+GLIBC_2.31 mempcpy F
+GLIBC_2.31 memrchr F
+GLIBC_2.31 memset F
+GLIBC_2.31 mincore F
+GLIBC_2.31 mkdir F
+GLIBC_2.31 mkdirat F
+GLIBC_2.31 mkdtemp F
+GLIBC_2.31 mkfifo F
+GLIBC_2.31 mkfifoat F
+GLIBC_2.31 mkostemp F
+GLIBC_2.31 mkostemp64 F
+GLIBC_2.31 mkostemps F
+GLIBC_2.31 mkostemps64 F
+GLIBC_2.31 mkstemp F
+GLIBC_2.31 mkstemp64 F
+GLIBC_2.31 mkstemps F
+GLIBC_2.31 mkstemps64 F
+GLIBC_2.31 mktemp F
+GLIBC_2.31 mktime F
+GLIBC_2.31 mlock F
+GLIBC_2.31 mlock2 F
+GLIBC_2.31 mlockall F
+GLIBC_2.31 mmap F
+GLIBC_2.31 mmap64 F
+GLIBC_2.31 modf F
+GLIBC_2.31 modff F
+GLIBC_2.31 modfl F
+GLIBC_2.31 moncontrol F
+GLIBC_2.31 monstartup F
+GLIBC_2.31 mount F
+GLIBC_2.31 mprobe F
+GLIBC_2.31 mprotect F
+GLIBC_2.31 mrand48 F
+GLIBC_2.31 mrand48_r F
+GLIBC_2.31 mremap F
+GLIBC_2.31 msgctl F
+GLIBC_2.31 msgget F
+GLIBC_2.31 msgrcv F
+GLIBC_2.31 msgsnd F
+GLIBC_2.31 msync F
+GLIBC_2.31 mtrace F
+GLIBC_2.31 munlock F
+GLIBC_2.31 munlockall F
+GLIBC_2.31 munmap F
+GLIBC_2.31 muntrace F
+GLIBC_2.31 name_to_handle_at F
+GLIBC_2.31 nanosleep F
+GLIBC_2.31 netname2host F
+GLIBC_2.31 netname2user F
+GLIBC_2.31 newlocale F
+GLIBC_2.31 nftw F
+GLIBC_2.31 nftw64 F
+GLIBC_2.31 ngettext F
+GLIBC_2.31 nice F
+GLIBC_2.31 nl_langinfo F
+GLIBC_2.31 nl_langinfo_l F
+GLIBC_2.31 nrand48 F
+GLIBC_2.31 nrand48_r F
+GLIBC_2.31 ntohl F
+GLIBC_2.31 ntohs F
+GLIBC_2.31 ntp_adjtime F
+GLIBC_2.31 ntp_gettime F
+GLIBC_2.31 ntp_gettimex F
+GLIBC_2.31 obstack_alloc_failed_handler D 0x4
+GLIBC_2.31 obstack_exit_failure D 0x4
+GLIBC_2.31 obstack_free F
+GLIBC_2.31 obstack_printf F
+GLIBC_2.31 obstack_vprintf F
+GLIBC_2.31 on_exit F
+GLIBC_2.31 open F
+GLIBC_2.31 open64 F
+GLIBC_2.31 open_by_handle_at F
+GLIBC_2.31 open_memstream F
+GLIBC_2.31 open_wmemstream F
+GLIBC_2.31 openat F
+GLIBC_2.31 openat64 F
+GLIBC_2.31 opendir F
+GLIBC_2.31 openlog F
+GLIBC_2.31 optarg D 0x4
+GLIBC_2.31 opterr D 0x4
+GLIBC_2.31 optind D 0x4
+GLIBC_2.31 optopt D 0x4
+GLIBC_2.31 parse_printf_format F
+GLIBC_2.31 passwd2des F
+GLIBC_2.31 pathconf F
+GLIBC_2.31 pause F
+GLIBC_2.31 pclose F
+GLIBC_2.31 perror F
+GLIBC_2.31 personality F
+GLIBC_2.31 pipe F
+GLIBC_2.31 pipe2 F
+GLIBC_2.31 pivot_root F
+GLIBC_2.31 pkey_alloc F
+GLIBC_2.31 pkey_free F
+GLIBC_2.31 pkey_get F
+GLIBC_2.31 pkey_mprotect F
+GLIBC_2.31 pkey_set F
+GLIBC_2.31 pmap_getmaps F
+GLIBC_2.31 pmap_getport F
+GLIBC_2.31 pmap_rmtcall F
+GLIBC_2.31 pmap_set F
+GLIBC_2.31 pmap_unset F
+GLIBC_2.31 poll F
+GLIBC_2.31 popen F
+GLIBC_2.31 posix_fadvise F
+GLIBC_2.31 posix_fadvise64 F
+GLIBC_2.31 posix_fallocate F
+GLIBC_2.31 posix_fallocate64 F
+GLIBC_2.31 posix_madvise F
+GLIBC_2.31 posix_memalign F
+GLIBC_2.31 posix_openpt F
+GLIBC_2.31 posix_spawn F
+GLIBC_2.31 posix_spawn_file_actions_addchdir_np F
+GLIBC_2.31 posix_spawn_file_actions_addclose F
+GLIBC_2.31 posix_spawn_file_actions_adddup2 F
+GLIBC_2.31 posix_spawn_file_actions_addfchdir_np F
+GLIBC_2.31 posix_spawn_file_actions_addopen F
+GLIBC_2.31 posix_spawn_file_actions_destroy F
+GLIBC_2.31 posix_spawn_file_actions_init F
+GLIBC_2.31 posix_spawnattr_destroy F
+GLIBC_2.31 posix_spawnattr_getflags F
+GLIBC_2.31 posix_spawnattr_getpgroup F
+GLIBC_2.31 posix_spawnattr_getschedparam F
+GLIBC_2.31 posix_spawnattr_getschedpolicy F
+GLIBC_2.31 posix_spawnattr_getsigdefault F
+GLIBC_2.31 posix_spawnattr_getsigmask F
+GLIBC_2.31 posix_spawnattr_init F
+GLIBC_2.31 posix_spawnattr_setflags F
+GLIBC_2.31 posix_spawnattr_setpgroup F
+GLIBC_2.31 posix_spawnattr_setschedparam F
+GLIBC_2.31 posix_spawnattr_setschedpolicy F
+GLIBC_2.31 posix_spawnattr_setsigdefault F
+GLIBC_2.31 posix_spawnattr_setsigmask F
+GLIBC_2.31 posix_spawnp F
+GLIBC_2.31 ppoll F
+GLIBC_2.31 prctl F
+GLIBC_2.31 pread F
+GLIBC_2.31 pread64 F
+GLIBC_2.31 preadv F
+GLIBC_2.31 preadv2 F
+GLIBC_2.31 preadv64 F
+GLIBC_2.31 preadv64v2 F
+GLIBC_2.31 printf F
+GLIBC_2.31 printf_size F
+GLIBC_2.31 printf_size_info F
+GLIBC_2.31 prlimit F
+GLIBC_2.31 prlimit64 F
+GLIBC_2.31 process_vm_readv F
+GLIBC_2.31 process_vm_writev F
+GLIBC_2.31 profil F
+GLIBC_2.31 program_invocation_name D 0x4
+GLIBC_2.31 program_invocation_short_name D 0x4
+GLIBC_2.31 pselect F
+GLIBC_2.31 psiginfo F
+GLIBC_2.31 psignal F
+GLIBC_2.31 pthread_attr_destroy F
+GLIBC_2.31 pthread_attr_getdetachstate F
+GLIBC_2.31 pthread_attr_getinheritsched F
+GLIBC_2.31 pthread_attr_getschedparam F
+GLIBC_2.31 pthread_attr_getschedpolicy F
+GLIBC_2.31 pthread_attr_getscope F
+GLIBC_2.31 pthread_attr_init F
+GLIBC_2.31 pthread_attr_setdetachstate F
+GLIBC_2.31 pthread_attr_setinheritsched F
+GLIBC_2.31 pthread_attr_setschedparam F
+GLIBC_2.31 pthread_attr_setschedpolicy F
+GLIBC_2.31 pthread_attr_setscope F
+GLIBC_2.31 pthread_cond_broadcast F
+GLIBC_2.31 pthread_cond_destroy F
+GLIBC_2.31 pthread_cond_init F
+GLIBC_2.31 pthread_cond_signal F
+GLIBC_2.31 pthread_cond_timedwait F
+GLIBC_2.31 pthread_cond_wait F
+GLIBC_2.31 pthread_condattr_destroy F
+GLIBC_2.31 pthread_condattr_init F
+GLIBC_2.31 pthread_equal F
+GLIBC_2.31 pthread_exit F
+GLIBC_2.31 pthread_getschedparam F
+GLIBC_2.31 pthread_mutex_destroy F
+GLIBC_2.31 pthread_mutex_init F
+GLIBC_2.31 pthread_mutex_lock F
+GLIBC_2.31 pthread_mutex_unlock F
+GLIBC_2.31 pthread_self F
+GLIBC_2.31 pthread_setcancelstate F
+GLIBC_2.31 pthread_setcanceltype F
+GLIBC_2.31 pthread_setschedparam F
+GLIBC_2.31 ptrace F
+GLIBC_2.31 ptsname F
+GLIBC_2.31 ptsname_r F
+GLIBC_2.31 putc F
+GLIBC_2.31 putc_unlocked F
+GLIBC_2.31 putchar F
+GLIBC_2.31 putchar_unlocked F
+GLIBC_2.31 putenv F
+GLIBC_2.31 putgrent F
+GLIBC_2.31 putmsg F
+GLIBC_2.31 putpmsg F
+GLIBC_2.31 putpwent F
+GLIBC_2.31 puts F
+GLIBC_2.31 putsgent F
+GLIBC_2.31 putspent F
+GLIBC_2.31 pututline F
+GLIBC_2.31 pututxline F
+GLIBC_2.31 putw F
+GLIBC_2.31 putwc F
+GLIBC_2.31 putwc_unlocked F
+GLIBC_2.31 putwchar F
+GLIBC_2.31 putwchar_unlocked F
+GLIBC_2.31 pvalloc F
+GLIBC_2.31 pwrite F
+GLIBC_2.31 pwrite64 F
+GLIBC_2.31 pwritev F
+GLIBC_2.31 pwritev2 F
+GLIBC_2.31 pwritev64 F
+GLIBC_2.31 pwritev64v2 F
+GLIBC_2.31 qecvt F
+GLIBC_2.31 qecvt_r F
+GLIBC_2.31 qfcvt F
+GLIBC_2.31 qfcvt_r F
+GLIBC_2.31 qgcvt F
+GLIBC_2.31 qsort F
+GLIBC_2.31 qsort_r F
+GLIBC_2.31 quick_exit F
+GLIBC_2.31 quotactl F
+GLIBC_2.31 raise F
+GLIBC_2.31 rand F
+GLIBC_2.31 rand_r F
+GLIBC_2.31 random F
+GLIBC_2.31 random_r F
+GLIBC_2.31 rawmemchr F
+GLIBC_2.31 rcmd F
+GLIBC_2.31 rcmd_af F
+GLIBC_2.31 re_comp F
+GLIBC_2.31 re_compile_fastmap F
+GLIBC_2.31 re_compile_pattern F
+GLIBC_2.31 re_exec F
+GLIBC_2.31 re_match F
+GLIBC_2.31 re_match_2 F
+GLIBC_2.31 re_search F
+GLIBC_2.31 re_search_2 F
+GLIBC_2.31 re_set_registers F
+GLIBC_2.31 re_set_syntax F
+GLIBC_2.31 re_syntax_options D 0x4
+GLIBC_2.31 read F
+GLIBC_2.31 readahead F
+GLIBC_2.31 readdir F
+GLIBC_2.31 readdir64 F
+GLIBC_2.31 readdir64_r F
+GLIBC_2.31 readdir_r F
+GLIBC_2.31 readlink F
+GLIBC_2.31 readlinkat F
+GLIBC_2.31 readv F
+GLIBC_2.31 realloc F
+GLIBC_2.31 reallocarray F
+GLIBC_2.31 realpath F
+GLIBC_2.31 reboot F
+GLIBC_2.31 recv F
+GLIBC_2.31 recvfrom F
+GLIBC_2.31 recvmmsg F
+GLIBC_2.31 recvmsg F
+GLIBC_2.31 regcomp F
+GLIBC_2.31 regerror F
+GLIBC_2.31 regexec F
+GLIBC_2.31 regfree F
+GLIBC_2.31 register_printf_function F
+GLIBC_2.31 register_printf_modifier F
+GLIBC_2.31 register_printf_specifier F
+GLIBC_2.31 register_printf_type F
+GLIBC_2.31 registerrpc F
+GLIBC_2.31 remap_file_pages F
+GLIBC_2.31 remove F
+GLIBC_2.31 removexattr F
+GLIBC_2.31 remque F
+GLIBC_2.31 rename F
+GLIBC_2.31 renameat F
+GLIBC_2.31 renameat2 F
+GLIBC_2.31 revoke F
+GLIBC_2.31 rewind F
+GLIBC_2.31 rewinddir F
+GLIBC_2.31 rexec F
+GLIBC_2.31 rexec_af F
+GLIBC_2.31 rexecoptions D 0x4
+GLIBC_2.31 rindex F
+GLIBC_2.31 rmdir F
+GLIBC_2.31 rpc_createerr D 0x10
+GLIBC_2.31 rpmatch F
+GLIBC_2.31 rresvport F
+GLIBC_2.31 rresvport_af F
+GLIBC_2.31 rtime F
+GLIBC_2.31 ruserok F
+GLIBC_2.31 ruserok_af F
+GLIBC_2.31 ruserpass F
+GLIBC_2.31 sbrk F
+GLIBC_2.31 scalbn F
+GLIBC_2.31 scalbnf F
+GLIBC_2.31 scalbnl F
+GLIBC_2.31 scandir F
+GLIBC_2.31 scandir64 F
+GLIBC_2.31 scandirat F
+GLIBC_2.31 scandirat64 F
+GLIBC_2.31 scanf F
+GLIBC_2.31 sched_get_priority_max F
+GLIBC_2.31 sched_get_priority_min F
+GLIBC_2.31 sched_getaffinity F
+GLIBC_2.31 sched_getcpu F
+GLIBC_2.31 sched_getparam F
+GLIBC_2.31 sched_getscheduler F
+GLIBC_2.31 sched_rr_get_interval F
+GLIBC_2.31 sched_setaffinity F
+GLIBC_2.31 sched_setparam F
+GLIBC_2.31 sched_setscheduler F
+GLIBC_2.31 sched_yield F
+GLIBC_2.31 secure_getenv F
+GLIBC_2.31 seed48 F
+GLIBC_2.31 seed48_r F
+GLIBC_2.31 seekdir F
+GLIBC_2.31 select F
+GLIBC_2.31 semctl F
+GLIBC_2.31 semget F
+GLIBC_2.31 semop F
+GLIBC_2.31 semtimedop F
+GLIBC_2.31 send F
+GLIBC_2.31 sendfile F
+GLIBC_2.31 sendfile64 F
+GLIBC_2.31 sendmmsg F
+GLIBC_2.31 sendmsg F
+GLIBC_2.31 sendto F
+GLIBC_2.31 setaliasent F
+GLIBC_2.31 setbuf F
+GLIBC_2.31 setbuffer F
+GLIBC_2.31 setcontext F
+GLIBC_2.31 setdomainname F
+GLIBC_2.31 setegid F
+GLIBC_2.31 setenv F
+GLIBC_2.31 seteuid F
+GLIBC_2.31 setfsent F
+GLIBC_2.31 setfsgid F
+GLIBC_2.31 setfsuid F
+GLIBC_2.31 setgid F
+GLIBC_2.31 setgrent F
+GLIBC_2.31 setgroups F
+GLIBC_2.31 sethostent F
+GLIBC_2.31 sethostid F
+GLIBC_2.31 sethostname F
+GLIBC_2.31 setipv4sourcefilter F
+GLIBC_2.31 setitimer F
+GLIBC_2.31 setjmp F
+GLIBC_2.31 setlinebuf F
+GLIBC_2.31 setlocale F
+GLIBC_2.31 setlogin F
+GLIBC_2.31 setlogmask F
+GLIBC_2.31 setmntent F
+GLIBC_2.31 setnetent F
+GLIBC_2.31 setnetgrent F
+GLIBC_2.31 setns F
+GLIBC_2.31 setpgid F
+GLIBC_2.31 setpgrp F
+GLIBC_2.31 setpriority F
+GLIBC_2.31 setprotoent F
+GLIBC_2.31 setpwent F
+GLIBC_2.31 setregid F
+GLIBC_2.31 setresgid F
+GLIBC_2.31 setresuid F
+GLIBC_2.31 setreuid F
+GLIBC_2.31 setrlimit F
+GLIBC_2.31 setrlimit64 F
+GLIBC_2.31 setrpcent F
+GLIBC_2.31 setservent F
+GLIBC_2.31 setsgent F
+GLIBC_2.31 setsid F
+GLIBC_2.31 setsockopt F
+GLIBC_2.31 setsourcefilter F
+GLIBC_2.31 setspent F
+GLIBC_2.31 setstate F
+GLIBC_2.31 setstate_r F
+GLIBC_2.31 settimeofday F
+GLIBC_2.31 setttyent F
+GLIBC_2.31 setuid F
+GLIBC_2.31 setusershell F
+GLIBC_2.31 setutent F
+GLIBC_2.31 setutxent F
+GLIBC_2.31 setvbuf F
+GLIBC_2.31 setxattr F
+GLIBC_2.31 sgetsgent F
+GLIBC_2.31 sgetsgent_r F
+GLIBC_2.31 sgetspent F
+GLIBC_2.31 sgetspent_r F
+GLIBC_2.31 shmat F
+GLIBC_2.31 shmctl F
+GLIBC_2.31 shmdt F
+GLIBC_2.31 shmget F
+GLIBC_2.31 shutdown F
+GLIBC_2.31 sigaction F
+GLIBC_2.31 sigaddset F
+GLIBC_2.31 sigaltstack F
+GLIBC_2.31 sigandset F
+GLIBC_2.31 sigblock F
+GLIBC_2.31 sigdelset F
+GLIBC_2.31 sigemptyset F
+GLIBC_2.31 sigfillset F
+GLIBC_2.31 siggetmask F
+GLIBC_2.31 sighold F
+GLIBC_2.31 sigignore F
+GLIBC_2.31 siginterrupt F
+GLIBC_2.31 sigisemptyset F
+GLIBC_2.31 sigismember F
+GLIBC_2.31 siglongjmp F
+GLIBC_2.31 signal F
+GLIBC_2.31 signalfd F
+GLIBC_2.31 sigorset F
+GLIBC_2.31 sigpause F
+GLIBC_2.31 sigpending F
+GLIBC_2.31 sigprocmask F
+GLIBC_2.31 sigqueue F
+GLIBC_2.31 sigrelse F
+GLIBC_2.31 sigreturn F
+GLIBC_2.31 sigset F
+GLIBC_2.31 sigsetmask F
+GLIBC_2.31 sigstack F
+GLIBC_2.31 sigsuspend F
+GLIBC_2.31 sigtimedwait F
+GLIBC_2.31 sigwait F
+GLIBC_2.31 sigwaitinfo F
+GLIBC_2.31 sleep F
+GLIBC_2.31 snprintf F
+GLIBC_2.31 sockatmark F
+GLIBC_2.31 socket F
+GLIBC_2.31 socketpair F
+GLIBC_2.31 splice F
+GLIBC_2.31 sprintf F
+GLIBC_2.31 sprofil F
+GLIBC_2.31 srand F
+GLIBC_2.31 srand48 F
+GLIBC_2.31 srand48_r F
+GLIBC_2.31 srandom F
+GLIBC_2.31 srandom_r F
+GLIBC_2.31 sscanf F
+GLIBC_2.31 ssignal F
+GLIBC_2.31 sstk F
+GLIBC_2.31 statfs F
+GLIBC_2.31 statfs64 F
+GLIBC_2.31 statvfs F
+GLIBC_2.31 statvfs64 F
+GLIBC_2.31 statx F
+GLIBC_2.31 stderr D 0x4
+GLIBC_2.31 stdin D 0x4
+GLIBC_2.31 stdout D 0x4
+GLIBC_2.31 stime F
+GLIBC_2.31 stpcpy F
+GLIBC_2.31 stpncpy F
+GLIBC_2.31 strcasecmp F
+GLIBC_2.31 strcasecmp_l F
+GLIBC_2.31 strcasestr F
+GLIBC_2.31 strcat F
+GLIBC_2.31 strchr F
+GLIBC_2.31 strchrnul F
+GLIBC_2.31 strcmp F
+GLIBC_2.31 strcoll F
+GLIBC_2.31 strcoll_l F
+GLIBC_2.31 strcpy F
+GLIBC_2.31 strcspn F
+GLIBC_2.31 strdup F
+GLIBC_2.31 strerror F
+GLIBC_2.31 strerror_l F
+GLIBC_2.31 strerror_r F
+GLIBC_2.31 strfmon F
+GLIBC_2.31 strfmon_l F
+GLIBC_2.31 strfromd F
+GLIBC_2.31 strfromf F
+GLIBC_2.31 strfromf128 F
+GLIBC_2.31 strfromf32 F
+GLIBC_2.31 strfromf32x F
+GLIBC_2.31 strfromf64 F
+GLIBC_2.31 strfromf64x F
+GLIBC_2.31 strfroml F
+GLIBC_2.31 strfry F
+GLIBC_2.31 strftime F
+GLIBC_2.31 strftime_l F
+GLIBC_2.31 strlen F
+GLIBC_2.31 strncasecmp F
+GLIBC_2.31 strncasecmp_l F
+GLIBC_2.31 strncat F
+GLIBC_2.31 strncmp F
+GLIBC_2.31 strncpy F
+GLIBC_2.31 strndup F
+GLIBC_2.31 strnlen F
+GLIBC_2.31 strpbrk F
+GLIBC_2.31 strptime F
+GLIBC_2.31 strptime_l F
+GLIBC_2.31 strrchr F
+GLIBC_2.31 strsep F
+GLIBC_2.31 strsignal F
+GLIBC_2.31 strspn F
+GLIBC_2.31 strstr F
+GLIBC_2.31 strtod F
+GLIBC_2.31 strtod_l F
+GLIBC_2.31 strtof F
+GLIBC_2.31 strtof128 F
+GLIBC_2.31 strtof128_l F
+GLIBC_2.31 strtof32 F
+GLIBC_2.31 strtof32_l F
+GLIBC_2.31 strtof32x F
+GLIBC_2.31 strtof32x_l F
+GLIBC_2.31 strtof64 F
+GLIBC_2.31 strtof64_l F
+GLIBC_2.31 strtof64x F
+GLIBC_2.31 strtof64x_l F
+GLIBC_2.31 strtof_l F
+GLIBC_2.31 strtoimax F
+GLIBC_2.31 strtok F
+GLIBC_2.31 strtok_r F
+GLIBC_2.31 strtol F
+GLIBC_2.31 strtol_l F
+GLIBC_2.31 strtold F
+GLIBC_2.31 strtold_l F
+GLIBC_2.31 strtoll F
+GLIBC_2.31 strtoll_l F
+GLIBC_2.31 strtoq F
+GLIBC_2.31 strtoul F
+GLIBC_2.31 strtoul_l F
+GLIBC_2.31 strtoull F
+GLIBC_2.31 strtoull_l F
+GLIBC_2.31 strtoumax F
+GLIBC_2.31 strtouq F
+GLIBC_2.31 strverscmp F
+GLIBC_2.31 strxfrm F
+GLIBC_2.31 strxfrm_l F
+GLIBC_2.31 stty F
+GLIBC_2.31 svc_exit F
+GLIBC_2.31 svc_fdset D 0x80
+GLIBC_2.31 svc_getreq F
+GLIBC_2.31 svc_getreq_common F
+GLIBC_2.31 svc_getreq_poll F
+GLIBC_2.31 svc_getreqset F
+GLIBC_2.31 svc_max_pollfd D 0x4
+GLIBC_2.31 svc_pollfd D 0x4
+GLIBC_2.31 svc_register F
+GLIBC_2.31 svc_run F
+GLIBC_2.31 svc_sendreply F
+GLIBC_2.31 svc_unregister F
+GLIBC_2.31 svcauthdes_stats D 0xc
+GLIBC_2.31 svcerr_auth F
+GLIBC_2.31 svcerr_decode F
+GLIBC_2.31 svcerr_noproc F
+GLIBC_2.31 svcerr_noprog F
+GLIBC_2.31 svcerr_progvers F
+GLIBC_2.31 svcerr_systemerr F
+GLIBC_2.31 svcerr_weakauth F
+GLIBC_2.31 svcfd_create F
+GLIBC_2.31 svcraw_create F
+GLIBC_2.31 svctcp_create F
+GLIBC_2.31 svcudp_bufcreate F
+GLIBC_2.31 svcudp_create F
+GLIBC_2.31 svcudp_enablecache F
+GLIBC_2.31 svcunix_create F
+GLIBC_2.31 svcunixfd_create F
+GLIBC_2.31 swab F
+GLIBC_2.31 swapcontext F
+GLIBC_2.31 swapoff F
+GLIBC_2.31 swapon F
+GLIBC_2.31 swprintf F
+GLIBC_2.31 swscanf F
+GLIBC_2.31 symlink F
+GLIBC_2.31 symlinkat F
+GLIBC_2.31 sync F
+GLIBC_2.31 sync_file_range F
+GLIBC_2.31 syncfs F
+GLIBC_2.31 sys_errlist D 0x21c
+GLIBC_2.31 sys_nerr D 0x4
+GLIBC_2.31 sys_sigabbrev D 0x104
+GLIBC_2.31 sys_siglist D 0x104
+GLIBC_2.31 syscall F
+GLIBC_2.31 sysconf F
+GLIBC_2.31 sysctl F
+GLIBC_2.31 sysinfo F
+GLIBC_2.31 syslog F
+GLIBC_2.31 system F
+GLIBC_2.31 sysv_signal F
+GLIBC_2.31 tcdrain F
+GLIBC_2.31 tcflow F
+GLIBC_2.31 tcflush F
+GLIBC_2.31 tcgetattr F
+GLIBC_2.31 tcgetpgrp F
+GLIBC_2.31 tcgetsid F
+GLIBC_2.31 tcsendbreak F
+GLIBC_2.31 tcsetattr F
+GLIBC_2.31 tcsetpgrp F
+GLIBC_2.31 tdelete F
+GLIBC_2.31 tdestroy F
+GLIBC_2.31 tee F
+GLIBC_2.31 telldir F
+GLIBC_2.31 tempnam F
+GLIBC_2.31 textdomain F
+GLIBC_2.31 tfind F
+GLIBC_2.31 thrd_current F
+GLIBC_2.31 thrd_equal F
+GLIBC_2.31 thrd_sleep F
+GLIBC_2.31 thrd_yield F
+GLIBC_2.31 time F
+GLIBC_2.31 timegm F
+GLIBC_2.31 timelocal F
+GLIBC_2.31 timerfd_create F
+GLIBC_2.31 timerfd_gettime F
+GLIBC_2.31 timerfd_settime F
+GLIBC_2.31 times F
+GLIBC_2.31 timespec_get F
+GLIBC_2.31 timezone D 0x4
+GLIBC_2.31 tmpfile F
+GLIBC_2.31 tmpfile64 F
+GLIBC_2.31 tmpnam F
+GLIBC_2.31 tmpnam_r F
+GLIBC_2.31 toascii F
+GLIBC_2.31 tolower F
+GLIBC_2.31 tolower_l F
+GLIBC_2.31 toupper F
+GLIBC_2.31 toupper_l F
+GLIBC_2.31 towctrans F
+GLIBC_2.31 towctrans_l F
+GLIBC_2.31 towlower F
+GLIBC_2.31 towlower_l F
+GLIBC_2.31 towupper F
+GLIBC_2.31 towupper_l F
+GLIBC_2.31 tr_break F
+GLIBC_2.31 truncate F
+GLIBC_2.31 truncate64 F
+GLIBC_2.31 tsearch F
+GLIBC_2.31 ttyname F
+GLIBC_2.31 ttyname_r F
+GLIBC_2.31 ttyslot F
+GLIBC_2.31 twalk F
+GLIBC_2.31 tzname D 0x8
+GLIBC_2.31 tzset F
+GLIBC_2.31 ualarm F
+GLIBC_2.31 ulckpwdf F
+GLIBC_2.31 ulimit F
+GLIBC_2.31 umask F
+GLIBC_2.31 umount F
+GLIBC_2.31 umount2 F
+GLIBC_2.31 uname F
+GLIBC_2.31 ungetc F
+GLIBC_2.31 ungetwc F
+GLIBC_2.31 unlink F
+GLIBC_2.31 unlinkat F
+GLIBC_2.31 unlockpt F
+GLIBC_2.31 unsetenv F
+GLIBC_2.31 unshare F
+GLIBC_2.31 updwtmp F
+GLIBC_2.31 updwtmpx F
+GLIBC_2.31 uselocale F
+GLIBC_2.31 user2netname F
+GLIBC_2.31 usleep F
+GLIBC_2.31 utime F
+GLIBC_2.31 utimensat F
+GLIBC_2.31 utimes F
+GLIBC_2.31 utmpname F
+GLIBC_2.31 utmpxname F
+GLIBC_2.31 valloc F
+GLIBC_2.31 vasprintf F
+GLIBC_2.31 vdprintf F
+GLIBC_2.31 verr F
+GLIBC_2.31 verrx F
+GLIBC_2.31 versionsort F
+GLIBC_2.31 versionsort64 F
+GLIBC_2.31 vfork F
+GLIBC_2.31 vfprintf F
+GLIBC_2.31 vfscanf F
+GLIBC_2.31 vfwprintf F
+GLIBC_2.31 vfwscanf F
+GLIBC_2.31 vhangup F
+GLIBC_2.31 vlimit F
+GLIBC_2.31 vmsplice F
+GLIBC_2.31 vprintf F
+GLIBC_2.31 vscanf F
+GLIBC_2.31 vsnprintf F
+GLIBC_2.31 vsprintf F
+GLIBC_2.31 vsscanf F
+GLIBC_2.31 vswprintf F
+GLIBC_2.31 vswscanf F
+GLIBC_2.31 vsyslog F
+GLIBC_2.31 vtimes F
+GLIBC_2.31 vwarn F
+GLIBC_2.31 vwarnx F
+GLIBC_2.31 vwprintf F
+GLIBC_2.31 vwscanf F
+GLIBC_2.31 wait F
+GLIBC_2.31 wait3 F
+GLIBC_2.31 wait4 F
+GLIBC_2.31 waitid F
+GLIBC_2.31 waitpid F
+GLIBC_2.31 warn F
+GLIBC_2.31 warnx F
+GLIBC_2.31 wcpcpy F
+GLIBC_2.31 wcpncpy F
+GLIBC_2.31 wcrtomb F
+GLIBC_2.31 wcscasecmp F
+GLIBC_2.31 wcscasecmp_l F
+GLIBC_2.31 wcscat F
+GLIBC_2.31 wcschr F
+GLIBC_2.31 wcschrnul F
+GLIBC_2.31 wcscmp F
+GLIBC_2.31 wcscoll F
+GLIBC_2.31 wcscoll_l F
+GLIBC_2.31 wcscpy F
+GLIBC_2.31 wcscspn F
+GLIBC_2.31 wcsdup F
+GLIBC_2.31 wcsftime F
+GLIBC_2.31 wcsftime_l F
+GLIBC_2.31 wcslen F
+GLIBC_2.31 wcsncasecmp F
+GLIBC_2.31 wcsncasecmp_l F
+GLIBC_2.31 wcsncat F
+GLIBC_2.31 wcsncmp F
+GLIBC_2.31 wcsncpy F
+GLIBC_2.31 wcsnlen F
+GLIBC_2.31 wcsnrtombs F
+GLIBC_2.31 wcspbrk F
+GLIBC_2.31 wcsrchr F
+GLIBC_2.31 wcsrtombs F
+GLIBC_2.31 wcsspn F
+GLIBC_2.31 wcsstr F
+GLIBC_2.31 wcstod F
+GLIBC_2.31 wcstod_l F
+GLIBC_2.31 wcstof F
+GLIBC_2.31 wcstof128 F
+GLIBC_2.31 wcstof128_l F
+GLIBC_2.31 wcstof32 F
+GLIBC_2.31 wcstof32_l F
+GLIBC_2.31 wcstof32x F
+GLIBC_2.31 wcstof32x_l F
+GLIBC_2.31 wcstof64 F
+GLIBC_2.31 wcstof64_l F
+GLIBC_2.31 wcstof64x F
+GLIBC_2.31 wcstof64x_l F
+GLIBC_2.31 wcstof_l F
+GLIBC_2.31 wcstoimax F
+GLIBC_2.31 wcstok F
+GLIBC_2.31 wcstol F
+GLIBC_2.31 wcstol_l F
+GLIBC_2.31 wcstold F
+GLIBC_2.31 wcstold_l F
+GLIBC_2.31 wcstoll F
+GLIBC_2.31 wcstoll_l F
+GLIBC_2.31 wcstombs F
+GLIBC_2.31 wcstoq F
+GLIBC_2.31 wcstoul F
+GLIBC_2.31 wcstoul_l F
+GLIBC_2.31 wcstoull F
+GLIBC_2.31 wcstoull_l F
+GLIBC_2.31 wcstoumax F
+GLIBC_2.31 wcstouq F
+GLIBC_2.31 wcswcs F
+GLIBC_2.31 wcswidth F
+GLIBC_2.31 wcsxfrm F
+GLIBC_2.31 wcsxfrm_l F
+GLIBC_2.31 wctob F
+GLIBC_2.31 wctomb F
+GLIBC_2.31 wctrans F
+GLIBC_2.31 wctrans_l F
+GLIBC_2.31 wctype F
+GLIBC_2.31 wctype_l F
+GLIBC_2.31 wcwidth F
+GLIBC_2.31 wmemchr F
+GLIBC_2.31 wmemcmp F
+GLIBC_2.31 wmemcpy F
+GLIBC_2.31 wmemmove F
+GLIBC_2.31 wmempcpy F
+GLIBC_2.31 wmemset F
+GLIBC_2.31 wordexp F
+GLIBC_2.31 wordfree F
+GLIBC_2.31 wprintf F
+GLIBC_2.31 write F
+GLIBC_2.31 writev F
+GLIBC_2.31 wscanf F
+GLIBC_2.31 xdecrypt F
+GLIBC_2.31 xdr_accepted_reply F
+GLIBC_2.31 xdr_array F
+GLIBC_2.31 xdr_authdes_cred F
+GLIBC_2.31 xdr_authdes_verf F
+GLIBC_2.31 xdr_authunix_parms F
+GLIBC_2.31 xdr_bool F
+GLIBC_2.31 xdr_bytes F
+GLIBC_2.31 xdr_callhdr F
+GLIBC_2.31 xdr_callmsg F
+GLIBC_2.31 xdr_char F
+GLIBC_2.31 xdr_cryptkeyarg F
+GLIBC_2.31 xdr_cryptkeyarg2 F
+GLIBC_2.31 xdr_cryptkeyres F
+GLIBC_2.31 xdr_des_block F
+GLIBC_2.31 xdr_double F
+GLIBC_2.31 xdr_enum F
+GLIBC_2.31 xdr_float F
+GLIBC_2.31 xdr_free F
+GLIBC_2.31 xdr_getcredres F
+GLIBC_2.31 xdr_hyper F
+GLIBC_2.31 xdr_int F
+GLIBC_2.31 xdr_int16_t F
+GLIBC_2.31 xdr_int32_t F
+GLIBC_2.31 xdr_int64_t F
+GLIBC_2.31 xdr_int8_t F
+GLIBC_2.31 xdr_key_netstarg F
+GLIBC_2.31 xdr_key_netstres F
+GLIBC_2.31 xdr_keybuf F
+GLIBC_2.31 xdr_keystatus F
+GLIBC_2.31 xdr_long F
+GLIBC_2.31 xdr_longlong_t F
+GLIBC_2.31 xdr_netnamestr F
+GLIBC_2.31 xdr_netobj F
+GLIBC_2.31 xdr_opaque F
+GLIBC_2.31 xdr_opaque_auth F
+GLIBC_2.31 xdr_pmap F
+GLIBC_2.31 xdr_pmaplist F
+GLIBC_2.31 xdr_pointer F
+GLIBC_2.31 xdr_quad_t F
+GLIBC_2.31 xdr_reference F
+GLIBC_2.31 xdr_rejected_reply F
+GLIBC_2.31 xdr_replymsg F
+GLIBC_2.31 xdr_rmtcall_args F
+GLIBC_2.31 xdr_rmtcallres F
+GLIBC_2.31 xdr_short F
+GLIBC_2.31 xdr_sizeof F
+GLIBC_2.31 xdr_string F
+GLIBC_2.31 xdr_u_char F
+GLIBC_2.31 xdr_u_hyper F
+GLIBC_2.31 xdr_u_int F
+GLIBC_2.31 xdr_u_long F
+GLIBC_2.31 xdr_u_longlong_t F
+GLIBC_2.31 xdr_u_quad_t F
+GLIBC_2.31 xdr_u_short F
+GLIBC_2.31 xdr_uint16_t F
+GLIBC_2.31 xdr_uint32_t F
+GLIBC_2.31 xdr_uint64_t F
+GLIBC_2.31 xdr_uint8_t F
+GLIBC_2.31 xdr_union F
+GLIBC_2.31 xdr_unixcred F
+GLIBC_2.31 xdr_vector F
+GLIBC_2.31 xdr_void F
+GLIBC_2.31 xdr_wrapstring F
+GLIBC_2.31 xdrmem_create F
+GLIBC_2.31 xdrrec_create F
+GLIBC_2.31 xdrrec_endofrecord F
+GLIBC_2.31 xdrrec_eof F
+GLIBC_2.31 xdrrec_skiprecord F
+GLIBC_2.31 xdrstdio_create F
+GLIBC_2.31 xencrypt F
+GLIBC_2.31 xprt_register F
+GLIBC_2.31 xprt_unregister F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libcrypt.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libcrypt.abilist
new file mode 100644
index 00000000000..9454aa7f33b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libcrypt.abilist
@@ -0,0 +1,2 @@
+GLIBC_2.31 crypt F
+GLIBC_2.31 crypt_r F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libdl.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libdl.abilist
new file mode 100644
index 00000000000..b540344430a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libdl.abilist
@@ -0,0 +1,9 @@
+GLIBC_2.31 dladdr F
+GLIBC_2.31 dladdr1 F
+GLIBC_2.31 dlclose F
+GLIBC_2.31 dlerror F
+GLIBC_2.31 dlinfo F
+GLIBC_2.31 dlmopen F
+GLIBC_2.31 dlopen F
+GLIBC_2.31 dlsym F
+GLIBC_2.31 dlvsym F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libm.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libm.abilist
new file mode 100644
index 00000000000..00bfbce3626
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libm.abilist
@@ -0,0 +1,1021 @@
+GLIBC_2.31 __acos_finite F
+GLIBC_2.31 __acosf_finite F
+GLIBC_2.31 __acosh_finite F
+GLIBC_2.31 __acoshf_finite F
+GLIBC_2.31 __acoshl_finite F
+GLIBC_2.31 __acosl_finite F
+GLIBC_2.31 __asin_finite F
+GLIBC_2.31 __asinf_finite F
+GLIBC_2.31 __asinl_finite F
+GLIBC_2.31 __atan2_finite F
+GLIBC_2.31 __atan2f_finite F
+GLIBC_2.31 __atan2l_finite F
+GLIBC_2.31 __atanh_finite F
+GLIBC_2.31 __atanhf_finite F
+GLIBC_2.31 __atanhl_finite F
+GLIBC_2.31 __clog10 F
+GLIBC_2.31 __clog10f F
+GLIBC_2.31 __clog10l F
+GLIBC_2.31 __cosh_finite F
+GLIBC_2.31 __coshf_finite F
+GLIBC_2.31 __coshl_finite F
+GLIBC_2.31 __exp10_finite F
+GLIBC_2.31 __exp10f_finite F
+GLIBC_2.31 __exp10l_finite F
+GLIBC_2.31 __exp2_finite F
+GLIBC_2.31 __exp2f_finite F
+GLIBC_2.31 __exp2l_finite F
+GLIBC_2.31 __exp_finite F
+GLIBC_2.31 __expf_finite F
+GLIBC_2.31 __expl_finite F
+GLIBC_2.31 __finite F
+GLIBC_2.31 __finitef F
+GLIBC_2.31 __finitel F
+GLIBC_2.31 __fmod_finite F
+GLIBC_2.31 __fmodf_finite F
+GLIBC_2.31 __fmodl_finite F
+GLIBC_2.31 __fpclassify F
+GLIBC_2.31 __fpclassifyf F
+GLIBC_2.31 __fpclassifyl F
+GLIBC_2.31 __gamma_r_finite F
+GLIBC_2.31 __gammaf_r_finite F
+GLIBC_2.31 __gammal_r_finite F
+GLIBC_2.31 __hypot_finite F
+GLIBC_2.31 __hypotf_finite F
+GLIBC_2.31 __hypotl_finite F
+GLIBC_2.31 __iseqsig F
+GLIBC_2.31 __iseqsigf F
+GLIBC_2.31 __iseqsigl F
+GLIBC_2.31 __issignaling F
+GLIBC_2.31 __issignalingf F
+GLIBC_2.31 __issignalingl F
+GLIBC_2.31 __j0_finite F
+GLIBC_2.31 __j0f_finite F
+GLIBC_2.31 __j0l_finite F
+GLIBC_2.31 __j1_finite F
+GLIBC_2.31 __j1f_finite F
+GLIBC_2.31 __j1l_finite F
+GLIBC_2.31 __jn_finite F
+GLIBC_2.31 __jnf_finite F
+GLIBC_2.31 __jnl_finite F
+GLIBC_2.31 __lgamma_r_finite F
+GLIBC_2.31 __lgammaf_r_finite F
+GLIBC_2.31 __lgammal_r_finite F
+GLIBC_2.31 __log10_finite F
+GLIBC_2.31 __log10f_finite F
+GLIBC_2.31 __log10l_finite F
+GLIBC_2.31 __log2_finite F
+GLIBC_2.31 __log2f_finite F
+GLIBC_2.31 __log2l_finite F
+GLIBC_2.31 __log_finite F
+GLIBC_2.31 __logf_finite F
+GLIBC_2.31 __logl_finite F
+GLIBC_2.31 __pow_finite F
+GLIBC_2.31 __powf_finite F
+GLIBC_2.31 __powl_finite F
+GLIBC_2.31 __remainder_finite F
+GLIBC_2.31 __remainderf_finite F
+GLIBC_2.31 __remainderl_finite F
+GLIBC_2.31 __scalb_finite F
+GLIBC_2.31 __scalbf_finite F
+GLIBC_2.31 __scalbl_finite F
+GLIBC_2.31 __signbit F
+GLIBC_2.31 __signbitf F
+GLIBC_2.31 __signbitl F
+GLIBC_2.31 __signgam D 0x4
+GLIBC_2.31 __sinh_finite F
+GLIBC_2.31 __sinhf_finite F
+GLIBC_2.31 __sinhl_finite F
+GLIBC_2.31 __sqrt_finite F
+GLIBC_2.31 __sqrtf_finite F
+GLIBC_2.31 __sqrtl_finite F
+GLIBC_2.31 __y0_finite F
+GLIBC_2.31 __y0f_finite F
+GLIBC_2.31 __y0l_finite F
+GLIBC_2.31 __y1_finite F
+GLIBC_2.31 __y1f_finite F
+GLIBC_2.31 __y1l_finite F
+GLIBC_2.31 __yn_finite F
+GLIBC_2.31 __ynf_finite F
+GLIBC_2.31 __ynl_finite F
+GLIBC_2.31 acos F
+GLIBC_2.31 acosf F
+GLIBC_2.31 acosf128 F
+GLIBC_2.31 acosf32 F
+GLIBC_2.31 acosf32x F
+GLIBC_2.31 acosf64 F
+GLIBC_2.31 acosf64x F
+GLIBC_2.31 acosh F
+GLIBC_2.31 acoshf F
+GLIBC_2.31 acoshf128 F
+GLIBC_2.31 acoshf32 F
+GLIBC_2.31 acoshf32x F
+GLIBC_2.31 acoshf64 F
+GLIBC_2.31 acoshf64x F
+GLIBC_2.31 acoshl F
+GLIBC_2.31 acosl F
+GLIBC_2.31 asin F
+GLIBC_2.31 asinf F
+GLIBC_2.31 asinf128 F
+GLIBC_2.31 asinf32 F
+GLIBC_2.31 asinf32x F
+GLIBC_2.31 asinf64 F
+GLIBC_2.31 asinf64x F
+GLIBC_2.31 asinh F
+GLIBC_2.31 asinhf F
+GLIBC_2.31 asinhf128 F
+GLIBC_2.31 asinhf32 F
+GLIBC_2.31 asinhf32x F
+GLIBC_2.31 asinhf64 F
+GLIBC_2.31 asinhf64x F
+GLIBC_2.31 asinhl F
+GLIBC_2.31 asinl F
+GLIBC_2.31 atan F
+GLIBC_2.31 atan2 F
+GLIBC_2.31 atan2f F
+GLIBC_2.31 atan2f128 F
+GLIBC_2.31 atan2f32 F
+GLIBC_2.31 atan2f32x F
+GLIBC_2.31 atan2f64 F
+GLIBC_2.31 atan2f64x F
+GLIBC_2.31 atan2l F
+GLIBC_2.31 atanf F
+GLIBC_2.31 atanf128 F
+GLIBC_2.31 atanf32 F
+GLIBC_2.31 atanf32x F
+GLIBC_2.31 atanf64 F
+GLIBC_2.31 atanf64x F
+GLIBC_2.31 atanh F
+GLIBC_2.31 atanhf F
+GLIBC_2.31 atanhf128 F
+GLIBC_2.31 atanhf32 F
+GLIBC_2.31 atanhf32x F
+GLIBC_2.31 atanhf64 F
+GLIBC_2.31 atanhf64x F
+GLIBC_2.31 atanhl F
+GLIBC_2.31 atanl F
+GLIBC_2.31 cabs F
+GLIBC_2.31 cabsf F
+GLIBC_2.31 cabsf128 F
+GLIBC_2.31 cabsf32 F
+GLIBC_2.31 cabsf32x F
+GLIBC_2.31 cabsf64 F
+GLIBC_2.31 cabsf64x F
+GLIBC_2.31 cabsl F
+GLIBC_2.31 cacos F
+GLIBC_2.31 cacosf F
+GLIBC_2.31 cacosf128 F
+GLIBC_2.31 cacosf32 F
+GLIBC_2.31 cacosf32x F
+GLIBC_2.31 cacosf64 F
+GLIBC_2.31 cacosf64x F
+GLIBC_2.31 cacosh F
+GLIBC_2.31 cacoshf F
+GLIBC_2.31 cacoshf128 F
+GLIBC_2.31 cacoshf32 F
+GLIBC_2.31 cacoshf32x F
+GLIBC_2.31 cacoshf64 F
+GLIBC_2.31 cacoshf64x F
+GLIBC_2.31 cacoshl F
+GLIBC_2.31 cacosl F
+GLIBC_2.31 canonicalize F
+GLIBC_2.31 canonicalizef F
+GLIBC_2.31 canonicalizef128 F
+GLIBC_2.31 canonicalizef32 F
+GLIBC_2.31 canonicalizef32x F
+GLIBC_2.31 canonicalizef64 F
+GLIBC_2.31 canonicalizef64x F
+GLIBC_2.31 canonicalizel F
+GLIBC_2.31 carg F
+GLIBC_2.31 cargf F
+GLIBC_2.31 cargf128 F
+GLIBC_2.31 cargf32 F
+GLIBC_2.31 cargf32x F
+GLIBC_2.31 cargf64 F
+GLIBC_2.31 cargf64x F
+GLIBC_2.31 cargl F
+GLIBC_2.31 casin F
+GLIBC_2.31 casinf F
+GLIBC_2.31 casinf128 F
+GLIBC_2.31 casinf32 F
+GLIBC_2.31 casinf32x F
+GLIBC_2.31 casinf64 F
+GLIBC_2.31 casinf64x F
+GLIBC_2.31 casinh F
+GLIBC_2.31 casinhf F
+GLIBC_2.31 casinhf128 F
+GLIBC_2.31 casinhf32 F
+GLIBC_2.31 casinhf32x F
+GLIBC_2.31 casinhf64 F
+GLIBC_2.31 casinhf64x F
+GLIBC_2.31 casinhl F
+GLIBC_2.31 casinl F
+GLIBC_2.31 catan F
+GLIBC_2.31 catanf F
+GLIBC_2.31 catanf128 F
+GLIBC_2.31 catanf32 F
+GLIBC_2.31 catanf32x F
+GLIBC_2.31 catanf64 F
+GLIBC_2.31 catanf64x F
+GLIBC_2.31 catanh F
+GLIBC_2.31 catanhf F
+GLIBC_2.31 catanhf128 F
+GLIBC_2.31 catanhf32 F
+GLIBC_2.31 catanhf32x F
+GLIBC_2.31 catanhf64 F
+GLIBC_2.31 catanhf64x F
+GLIBC_2.31 catanhl F
+GLIBC_2.31 catanl F
+GLIBC_2.31 cbrt F
+GLIBC_2.31 cbrtf F
+GLIBC_2.31 cbrtf128 F
+GLIBC_2.31 cbrtf32 F
+GLIBC_2.31 cbrtf32x F
+GLIBC_2.31 cbrtf64 F
+GLIBC_2.31 cbrtf64x F
+GLIBC_2.31 cbrtl F
+GLIBC_2.31 ccos F
+GLIBC_2.31 ccosf F
+GLIBC_2.31 ccosf128 F
+GLIBC_2.31 ccosf32 F
+GLIBC_2.31 ccosf32x F
+GLIBC_2.31 ccosf64 F
+GLIBC_2.31 ccosf64x F
+GLIBC_2.31 ccosh F
+GLIBC_2.31 ccoshf F
+GLIBC_2.31 ccoshf128 F
+GLIBC_2.31 ccoshf32 F
+GLIBC_2.31 ccoshf32x F
+GLIBC_2.31 ccoshf64 F
+GLIBC_2.31 ccoshf64x F
+GLIBC_2.31 ccoshl F
+GLIBC_2.31 ccosl F
+GLIBC_2.31 ceil F
+GLIBC_2.31 ceilf F
+GLIBC_2.31 ceilf128 F
+GLIBC_2.31 ceilf32 F
+GLIBC_2.31 ceilf32x F
+GLIBC_2.31 ceilf64 F
+GLIBC_2.31 ceilf64x F
+GLIBC_2.31 ceill F
+GLIBC_2.31 cexp F
+GLIBC_2.31 cexpf F
+GLIBC_2.31 cexpf128 F
+GLIBC_2.31 cexpf32 F
+GLIBC_2.31 cexpf32x F
+GLIBC_2.31 cexpf64 F
+GLIBC_2.31 cexpf64x F
+GLIBC_2.31 cexpl F
+GLIBC_2.31 cimag F
+GLIBC_2.31 cimagf F
+GLIBC_2.31 cimagf128 F
+GLIBC_2.31 cimagf32 F
+GLIBC_2.31 cimagf32x F
+GLIBC_2.31 cimagf64 F
+GLIBC_2.31 cimagf64x F
+GLIBC_2.31 cimagl F
+GLIBC_2.31 clog F
+GLIBC_2.31 clog10 F
+GLIBC_2.31 clog10f F
+GLIBC_2.31 clog10f128 F
+GLIBC_2.31 clog10f32 F
+GLIBC_2.31 clog10f32x F
+GLIBC_2.31 clog10f64 F
+GLIBC_2.31 clog10f64x F
+GLIBC_2.31 clog10l F
+GLIBC_2.31 clogf F
+GLIBC_2.31 clogf128 F
+GLIBC_2.31 clogf32 F
+GLIBC_2.31 clogf32x F
+GLIBC_2.31 clogf64 F
+GLIBC_2.31 clogf64x F
+GLIBC_2.31 clogl F
+GLIBC_2.31 conj F
+GLIBC_2.31 conjf F
+GLIBC_2.31 conjf128 F
+GLIBC_2.31 conjf32 F
+GLIBC_2.31 conjf32x F
+GLIBC_2.31 conjf64 F
+GLIBC_2.31 conjf64x F
+GLIBC_2.31 conjl F
+GLIBC_2.31 copysign F
+GLIBC_2.31 copysignf F
+GLIBC_2.31 copysignf128 F
+GLIBC_2.31 copysignf32 F
+GLIBC_2.31 copysignf32x F
+GLIBC_2.31 copysignf64 F
+GLIBC_2.31 copysignf64x F
+GLIBC_2.31 copysignl F
+GLIBC_2.31 cos F
+GLIBC_2.31 cosf F
+GLIBC_2.31 cosf128 F
+GLIBC_2.31 cosf32 F
+GLIBC_2.31 cosf32x F
+GLIBC_2.31 cosf64 F
+GLIBC_2.31 cosf64x F
+GLIBC_2.31 cosh F
+GLIBC_2.31 coshf F
+GLIBC_2.31 coshf128 F
+GLIBC_2.31 coshf32 F
+GLIBC_2.31 coshf32x F
+GLIBC_2.31 coshf64 F
+GLIBC_2.31 coshf64x F
+GLIBC_2.31 coshl F
+GLIBC_2.31 cosl F
+GLIBC_2.31 cpow F
+GLIBC_2.31 cpowf F
+GLIBC_2.31 cpowf128 F
+GLIBC_2.31 cpowf32 F
+GLIBC_2.31 cpowf32x F
+GLIBC_2.31 cpowf64 F
+GLIBC_2.31 cpowf64x F
+GLIBC_2.31 cpowl F
+GLIBC_2.31 cproj F
+GLIBC_2.31 cprojf F
+GLIBC_2.31 cprojf128 F
+GLIBC_2.31 cprojf32 F
+GLIBC_2.31 cprojf32x F
+GLIBC_2.31 cprojf64 F
+GLIBC_2.31 cprojf64x F
+GLIBC_2.31 cprojl F
+GLIBC_2.31 creal F
+GLIBC_2.31 crealf F
+GLIBC_2.31 crealf128 F
+GLIBC_2.31 crealf32 F
+GLIBC_2.31 crealf32x F
+GLIBC_2.31 crealf64 F
+GLIBC_2.31 crealf64x F
+GLIBC_2.31 creall F
+GLIBC_2.31 csin F
+GLIBC_2.31 csinf F
+GLIBC_2.31 csinf128 F
+GLIBC_2.31 csinf32 F
+GLIBC_2.31 csinf32x F
+GLIBC_2.31 csinf64 F
+GLIBC_2.31 csinf64x F
+GLIBC_2.31 csinh F
+GLIBC_2.31 csinhf F
+GLIBC_2.31 csinhf128 F
+GLIBC_2.31 csinhf32 F
+GLIBC_2.31 csinhf32x F
+GLIBC_2.31 csinhf64 F
+GLIBC_2.31 csinhf64x F
+GLIBC_2.31 csinhl F
+GLIBC_2.31 csinl F
+GLIBC_2.31 csqrt F
+GLIBC_2.31 csqrtf F
+GLIBC_2.31 csqrtf128 F
+GLIBC_2.31 csqrtf32 F
+GLIBC_2.31 csqrtf32x F
+GLIBC_2.31 csqrtf64 F
+GLIBC_2.31 csqrtf64x F
+GLIBC_2.31 csqrtl F
+GLIBC_2.31 ctan F
+GLIBC_2.31 ctanf F
+GLIBC_2.31 ctanf128 F
+GLIBC_2.31 ctanf32 F
+GLIBC_2.31 ctanf32x F
+GLIBC_2.31 ctanf64 F
+GLIBC_2.31 ctanf64x F
+GLIBC_2.31 ctanh F
+GLIBC_2.31 ctanhf F
+GLIBC_2.31 ctanhf128 F
+GLIBC_2.31 ctanhf32 F
+GLIBC_2.31 ctanhf32x F
+GLIBC_2.31 ctanhf64 F
+GLIBC_2.31 ctanhf64x F
+GLIBC_2.31 ctanhl F
+GLIBC_2.31 ctanl F
+GLIBC_2.31 daddl F
+GLIBC_2.31 ddivl F
+GLIBC_2.31 dmull F
+GLIBC_2.31 drem F
+GLIBC_2.31 dremf F
+GLIBC_2.31 dreml F
+GLIBC_2.31 dsubl F
+GLIBC_2.31 erf F
+GLIBC_2.31 erfc F
+GLIBC_2.31 erfcf F
+GLIBC_2.31 erfcf128 F
+GLIBC_2.31 erfcf32 F
+GLIBC_2.31 erfcf32x F
+GLIBC_2.31 erfcf64 F
+GLIBC_2.31 erfcf64x F
+GLIBC_2.31 erfcl F
+GLIBC_2.31 erff F
+GLIBC_2.31 erff128 F
+GLIBC_2.31 erff32 F
+GLIBC_2.31 erff32x F
+GLIBC_2.31 erff64 F
+GLIBC_2.31 erff64x F
+GLIBC_2.31 erfl F
+GLIBC_2.31 exp F
+GLIBC_2.31 exp10 F
+GLIBC_2.31 exp10f F
+GLIBC_2.31 exp10f128 F
+GLIBC_2.31 exp10f32 F
+GLIBC_2.31 exp10f32x F
+GLIBC_2.31 exp10f64 F
+GLIBC_2.31 exp10f64x F
+GLIBC_2.31 exp10l F
+GLIBC_2.31 exp2 F
+GLIBC_2.31 exp2f F
+GLIBC_2.31 exp2f128 F
+GLIBC_2.31 exp2f32 F
+GLIBC_2.31 exp2f32x F
+GLIBC_2.31 exp2f64 F
+GLIBC_2.31 exp2f64x F
+GLIBC_2.31 exp2l F
+GLIBC_2.31 expf F
+GLIBC_2.31 expf128 F
+GLIBC_2.31 expf32 F
+GLIBC_2.31 expf32x F
+GLIBC_2.31 expf64 F
+GLIBC_2.31 expf64x F
+GLIBC_2.31 expl F
+GLIBC_2.31 expm1 F
+GLIBC_2.31 expm1f F
+GLIBC_2.31 expm1f128 F
+GLIBC_2.31 expm1f32 F
+GLIBC_2.31 expm1f32x F
+GLIBC_2.31 expm1f64 F
+GLIBC_2.31 expm1f64x F
+GLIBC_2.31 expm1l F
+GLIBC_2.31 f32addf128 F
+GLIBC_2.31 f32addf32x F
+GLIBC_2.31 f32addf64 F
+GLIBC_2.31 f32addf64x F
+GLIBC_2.31 f32divf128 F
+GLIBC_2.31 f32divf32x F
+GLIBC_2.31 f32divf64 F
+GLIBC_2.31 f32divf64x F
+GLIBC_2.31 f32mulf128 F
+GLIBC_2.31 f32mulf32x F
+GLIBC_2.31 f32mulf64 F
+GLIBC_2.31 f32mulf64x F
+GLIBC_2.31 f32subf128 F
+GLIBC_2.31 f32subf32x F
+GLIBC_2.31 f32subf64 F
+GLIBC_2.31 f32subf64x F
+GLIBC_2.31 f32xaddf128 F
+GLIBC_2.31 f32xaddf64 F
+GLIBC_2.31 f32xaddf64x F
+GLIBC_2.31 f32xdivf128 F
+GLIBC_2.31 f32xdivf64 F
+GLIBC_2.31 f32xdivf64x F
+GLIBC_2.31 f32xmulf128 F
+GLIBC_2.31 f32xmulf64 F
+GLIBC_2.31 f32xmulf64x F
+GLIBC_2.31 f32xsubf128 F
+GLIBC_2.31 f32xsubf64 F
+GLIBC_2.31 f32xsubf64x F
+GLIBC_2.31 f64addf128 F
+GLIBC_2.31 f64addf64x F
+GLIBC_2.31 f64divf128 F
+GLIBC_2.31 f64divf64x F
+GLIBC_2.31 f64mulf128 F
+GLIBC_2.31 f64mulf64x F
+GLIBC_2.31 f64subf128 F
+GLIBC_2.31 f64subf64x F
+GLIBC_2.31 f64xaddf128 F
+GLIBC_2.31 f64xdivf128 F
+GLIBC_2.31 f64xmulf128 F
+GLIBC_2.31 f64xsubf128 F
+GLIBC_2.31 fabs F
+GLIBC_2.31 fabsf F
+GLIBC_2.31 fabsf128 F
+GLIBC_2.31 fabsf32 F
+GLIBC_2.31 fabsf32x F
+GLIBC_2.31 fabsf64 F
+GLIBC_2.31 fabsf64x F
+GLIBC_2.31 fabsl F
+GLIBC_2.31 fadd F
+GLIBC_2.31 faddl F
+GLIBC_2.31 fdim F
+GLIBC_2.31 fdimf F
+GLIBC_2.31 fdimf128 F
+GLIBC_2.31 fdimf32 F
+GLIBC_2.31 fdimf32x F
+GLIBC_2.31 fdimf64 F
+GLIBC_2.31 fdimf64x F
+GLIBC_2.31 fdiml F
+GLIBC_2.31 fdiv F
+GLIBC_2.31 fdivl F
+GLIBC_2.31 feclearexcept F
+GLIBC_2.31 fedisableexcept F
+GLIBC_2.31 feenableexcept F
+GLIBC_2.31 fegetenv F
+GLIBC_2.31 fegetexcept F
+GLIBC_2.31 fegetexceptflag F
+GLIBC_2.31 fegetmode F
+GLIBC_2.31 fegetround F
+GLIBC_2.31 feholdexcept F
+GLIBC_2.31 feraiseexcept F
+GLIBC_2.31 fesetenv F
+GLIBC_2.31 fesetexcept F
+GLIBC_2.31 fesetexceptflag F
+GLIBC_2.31 fesetmode F
+GLIBC_2.31 fesetround F
+GLIBC_2.31 fetestexcept F
+GLIBC_2.31 fetestexceptflag F
+GLIBC_2.31 feupdateenv F
+GLIBC_2.31 finite F
+GLIBC_2.31 finitef F
+GLIBC_2.31 finitel F
+GLIBC_2.31 floor F
+GLIBC_2.31 floorf F
+GLIBC_2.31 floorf128 F
+GLIBC_2.31 floorf32 F
+GLIBC_2.31 floorf32x F
+GLIBC_2.31 floorf64 F
+GLIBC_2.31 floorf64x F
+GLIBC_2.31 floorl F
+GLIBC_2.31 fma F
+GLIBC_2.31 fmaf F
+GLIBC_2.31 fmaf128 F
+GLIBC_2.31 fmaf32 F
+GLIBC_2.31 fmaf32x F
+GLIBC_2.31 fmaf64 F
+GLIBC_2.31 fmaf64x F
+GLIBC_2.31 fmal F
+GLIBC_2.31 fmax F
+GLIBC_2.31 fmaxf F
+GLIBC_2.31 fmaxf128 F
+GLIBC_2.31 fmaxf32 F
+GLIBC_2.31 fmaxf32x F
+GLIBC_2.31 fmaxf64 F
+GLIBC_2.31 fmaxf64x F
+GLIBC_2.31 fmaxl F
+GLIBC_2.31 fmaxmag F
+GLIBC_2.31 fmaxmagf F
+GLIBC_2.31 fmaxmagf128 F
+GLIBC_2.31 fmaxmagf32 F
+GLIBC_2.31 fmaxmagf32x F
+GLIBC_2.31 fmaxmagf64 F
+GLIBC_2.31 fmaxmagf64x F
+GLIBC_2.31 fmaxmagl F
+GLIBC_2.31 fmin F
+GLIBC_2.31 fminf F
+GLIBC_2.31 fminf128 F
+GLIBC_2.31 fminf32 F
+GLIBC_2.31 fminf32x F
+GLIBC_2.31 fminf64 F
+GLIBC_2.31 fminf64x F
+GLIBC_2.31 fminl F
+GLIBC_2.31 fminmag F
+GLIBC_2.31 fminmagf F
+GLIBC_2.31 fminmagf128 F
+GLIBC_2.31 fminmagf32 F
+GLIBC_2.31 fminmagf32x F
+GLIBC_2.31 fminmagf64 F
+GLIBC_2.31 fminmagf64x F
+GLIBC_2.31 fminmagl F
+GLIBC_2.31 fmod F
+GLIBC_2.31 fmodf F
+GLIBC_2.31 fmodf128 F
+GLIBC_2.31 fmodf32 F
+GLIBC_2.31 fmodf32x F
+GLIBC_2.31 fmodf64 F
+GLIBC_2.31 fmodf64x F
+GLIBC_2.31 fmodl F
+GLIBC_2.31 fmul F
+GLIBC_2.31 fmull F
+GLIBC_2.31 frexp F
+GLIBC_2.31 frexpf F
+GLIBC_2.31 frexpf128 F
+GLIBC_2.31 frexpf32 F
+GLIBC_2.31 frexpf32x F
+GLIBC_2.31 frexpf64 F
+GLIBC_2.31 frexpf64x F
+GLIBC_2.31 frexpl F
+GLIBC_2.31 fromfp F
+GLIBC_2.31 fromfpf F
+GLIBC_2.31 fromfpf128 F
+GLIBC_2.31 fromfpf32 F
+GLIBC_2.31 fromfpf32x F
+GLIBC_2.31 fromfpf64 F
+GLIBC_2.31 fromfpf64x F
+GLIBC_2.31 fromfpl F
+GLIBC_2.31 fromfpx F
+GLIBC_2.31 fromfpxf F
+GLIBC_2.31 fromfpxf128 F
+GLIBC_2.31 fromfpxf32 F
+GLIBC_2.31 fromfpxf32x F
+GLIBC_2.31 fromfpxf64 F
+GLIBC_2.31 fromfpxf64x F
+GLIBC_2.31 fromfpxl F
+GLIBC_2.31 fsub F
+GLIBC_2.31 fsubl F
+GLIBC_2.31 gamma F
+GLIBC_2.31 gammaf F
+GLIBC_2.31 gammal F
+GLIBC_2.31 getpayload F
+GLIBC_2.31 getpayloadf F
+GLIBC_2.31 getpayloadf128 F
+GLIBC_2.31 getpayloadf32 F
+GLIBC_2.31 getpayloadf32x F
+GLIBC_2.31 getpayloadf64 F
+GLIBC_2.31 getpayloadf64x F
+GLIBC_2.31 getpayloadl F
+GLIBC_2.31 hypot F
+GLIBC_2.31 hypotf F
+GLIBC_2.31 hypotf128 F
+GLIBC_2.31 hypotf32 F
+GLIBC_2.31 hypotf32x F
+GLIBC_2.31 hypotf64 F
+GLIBC_2.31 hypotf64x F
+GLIBC_2.31 hypotl F
+GLIBC_2.31 ilogb F
+GLIBC_2.31 ilogbf F
+GLIBC_2.31 ilogbf128 F
+GLIBC_2.31 ilogbf32 F
+GLIBC_2.31 ilogbf32x F
+GLIBC_2.31 ilogbf64 F
+GLIBC_2.31 ilogbf64x F
+GLIBC_2.31 ilogbl F
+GLIBC_2.31 j0 F
+GLIBC_2.31 j0f F
+GLIBC_2.31 j0f128 F
+GLIBC_2.31 j0f32 F
+GLIBC_2.31 j0f32x F
+GLIBC_2.31 j0f64 F
+GLIBC_2.31 j0f64x F
+GLIBC_2.31 j0l F
+GLIBC_2.31 j1 F
+GLIBC_2.31 j1f F
+GLIBC_2.31 j1f128 F
+GLIBC_2.31 j1f32 F
+GLIBC_2.31 j1f32x F
+GLIBC_2.31 j1f64 F
+GLIBC_2.31 j1f64x F
+GLIBC_2.31 j1l F
+GLIBC_2.31 jn F
+GLIBC_2.31 jnf F
+GLIBC_2.31 jnf128 F
+GLIBC_2.31 jnf32 F
+GLIBC_2.31 jnf32x F
+GLIBC_2.31 jnf64 F
+GLIBC_2.31 jnf64x F
+GLIBC_2.31 jnl F
+GLIBC_2.31 ldexp F
+GLIBC_2.31 ldexpf F
+GLIBC_2.31 ldexpf128 F
+GLIBC_2.31 ldexpf32 F
+GLIBC_2.31 ldexpf32x F
+GLIBC_2.31 ldexpf64 F
+GLIBC_2.31 ldexpf64x F
+GLIBC_2.31 ldexpl F
+GLIBC_2.31 lgamma F
+GLIBC_2.31 lgamma_r F
+GLIBC_2.31 lgammaf F
+GLIBC_2.31 lgammaf128 F
+GLIBC_2.31 lgammaf128_r F
+GLIBC_2.31 lgammaf32 F
+GLIBC_2.31 lgammaf32_r F
+GLIBC_2.31 lgammaf32x F
+GLIBC_2.31 lgammaf32x_r F
+GLIBC_2.31 lgammaf64 F
+GLIBC_2.31 lgammaf64_r F
+GLIBC_2.31 lgammaf64x F
+GLIBC_2.31 lgammaf64x_r F
+GLIBC_2.31 lgammaf_r F
+GLIBC_2.31 lgammal F
+GLIBC_2.31 lgammal_r F
+GLIBC_2.31 llogb F
+GLIBC_2.31 llogbf F
+GLIBC_2.31 llogbf128 F
+GLIBC_2.31 llogbf32 F
+GLIBC_2.31 llogbf32x F
+GLIBC_2.31 llogbf64 F
+GLIBC_2.31 llogbf64x F
+GLIBC_2.31 llogbl F
+GLIBC_2.31 llrint F
+GLIBC_2.31 llrintf F
+GLIBC_2.31 llrintf128 F
+GLIBC_2.31 llrintf32 F
+GLIBC_2.31 llrintf32x F
+GLIBC_2.31 llrintf64 F
+GLIBC_2.31 llrintf64x F
+GLIBC_2.31 llrintl F
+GLIBC_2.31 llround F
+GLIBC_2.31 llroundf F
+GLIBC_2.31 llroundf128 F
+GLIBC_2.31 llroundf32 F
+GLIBC_2.31 llroundf32x F
+GLIBC_2.31 llroundf64 F
+GLIBC_2.31 llroundf64x F
+GLIBC_2.31 llroundl F
+GLIBC_2.31 log F
+GLIBC_2.31 log10 F
+GLIBC_2.31 log10f F
+GLIBC_2.31 log10f128 F
+GLIBC_2.31 log10f32 F
+GLIBC_2.31 log10f32x F
+GLIBC_2.31 log10f64 F
+GLIBC_2.31 log10f64x F
+GLIBC_2.31 log10l F
+GLIBC_2.31 log1p F
+GLIBC_2.31 log1pf F
+GLIBC_2.31 log1pf128 F
+GLIBC_2.31 log1pf32 F
+GLIBC_2.31 log1pf32x F
+GLIBC_2.31 log1pf64 F
+GLIBC_2.31 log1pf64x F
+GLIBC_2.31 log1pl F
+GLIBC_2.31 log2 F
+GLIBC_2.31 log2f F
+GLIBC_2.31 log2f128 F
+GLIBC_2.31 log2f32 F
+GLIBC_2.31 log2f32x F
+GLIBC_2.31 log2f64 F
+GLIBC_2.31 log2f64x F
+GLIBC_2.31 log2l F
+GLIBC_2.31 logb F
+GLIBC_2.31 logbf F
+GLIBC_2.31 logbf128 F
+GLIBC_2.31 logbf32 F
+GLIBC_2.31 logbf32x F
+GLIBC_2.31 logbf64 F
+GLIBC_2.31 logbf64x F
+GLIBC_2.31 logbl F
+GLIBC_2.31 logf F
+GLIBC_2.31 logf128 F
+GLIBC_2.31 logf32 F
+GLIBC_2.31 logf32x F
+GLIBC_2.31 logf64 F
+GLIBC_2.31 logf64x F
+GLIBC_2.31 logl F
+GLIBC_2.31 lrint F
+GLIBC_2.31 lrintf F
+GLIBC_2.31 lrintf128 F
+GLIBC_2.31 lrintf32 F
+GLIBC_2.31 lrintf32x F
+GLIBC_2.31 lrintf64 F
+GLIBC_2.31 lrintf64x F
+GLIBC_2.31 lrintl F
+GLIBC_2.31 lround F
+GLIBC_2.31 lroundf F
+GLIBC_2.31 lroundf128 F
+GLIBC_2.31 lroundf32 F
+GLIBC_2.31 lroundf32x F
+GLIBC_2.31 lroundf64 F
+GLIBC_2.31 lroundf64x F
+GLIBC_2.31 lroundl F
+GLIBC_2.31 modf F
+GLIBC_2.31 modff F
+GLIBC_2.31 modff128 F
+GLIBC_2.31 modff32 F
+GLIBC_2.31 modff32x F
+GLIBC_2.31 modff64 F
+GLIBC_2.31 modff64x F
+GLIBC_2.31 modfl F
+GLIBC_2.31 nan F
+GLIBC_2.31 nanf F
+GLIBC_2.31 nanf128 F
+GLIBC_2.31 nanf32 F
+GLIBC_2.31 nanf32x F
+GLIBC_2.31 nanf64 F
+GLIBC_2.31 nanf64x F
+GLIBC_2.31 nanl F
+GLIBC_2.31 nearbyint F
+GLIBC_2.31 nearbyintf F
+GLIBC_2.31 nearbyintf128 F
+GLIBC_2.31 nearbyintf32 F
+GLIBC_2.31 nearbyintf32x F
+GLIBC_2.31 nearbyintf64 F
+GLIBC_2.31 nearbyintf64x F
+GLIBC_2.31 nearbyintl F
+GLIBC_2.31 nextafter F
+GLIBC_2.31 nextafterf F
+GLIBC_2.31 nextafterf128 F
+GLIBC_2.31 nextafterf32 F
+GLIBC_2.31 nextafterf32x F
+GLIBC_2.31 nextafterf64 F
+GLIBC_2.31 nextafterf64x F
+GLIBC_2.31 nextafterl F
+GLIBC_2.31 nextdown F
+GLIBC_2.31 nextdownf F
+GLIBC_2.31 nextdownf128 F
+GLIBC_2.31 nextdownf32 F
+GLIBC_2.31 nextdownf32x F
+GLIBC_2.31 nextdownf64 F
+GLIBC_2.31 nextdownf64x F
+GLIBC_2.31 nextdownl F
+GLIBC_2.31 nexttoward F
+GLIBC_2.31 nexttowardf F
+GLIBC_2.31 nexttowardl F
+GLIBC_2.31 nextup F
+GLIBC_2.31 nextupf F
+GLIBC_2.31 nextupf128 F
+GLIBC_2.31 nextupf32 F
+GLIBC_2.31 nextupf32x F
+GLIBC_2.31 nextupf64 F
+GLIBC_2.31 nextupf64x F
+GLIBC_2.31 nextupl F
+GLIBC_2.31 pow F
+GLIBC_2.31 powf F
+GLIBC_2.31 powf128 F
+GLIBC_2.31 powf32 F
+GLIBC_2.31 powf32x F
+GLIBC_2.31 powf64 F
+GLIBC_2.31 powf64x F
+GLIBC_2.31 powl F
+GLIBC_2.31 remainder F
+GLIBC_2.31 remainderf F
+GLIBC_2.31 remainderf128 F
+GLIBC_2.31 remainderf32 F
+GLIBC_2.31 remainderf32x F
+GLIBC_2.31 remainderf64 F
+GLIBC_2.31 remainderf64x F
+GLIBC_2.31 remainderl F
+GLIBC_2.31 remquo F
+GLIBC_2.31 remquof F
+GLIBC_2.31 remquof128 F
+GLIBC_2.31 remquof32 F
+GLIBC_2.31 remquof32x F
+GLIBC_2.31 remquof64 F
+GLIBC_2.31 remquof64x F
+GLIBC_2.31 remquol F
+GLIBC_2.31 rint F
+GLIBC_2.31 rintf F
+GLIBC_2.31 rintf128 F
+GLIBC_2.31 rintf32 F
+GLIBC_2.31 rintf32x F
+GLIBC_2.31 rintf64 F
+GLIBC_2.31 rintf64x F
+GLIBC_2.31 rintl F
+GLIBC_2.31 round F
+GLIBC_2.31 roundeven F
+GLIBC_2.31 roundevenf F
+GLIBC_2.31 roundevenf128 F
+GLIBC_2.31 roundevenf32 F
+GLIBC_2.31 roundevenf32x F
+GLIBC_2.31 roundevenf64 F
+GLIBC_2.31 roundevenf64x F
+GLIBC_2.31 roundevenl F
+GLIBC_2.31 roundf F
+GLIBC_2.31 roundf128 F
+GLIBC_2.31 roundf32 F
+GLIBC_2.31 roundf32x F
+GLIBC_2.31 roundf64 F
+GLIBC_2.31 roundf64x F
+GLIBC_2.31 roundl F
+GLIBC_2.31 scalb F
+GLIBC_2.31 scalbf F
+GLIBC_2.31 scalbl F
+GLIBC_2.31 scalbln F
+GLIBC_2.31 scalblnf F
+GLIBC_2.31 scalblnf128 F
+GLIBC_2.31 scalblnf32 F
+GLIBC_2.31 scalblnf32x F
+GLIBC_2.31 scalblnf64 F
+GLIBC_2.31 scalblnf64x F
+GLIBC_2.31 scalblnl F
+GLIBC_2.31 scalbn F
+GLIBC_2.31 scalbnf F
+GLIBC_2.31 scalbnf128 F
+GLIBC_2.31 scalbnf32 F
+GLIBC_2.31 scalbnf32x F
+GLIBC_2.31 scalbnf64 F
+GLIBC_2.31 scalbnf64x F
+GLIBC_2.31 scalbnl F
+GLIBC_2.31 setpayload F
+GLIBC_2.31 setpayloadf F
+GLIBC_2.31 setpayloadf128 F
+GLIBC_2.31 setpayloadf32 F
+GLIBC_2.31 setpayloadf32x F
+GLIBC_2.31 setpayloadf64 F
+GLIBC_2.31 setpayloadf64x F
+GLIBC_2.31 setpayloadl F
+GLIBC_2.31 setpayloadsig F
+GLIBC_2.31 setpayloadsigf F
+GLIBC_2.31 setpayloadsigf128 F
+GLIBC_2.31 setpayloadsigf32 F
+GLIBC_2.31 setpayloadsigf32x F
+GLIBC_2.31 setpayloadsigf64 F
+GLIBC_2.31 setpayloadsigf64x F
+GLIBC_2.31 setpayloadsigl F
+GLIBC_2.31 signgam D 0x4
+GLIBC_2.31 significand F
+GLIBC_2.31 significandf F
+GLIBC_2.31 significandl F
+GLIBC_2.31 sin F
+GLIBC_2.31 sincos F
+GLIBC_2.31 sincosf F
+GLIBC_2.31 sincosf128 F
+GLIBC_2.31 sincosf32 F
+GLIBC_2.31 sincosf32x F
+GLIBC_2.31 sincosf64 F
+GLIBC_2.31 sincosf64x F
+GLIBC_2.31 sincosl F
+GLIBC_2.31 sinf F
+GLIBC_2.31 sinf128 F
+GLIBC_2.31 sinf32 F
+GLIBC_2.31 sinf32x F
+GLIBC_2.31 sinf64 F
+GLIBC_2.31 sinf64x F
+GLIBC_2.31 sinh F
+GLIBC_2.31 sinhf F
+GLIBC_2.31 sinhf128 F
+GLIBC_2.31 sinhf32 F
+GLIBC_2.31 sinhf32x F
+GLIBC_2.31 sinhf64 F
+GLIBC_2.31 sinhf64x F
+GLIBC_2.31 sinhl F
+GLIBC_2.31 sinl F
+GLIBC_2.31 sqrt F
+GLIBC_2.31 sqrtf F
+GLIBC_2.31 sqrtf128 F
+GLIBC_2.31 sqrtf32 F
+GLIBC_2.31 sqrtf32x F
+GLIBC_2.31 sqrtf64 F
+GLIBC_2.31 sqrtf64x F
+GLIBC_2.31 sqrtl F
+GLIBC_2.31 tan F
+GLIBC_2.31 tanf F
+GLIBC_2.31 tanf128 F
+GLIBC_2.31 tanf32 F
+GLIBC_2.31 tanf32x F
+GLIBC_2.31 tanf64 F
+GLIBC_2.31 tanf64x F
+GLIBC_2.31 tanh F
+GLIBC_2.31 tanhf F
+GLIBC_2.31 tanhf128 F
+GLIBC_2.31 tanhf32 F
+GLIBC_2.31 tanhf32x F
+GLIBC_2.31 tanhf64 F
+GLIBC_2.31 tanhf64x F
+GLIBC_2.31 tanhl F
+GLIBC_2.31 tanl F
+GLIBC_2.31 tgamma F
+GLIBC_2.31 tgammaf F
+GLIBC_2.31 tgammaf128 F
+GLIBC_2.31 tgammaf32 F
+GLIBC_2.31 tgammaf32x F
+GLIBC_2.31 tgammaf64 F
+GLIBC_2.31 tgammaf64x F
+GLIBC_2.31 tgammal F
+GLIBC_2.31 totalorder F
+GLIBC_2.31 totalorderf F
+GLIBC_2.31 totalorderf128 F
+GLIBC_2.31 totalorderf32 F
+GLIBC_2.31 totalorderf32x F
+GLIBC_2.31 totalorderf64 F
+GLIBC_2.31 totalorderf64x F
+GLIBC_2.31 totalorderl F
+GLIBC_2.31 totalordermag F
+GLIBC_2.31 totalordermagf F
+GLIBC_2.31 totalordermagf128 F
+GLIBC_2.31 totalordermagf32 F
+GLIBC_2.31 totalordermagf32x F
+GLIBC_2.31 totalordermagf64 F
+GLIBC_2.31 totalordermagf64x F
+GLIBC_2.31 totalordermagl F
+GLIBC_2.31 trunc F
+GLIBC_2.31 truncf F
+GLIBC_2.31 truncf128 F
+GLIBC_2.31 truncf32 F
+GLIBC_2.31 truncf32x F
+GLIBC_2.31 truncf64 F
+GLIBC_2.31 truncf64x F
+GLIBC_2.31 truncl F
+GLIBC_2.31 ufromfp F
+GLIBC_2.31 ufromfpf F
+GLIBC_2.31 ufromfpf128 F
+GLIBC_2.31 ufromfpf32 F
+GLIBC_2.31 ufromfpf32x F
+GLIBC_2.31 ufromfpf64 F
+GLIBC_2.31 ufromfpf64x F
+GLIBC_2.31 ufromfpl F
+GLIBC_2.31 ufromfpx F
+GLIBC_2.31 ufromfpxf F
+GLIBC_2.31 ufromfpxf128 F
+GLIBC_2.31 ufromfpxf32 F
+GLIBC_2.31 ufromfpxf32x F
+GLIBC_2.31 ufromfpxf64 F
+GLIBC_2.31 ufromfpxf64x F
+GLIBC_2.31 ufromfpxl F
+GLIBC_2.31 y0 F
+GLIBC_2.31 y0f F
+GLIBC_2.31 y0f128 F
+GLIBC_2.31 y0f32 F
+GLIBC_2.31 y0f32x F
+GLIBC_2.31 y0f64 F
+GLIBC_2.31 y0f64x F
+GLIBC_2.31 y0l F
+GLIBC_2.31 y1 F
+GLIBC_2.31 y1f F
+GLIBC_2.31 y1f128 F
+GLIBC_2.31 y1f32 F
+GLIBC_2.31 y1f32x F
+GLIBC_2.31 y1f64 F
+GLIBC_2.31 y1f64x F
+GLIBC_2.31 y1l F
+GLIBC_2.31 yn F
+GLIBC_2.31 ynf F
+GLIBC_2.31 ynf128 F
+GLIBC_2.31 ynf32 F
+GLIBC_2.31 ynf32x F
+GLIBC_2.31 ynf64 F
+GLIBC_2.31 ynf64x F
+GLIBC_2.31 ynl F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
new file mode 100644
index 00000000000..1a9c8108c7a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
@@ -0,0 +1,235 @@
+GLIBC_2.31 _IO_flockfile F
+GLIBC_2.31 _IO_ftrylockfile F
+GLIBC_2.31 _IO_funlockfile F
+GLIBC_2.31 __close F
+GLIBC_2.31 __connect F
+GLIBC_2.31 __errno_location F
+GLIBC_2.31 __h_errno_location F
+GLIBC_2.31 __libc_allocate_rtsig F
+GLIBC_2.31 __libc_current_sigrtmax F
+GLIBC_2.31 __libc_current_sigrtmin F
+GLIBC_2.31 __lseek F
+GLIBC_2.31 __nanosleep F
+GLIBC_2.31 __open F
+GLIBC_2.31 __open64 F
+GLIBC_2.31 __pread64 F
+GLIBC_2.31 __pthread_cleanup_routine F
+GLIBC_2.31 __pthread_getspecific F
+GLIBC_2.31 __pthread_key_create F
+GLIBC_2.31 __pthread_mutex_destroy F
+GLIBC_2.31 __pthread_mutex_init F
+GLIBC_2.31 __pthread_mutex_lock F
+GLIBC_2.31 __pthread_mutex_trylock F
+GLIBC_2.31 __pthread_mutex_unlock F
+GLIBC_2.31 __pthread_mutexattr_destroy F
+GLIBC_2.31 __pthread_mutexattr_init F
+GLIBC_2.31 __pthread_mutexattr_settype F
+GLIBC_2.31 __pthread_once F
+GLIBC_2.31 __pthread_register_cancel F
+GLIBC_2.31 __pthread_register_cancel_defer F
+GLIBC_2.31 __pthread_rwlock_destroy F
+GLIBC_2.31 __pthread_rwlock_init F
+GLIBC_2.31 __pthread_rwlock_rdlock F
+GLIBC_2.31 __pthread_rwlock_tryrdlock F
+GLIBC_2.31 __pthread_rwlock_trywrlock F
+GLIBC_2.31 __pthread_rwlock_unlock F
+GLIBC_2.31 __pthread_rwlock_wrlock F
+GLIBC_2.31 __pthread_setspecific F
+GLIBC_2.31 __pthread_unregister_cancel F
+GLIBC_2.31 __pthread_unregister_cancel_restore F
+GLIBC_2.31 __pthread_unwind_next F
+GLIBC_2.31 __pwrite64 F
+GLIBC_2.31 __read F
+GLIBC_2.31 __res_state F
+GLIBC_2.31 __send F
+GLIBC_2.31 __sigaction F
+GLIBC_2.31 __wait F
+GLIBC_2.31 __write F
+GLIBC_2.31 _pthread_cleanup_pop F
+GLIBC_2.31 _pthread_cleanup_pop_restore F
+GLIBC_2.31 _pthread_cleanup_push F
+GLIBC_2.31 _pthread_cleanup_push_defer F
+GLIBC_2.31 accept F
+GLIBC_2.31 call_once F
+GLIBC_2.31 close F
+GLIBC_2.31 cnd_broadcast F
+GLIBC_2.31 cnd_destroy F
+GLIBC_2.31 cnd_init F
+GLIBC_2.31 cnd_signal F
+GLIBC_2.31 cnd_timedwait F
+GLIBC_2.31 cnd_wait F
+GLIBC_2.31 connect F
+GLIBC_2.31 flockfile F
+GLIBC_2.31 fsync F
+GLIBC_2.31 ftrylockfile F
+GLIBC_2.31 funlockfile F
+GLIBC_2.31 lseek F
+GLIBC_2.31 lseek64 F
+GLIBC_2.31 msync F
+GLIBC_2.31 mtx_destroy F
+GLIBC_2.31 mtx_init F
+GLIBC_2.31 mtx_lock F
+GLIBC_2.31 mtx_timedlock F
+GLIBC_2.31 mtx_trylock F
+GLIBC_2.31 mtx_unlock F
+GLIBC_2.31 nanosleep F
+GLIBC_2.31 open F
+GLIBC_2.31 open64 F
+GLIBC_2.31 pause F
+GLIBC_2.31 pread F
+GLIBC_2.31 pread64 F
+GLIBC_2.31 pthread_attr_destroy F
+GLIBC_2.31 pthread_attr_getaffinity_np F
+GLIBC_2.31 pthread_attr_getdetachstate F
+GLIBC_2.31 pthread_attr_getguardsize F
+GLIBC_2.31 pthread_attr_getinheritsched F
+GLIBC_2.31 pthread_attr_getschedparam F
+GLIBC_2.31 pthread_attr_getschedpolicy F
+GLIBC_2.31 pthread_attr_getscope F
+GLIBC_2.31 pthread_attr_getstack F
+GLIBC_2.31 pthread_attr_getstackaddr F
+GLIBC_2.31 pthread_attr_getstacksize F
+GLIBC_2.31 pthread_attr_init F
+GLIBC_2.31 pthread_attr_setaffinity_np F
+GLIBC_2.31 pthread_attr_setdetachstate F
+GLIBC_2.31 pthread_attr_setguardsize F
+GLIBC_2.31 pthread_attr_setinheritsched F
+GLIBC_2.31 pthread_attr_setschedparam F
+GLIBC_2.31 pthread_attr_setschedpolicy F
+GLIBC_2.31 pthread_attr_setscope F
+GLIBC_2.31 pthread_attr_setstack F
+GLIBC_2.31 pthread_attr_setstackaddr F
+GLIBC_2.31 pthread_attr_setstacksize F
+GLIBC_2.31 pthread_barrier_destroy F
+GLIBC_2.31 pthread_barrier_init F
+GLIBC_2.31 pthread_barrier_wait F
+GLIBC_2.31 pthread_barrierattr_destroy F
+GLIBC_2.31 pthread_barrierattr_getpshared F
+GLIBC_2.31 pthread_barrierattr_init F
+GLIBC_2.31 pthread_barrierattr_setpshared F
+GLIBC_2.31 pthread_cancel F
+GLIBC_2.31 pthread_cond_broadcast F
+GLIBC_2.31 pthread_cond_destroy F
+GLIBC_2.31 pthread_cond_init F
+GLIBC_2.31 pthread_cond_signal F
+GLIBC_2.31 pthread_cond_timedwait F
+GLIBC_2.31 pthread_cond_wait F
+GLIBC_2.31 pthread_condattr_destroy F
+GLIBC_2.31 pthread_condattr_getclock F
+GLIBC_2.31 pthread_condattr_getpshared F
+GLIBC_2.31 pthread_condattr_init F
+GLIBC_2.31 pthread_condattr_setclock F
+GLIBC_2.31 pthread_condattr_setpshared F
+GLIBC_2.31 pthread_create F
+GLIBC_2.31 pthread_detach F
+GLIBC_2.31 pthread_equal F
+GLIBC_2.31 pthread_exit F
+GLIBC_2.31 pthread_getaffinity_np F
+GLIBC_2.31 pthread_getattr_default_np F
+GLIBC_2.31 pthread_getattr_np F
+GLIBC_2.31 pthread_getconcurrency F
+GLIBC_2.31 pthread_getcpuclockid F
+GLIBC_2.31 pthread_getname_np F
+GLIBC_2.31 pthread_getschedparam F
+GLIBC_2.31 pthread_getspecific F
+GLIBC_2.31 pthread_join F
+GLIBC_2.31 pthread_key_create F
+GLIBC_2.31 pthread_key_delete F
+GLIBC_2.31 pthread_kill F
+GLIBC_2.31 pthread_kill_other_threads_np F
+GLIBC_2.31 pthread_mutex_consistent F
+GLIBC_2.31 pthread_mutex_consistent_np F
+GLIBC_2.31 pthread_mutex_destroy F
+GLIBC_2.31 pthread_mutex_getprioceiling F
+GLIBC_2.31 pthread_mutex_init F
+GLIBC_2.31 pthread_mutex_lock F
+GLIBC_2.31 pthread_mutex_setprioceiling F
+GLIBC_2.31 pthread_mutex_timedlock F
+GLIBC_2.31 pthread_mutex_trylock F
+GLIBC_2.31 pthread_mutex_unlock F
+GLIBC_2.31 pthread_mutexattr_destroy F
+GLIBC_2.31 pthread_mutexattr_getkind_np F
+GLIBC_2.31 pthread_mutexattr_getprioceiling F
+GLIBC_2.31 pthread_mutexattr_getprotocol F
+GLIBC_2.31 pthread_mutexattr_getpshared F
+GLIBC_2.31 pthread_mutexattr_getrobust F
+GLIBC_2.31 pthread_mutexattr_getrobust_np F
+GLIBC_2.31 pthread_mutexattr_gettype F
+GLIBC_2.31 pthread_mutexattr_init F
+GLIBC_2.31 pthread_mutexattr_setkind_np F
+GLIBC_2.31 pthread_mutexattr_setprioceiling F
+GLIBC_2.31 pthread_mutexattr_setprotocol F
+GLIBC_2.31 pthread_mutexattr_setpshared F
+GLIBC_2.31 pthread_mutexattr_setrobust F
+GLIBC_2.31 pthread_mutexattr_setrobust_np F
+GLIBC_2.31 pthread_mutexattr_settype F
+GLIBC_2.31 pthread_once F
+GLIBC_2.31 pthread_rwlock_destroy F
+GLIBC_2.31 pthread_rwlock_init F
+GLIBC_2.31 pthread_rwlock_rdlock F
+GLIBC_2.31 pthread_rwlock_timedrdlock F
+GLIBC_2.31 pthread_rwlock_timedwrlock F
+GLIBC_2.31 pthread_rwlock_tryrdlock F
+GLIBC_2.31 pthread_rwlock_trywrlock F
+GLIBC_2.31 pthread_rwlock_unlock F
+GLIBC_2.31 pthread_rwlock_wrlock F
+GLIBC_2.31 pthread_rwlockattr_destroy F
+GLIBC_2.31 pthread_rwlockattr_getkind_np F
+GLIBC_2.31 pthread_rwlockattr_getpshared F
+GLIBC_2.31 pthread_rwlockattr_init F
+GLIBC_2.31 pthread_rwlockattr_setkind_np F
+GLIBC_2.31 pthread_rwlockattr_setpshared F
+GLIBC_2.31 pthread_setaffinity_np F
+GLIBC_2.31 pthread_setattr_default_np F
+GLIBC_2.31 pthread_setcancelstate F
+GLIBC_2.31 pthread_setcanceltype F
+GLIBC_2.31 pthread_setconcurrency F
+GLIBC_2.31 pthread_setname_np F
+GLIBC_2.31 pthread_setschedparam F
+GLIBC_2.31 pthread_setschedprio F
+GLIBC_2.31 pthread_setspecific F
+GLIBC_2.31 pthread_sigmask F
+GLIBC_2.31 pthread_sigqueue F
+GLIBC_2.31 pthread_spin_destroy F
+GLIBC_2.31 pthread_spin_init F
+GLIBC_2.31 pthread_spin_lock F
+GLIBC_2.31 pthread_spin_trylock F
+GLIBC_2.31 pthread_spin_unlock F
+GLIBC_2.31 pthread_testcancel F
+GLIBC_2.31 pthread_timedjoin_np F
+GLIBC_2.31 pthread_tryjoin_np F
+GLIBC_2.31 pthread_yield F
+GLIBC_2.31 pwrite F
+GLIBC_2.31 pwrite64 F
+GLIBC_2.31 raise F
+GLIBC_2.31 read F
+GLIBC_2.31 recv F
+GLIBC_2.31 recvfrom F
+GLIBC_2.31 recvmsg F
+GLIBC_2.31 sem_close F
+GLIBC_2.31 sem_destroy F
+GLIBC_2.31 sem_getvalue F
+GLIBC_2.31 sem_init F
+GLIBC_2.31 sem_open F
+GLIBC_2.31 sem_post F
+GLIBC_2.31 sem_timedwait F
+GLIBC_2.31 sem_trywait F
+GLIBC_2.31 sem_unlink F
+GLIBC_2.31 sem_wait F
+GLIBC_2.31 send F
+GLIBC_2.31 sendmsg F
+GLIBC_2.31 sendto F
+GLIBC_2.31 sigaction F
+GLIBC_2.31 sigwait F
+GLIBC_2.31 tcdrain F
+GLIBC_2.31 thrd_create F
+GLIBC_2.31 thrd_detach F
+GLIBC_2.31 thrd_exit F
+GLIBC_2.31 thrd_join F
+GLIBC_2.31 tss_create F
+GLIBC_2.31 tss_delete F
+GLIBC_2.31 tss_get F
+GLIBC_2.31 tss_set F
+GLIBC_2.31 wait F
+GLIBC_2.31 waitpid F
+GLIBC_2.31 write F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libresolv.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libresolv.abilist
new file mode 100644
index 00000000000..acd0b2e2de0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libresolv.abilist
@@ -0,0 +1,79 @@
+GLIBC_2.31 __b64_ntop F
+GLIBC_2.31 __b64_pton F
+GLIBC_2.31 __dn_comp F
+GLIBC_2.31 __dn_count_labels F
+GLIBC_2.31 __dn_expand F
+GLIBC_2.31 __dn_skipname F
+GLIBC_2.31 __fp_nquery F
+GLIBC_2.31 __fp_query F
+GLIBC_2.31 __fp_resstat F
+GLIBC_2.31 __hostalias F
+GLIBC_2.31 __loc_aton F
+GLIBC_2.31 __loc_ntoa F
+GLIBC_2.31 __p_cdname F
+GLIBC_2.31 __p_cdnname F
+GLIBC_2.31 __p_class F
+GLIBC_2.31 __p_class_syms D 0x54
+GLIBC_2.31 __p_fqname F
+GLIBC_2.31 __p_fqnname F
+GLIBC_2.31 __p_option F
+GLIBC_2.31 __p_query F
+GLIBC_2.31 __p_rcode F
+GLIBC_2.31 __p_time F
+GLIBC_2.31 __p_type F
+GLIBC_2.31 __p_type_syms D 0x228
+GLIBC_2.31 __putlong F
+GLIBC_2.31 __putshort F
+GLIBC_2.31 __res_close F
+GLIBC_2.31 __res_dnok F
+GLIBC_2.31 __res_hnok F
+GLIBC_2.31 __res_hostalias F
+GLIBC_2.31 __res_isourserver F
+GLIBC_2.31 __res_mailok F
+GLIBC_2.31 __res_mkquery F
+GLIBC_2.31 __res_nameinquery F
+GLIBC_2.31 __res_nmkquery F
+GLIBC_2.31 __res_nquery F
+GLIBC_2.31 __res_nquerydomain F
+GLIBC_2.31 __res_nsearch F
+GLIBC_2.31 __res_nsend F
+GLIBC_2.31 __res_ownok F
+GLIBC_2.31 __res_queriesmatch F
+GLIBC_2.31 __res_query F
+GLIBC_2.31 __res_querydomain F
+GLIBC_2.31 __res_search F
+GLIBC_2.31 __res_send F
+GLIBC_2.31 __sym_ntop F
+GLIBC_2.31 __sym_ntos F
+GLIBC_2.31 __sym_ston F
+GLIBC_2.31 _getlong F
+GLIBC_2.31 _getshort F
+GLIBC_2.31 inet_net_ntop F
+GLIBC_2.31 inet_net_pton F
+GLIBC_2.31 inet_neta F
+GLIBC_2.31 ns_datetosecs F
+GLIBC_2.31 ns_format_ttl F
+GLIBC_2.31 ns_get16 F
+GLIBC_2.31 ns_get32 F
+GLIBC_2.31 ns_initparse F
+GLIBC_2.31 ns_makecanon F
+GLIBC_2.31 ns_msg_getflag F
+GLIBC_2.31 ns_name_compress F
+GLIBC_2.31 ns_name_ntol F
+GLIBC_2.31 ns_name_ntop F
+GLIBC_2.31 ns_name_pack F
+GLIBC_2.31 ns_name_pton F
+GLIBC_2.31 ns_name_rollback F
+GLIBC_2.31 ns_name_skip F
+GLIBC_2.31 ns_name_uncompress F
+GLIBC_2.31 ns_name_unpack F
+GLIBC_2.31 ns_parse_ttl F
+GLIBC_2.31 ns_parserr F
+GLIBC_2.31 ns_put16 F
+GLIBC_2.31 ns_put32 F
+GLIBC_2.31 ns_samedomain F
+GLIBC_2.31 ns_samename F
+GLIBC_2.31 ns_skiprr F
+GLIBC_2.31 ns_sprintrr F
+GLIBC_2.31 ns_sprintrrf F
+GLIBC_2.31 ns_subdomain F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/librt.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/librt.abilist
new file mode 100644
index 00000000000..54f9db7c995
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/librt.abilist
@@ -0,0 +1,35 @@
+GLIBC_2.31 __mq_open_2 F
+GLIBC_2.31 aio_cancel F
+GLIBC_2.31 aio_cancel64 F
+GLIBC_2.31 aio_error F
+GLIBC_2.31 aio_error64 F
+GLIBC_2.31 aio_fsync F
+GLIBC_2.31 aio_fsync64 F
+GLIBC_2.31 aio_init F
+GLIBC_2.31 aio_read F
+GLIBC_2.31 aio_read64 F
+GLIBC_2.31 aio_return F
+GLIBC_2.31 aio_return64 F
+GLIBC_2.31 aio_suspend F
+GLIBC_2.31 aio_suspend64 F
+GLIBC_2.31 aio_write F
+GLIBC_2.31 aio_write64 F
+GLIBC_2.31 lio_listio F
+GLIBC_2.31 lio_listio64 F
+GLIBC_2.31 mq_close F
+GLIBC_2.31 mq_getattr F
+GLIBC_2.31 mq_notify F
+GLIBC_2.31 mq_open F
+GLIBC_2.31 mq_receive F
+GLIBC_2.31 mq_send F
+GLIBC_2.31 mq_setattr F
+GLIBC_2.31 mq_timedreceive F
+GLIBC_2.31 mq_timedsend F
+GLIBC_2.31 mq_unlink F
+GLIBC_2.31 shm_open F
+GLIBC_2.31 shm_unlink F
+GLIBC_2.31 timer_create F
+GLIBC_2.31 timer_delete F
+GLIBC_2.31 timer_getoverrun F
+GLIBC_2.31 timer_gettime F
+GLIBC_2.31 timer_settime F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libthread_db.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libthread_db.abilist
new file mode 100644
index 00000000000..95f6fb7aaba
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libthread_db.abilist
@@ -0,0 +1,40 @@
+GLIBC_2.31 td_init F
+GLIBC_2.31 td_log F
+GLIBC_2.31 td_symbol_list F
+GLIBC_2.31 td_ta_clear_event F
+GLIBC_2.31 td_ta_delete F
+GLIBC_2.31 td_ta_enable_stats F
+GLIBC_2.31 td_ta_event_addr F
+GLIBC_2.31 td_ta_event_getmsg F
+GLIBC_2.31 td_ta_get_nthreads F
+GLIBC_2.31 td_ta_get_ph F
+GLIBC_2.31 td_ta_get_stats F
+GLIBC_2.31 td_ta_map_id2thr F
+GLIBC_2.31 td_ta_map_lwp2thr F
+GLIBC_2.31 td_ta_new F
+GLIBC_2.31 td_ta_reset_stats F
+GLIBC_2.31 td_ta_set_event F
+GLIBC_2.31 td_ta_setconcurrency F
+GLIBC_2.31 td_ta_thr_iter F
+GLIBC_2.31 td_ta_tsd_iter F
+GLIBC_2.31 td_thr_clear_event F
+GLIBC_2.31 td_thr_dbresume F
+GLIBC_2.31 td_thr_dbsuspend F
+GLIBC_2.31 td_thr_event_enable F
+GLIBC_2.31 td_thr_event_getmsg F
+GLIBC_2.31 td_thr_get_info F
+GLIBC_2.31 td_thr_getfpregs F
+GLIBC_2.31 td_thr_getgregs F
+GLIBC_2.31 td_thr_getxregs F
+GLIBC_2.31 td_thr_getxregsize F
+GLIBC_2.31 td_thr_set_event F
+GLIBC_2.31 td_thr_setfpregs F
+GLIBC_2.31 td_thr_setgregs F
+GLIBC_2.31 td_thr_setprio F
+GLIBC_2.31 td_thr_setsigpending F
+GLIBC_2.31 td_thr_setxregs F
+GLIBC_2.31 td_thr_sigsetmask F
+GLIBC_2.31 td_thr_tls_get_addr F
+GLIBC_2.31 td_thr_tlsbase F
+GLIBC_2.31 td_thr_tsd F
+GLIBC_2.31 td_thr_validate F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist
new file mode 100644
index 00000000000..9eb091a2d5b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist
@@ -0,0 +1,6 @@
+GLIBC_2.31 forkpty F
+GLIBC_2.31 login F
+GLIBC_2.31 login_tty F
+GLIBC_2.31 logout F
+GLIBC_2.31 logwtmp F
+GLIBC_2.31 openpty F
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 11/24] RISC-V: define __NR_futex as __NR_futex_time64 for 32-bit
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (20 preceding siblings ...)
  2019-08-10  1:04 ` [RFC v4 20/24] RISC-V: Fix llrint and llround missing exceptions on RV32 Alistair Francis
@ 2019-08-10  1:04 ` Alistair Francis
  2019-08-10  1:04 ` [RFC v4 18/24] RISC-V: Add ABI lists Alistair Francis
  2019-08-10  1:04 ` [RFC v4 14/24] RISC-V: Support dynamic loader for the 32-bit Alistair Francis
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:04 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

The futex syscall isn't avaliable on R32 so let's define it to
be futex_time64 instead.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 sysdeps/unix/sysv/linux/riscv/sysdep.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h
index 5470ea3d2a6..b7607ef9f17 100644
--- a/sysdeps/unix/sysv/linux/riscv/sysdep.h
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h
@@ -116,6 +116,15 @@
 
 #include <sysdeps/unix/sysdep.h>
 
+#if __riscv_xlen == 32
+/* Define the __NR_futex as __NR_futex64 as RV32 doesn't have a
+ * __NR_futex syscall.
+ */
+# ifndef __NR_futex
+#  define __NR_futex __NR_futex_time64
+# endif
+#endif
+
 #undef SYS_ify
 #define SYS_ify(syscall_name)	__NR_##syscall_name
 
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [RFC v4 22/24] RISC-V: Use 64-bit vdso syscalls for RV32
  2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (18 preceding siblings ...)
  2019-08-10  1:04 ` [RFC v4 19/24] RISC-V: Build Infastructure for the 32-bit Alistair Francis
@ 2019-08-10  1:04 ` Alistair Francis
  2019-08-10  1:04 ` [RFC v4 20/24] RISC-V: Fix llrint and llround missing exceptions on RV32 Alistair Francis
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:04 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 sysdeps/unix/sysv/linux/clock_getres.c     |  4 ++++
 sysdeps/unix/sysv/linux/riscv/init-first.c | 26 +++++++++++++++++-----
 sysdeps/unix/sysv/linux/riscv/libc-vdso.h  | 12 +++++++---
 3 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/clock_getres.c b/sysdeps/unix/sysv/linux/clock_getres.c
index 24b2299938c..6982c754d6f 100644
--- a/sysdeps/unix/sysv/linux/clock_getres.c
+++ b/sysdeps/unix/sysv/linux/clock_getres.c
@@ -30,6 +30,10 @@
 int
 __clock_getres (clockid_t clock_id, struct timespec *res)
 {
+#ifndef __vdso_clock_getres
+   return INLINE_SYSCALL_CALL (clock_getres, clock_id, res);
+#else
   return INLINE_VSYSCALL (clock_getres, 2, clock_id, res);
+#endif
 }
 weak_alias (__clock_getres, clock_getres)
diff --git a/sysdeps/unix/sysv/linux/riscv/init-first.c b/sysdeps/unix/sysv/linux/riscv/init-first.c
index 35dc8a8d386..e5f72803464 100644
--- a/sysdeps/unix/sysv/linux/riscv/init-first.c
+++ b/sysdeps/unix/sysv/linux/riscv/init-first.c
@@ -22,12 +22,18 @@
 
 long int (*VDSO_SYMBOL (getcpu)) (unsigned int *, unsigned int *, void *)
     attribute_hidden;
-long int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
-    attribute_hidden;
-long int (*VDSO_SYMBOL (__clock_gettime64)) (clockid_t, struct __timespec64 *)
+
+#if __riscv_xlen == 64
+long int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct timespec *)
     attribute_hidden;
 long int (*VDSO_SYMBOL (clock_getres)) (clockid_t, struct timespec *)
     attribute_hidden;
+long int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
+    attribute_hidden;
+#else
+long int (*VDSO_SYMBOL (clock_gettime64)) (clockid_t, struct timespec *)
+    attribute_hidden;
+#endif
 
 static inline void
 _libc_vdso_platform_setup (void)
@@ -38,17 +44,25 @@ _libc_vdso_platform_setup (void)
   PTR_MANGLE (p);
   VDSO_SYMBOL (getcpu) = p;
 
-  p = _dl_vdso_vsym ("__vdso_gettimeofday", &linux_version);
+#if __riscv_xlen == 32
+  p = _dl_vdso_vsym ("__vdso_clock_gettime64", &linux_version);
   PTR_MANGLE (p);
-  VDSO_SYMBOL (gettimeofday) = p;
-
+  VDSO_SYMBOL (clock_gettime64) = p;
+#else
   p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux_version);
   PTR_MANGLE (p);
   VDSO_SYMBOL (clock_gettime) = p;
+#endif
+
+#if __riscv_xlen == 64
+  p = _dl_vdso_vsym ("__vdso_gettimeofday", &linux_version);
+  PTR_MANGLE (p);
+  VDSO_SYMBOL (gettimeofday) = p;
 
   p = _dl_vdso_vsym ("__vdso_clock_getres", &linux_version);
   PTR_MANGLE (p);
   VDSO_SYMBOL (clock_getres) = p;
+#endif
 }
 
 #define VDSO_SETUP _libc_vdso_platform_setup
diff --git a/sysdeps/unix/sysv/linux/riscv/libc-vdso.h b/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
index 16905d5b78d..da4ec9b2ed7 100644
--- a/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
@@ -24,11 +24,17 @@
 
 extern long int (*VDSO_SYMBOL (getcpu)) (unsigned int *, unsigned int *, void *)
     attribute_hidden;
-extern long int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
-    attribute_hidden;
-extern long int (*VDSO_SYMBOL (__clock_gettime64)) (clockid_t, struct __timespec64 *)
+
+#if __riscv_xlen == 64
+extern long int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct timespec *)
     attribute_hidden;
 extern long int (*VDSO_SYMBOL (clock_getres)) (clockid_t, struct timespec *)
     attribute_hidden;
+extern long int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
+    attribute_hidden;
+#else
+extern long int (*VDSO_SYMBOL (clock_gettime64)) (clockid_t, struct timespec *)
+    attribute_hidden;
+#endif
 
 #endif /* _LIBC_VDSO_H */
-- 
2.22.0

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-10  1:03 ` [RFC v4 07/24] time: Deprecate struct timezone members Alistair Francis
@ 2019-08-10  1:20   ` Paul Eggert
  2019-08-10  1:30     ` Alistair Francis
  2019-08-12 15:42   ` Zack Weinberg
  1 sibling, 1 reply; 73+ messages in thread
From: Paul Eggert @ 2019-08-10  1:20 UTC (permalink / raw)
  To: Alistair Francis, libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox, alistair23

Alistair Francis wrote:
> -    int tz_minuteswest;		/* Minutes west of GMT.  */
> -    int tz_dsttime;		/* Nonzero if DST is ever in effect.  */
> +    int tz_minuteswest_dep;		/* Minutes west of GMT.  */
> +    int tz_dsttime_dep;		/* Nonzero if DST is ever in effect.  */
These two members should be declared with __attribute_deprecated__. And once we 
do that, do we still need to change their names? I don't recall any other 
instance of such name-changing.

If we do change their names, I suggest a more-obvious suffix than "_dep" (which 
could stand for a lot of things); "_deprecated" would be clearer.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 24/24] timerfd_settime: Use 64-bit call if avaliable
  2019-08-10  1:04 ` [RFC v4 24/24] timerfd_settime: Use 64-bit call if avaliable Alistair Francis
@ 2019-08-10  1:28   ` Alistair Francis
  2019-08-20 20:11     ` Maciej W. Rozycki
  2019-08-12 20:09   ` Joseph Myers
  1 sibling, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:28 UTC (permalink / raw)
  To: Alistair Francis
  Cc: GNU C Library, Arnd Bergmann, Adhemerval Zanella, Florian Weimer,
	Palmer Dabbelt, macro, Zong Li

On Fri, Aug 9, 2019 at 6:04 PM Alistair Francis
<alistair.francis@wdc.com> wrote:
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---

This commit was clearly not tested very well (it's missing
semicolons), just see it more as pseudo code.

Alistair

>  sysdeps/unix/sysv/linux/Makefile          |   2 +
>  sysdeps/unix/sysv/linux/sys/timerfd.h     |  21 +++--
>  sysdeps/unix/sysv/linux/syscalls.list     |   1 -
>  sysdeps/unix/sysv/linux/timerfd_settime.c | 104 ++++++++++++++++++++++
>  4 files changed, 120 insertions(+), 8 deletions(-)
>  create mode 100644 sysdeps/unix/sysv/linux/timerfd_settime.c
>
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 1ab6bcbfc81..89128e80868 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -19,6 +19,8 @@ sysdep_routines += clone umount umount2 readahead \
>                    eventfd eventfd_read eventfd_write prlimit \
>                    personality epoll_wait tee vmsplice splice \
>                    open_by_handle_at mlock2 pkey_mprotect pkey_set pkey_get
> +                  timerfd_settime
> +
>
>  CFLAGS-gethostid.c = -fexceptions
>  CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables
> diff --git a/sysdeps/unix/sysv/linux/sys/timerfd.h b/sysdeps/unix/sysv/linux/sys/timerfd.h
> index 5e5ad351a0d..51f63b357c1 100644
> --- a/sysdeps/unix/sysv/linux/sys/timerfd.h
> +++ b/sysdeps/unix/sysv/linux/sys/timerfd.h
> @@ -24,6 +24,13 @@
>  /* Get the platform-dependent flags.  */
>  #include <bits/timerfd.h>
>
> +#if __TIMESIZE == 32
> +struct __itimerspec64
> +  {
> +    struct __timespec64 it_interval;
> +    struct __timespec64 it_value;
> +  };
> +#endif
>
>  /* Bits to be set in the FLAGS parameter of `timerfd_settime'.  */
>  enum
> @@ -40,16 +47,16 @@ __BEGIN_DECLS
>  /* Return file descriptor for new interval timer source.  */
>  extern int timerfd_create (__clockid_t __clock_id, int __flags) __THROW;
>
> -/* Set next expiration time of interval timer source UFD to UTMR.  If
> -   FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
> -   absolute.  Optionally return the old expiration time in OTMR.  */
> -extern int timerfd_settime (int __ufd, int __flags,
> -                           const struct itimerspec *__utmr,
> -                           struct itimerspec *__otmr) __THROW;
> -
>  /* Return the next expiration time of UFD.  */
>  extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
>
>  __END_DECLS
>
> +/* Set next expiration time of interval timer source UFD to UTMR.  If
> +   FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
> +   absolute.  Optionally return the old expiration time in OTMR.  */
> +int timerfd_settime (int __ufd, int __flags,
> +        const struct itimerspec *__utmr,
> +        struct itimerspec *__otmr) __THROW;
> +
>  #endif /* sys/timerfd.h */
> diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
> index 4844d1a9a3b..3fa1a5de63a 100644
> --- a/sysdeps/unix/sysv/linux/syscalls.list
> +++ b/sysdeps/unix/sysv/linux/syscalls.list
> @@ -96,7 +96,6 @@ fremovexattr  -       fremovexattr    i:is    fremovexattr
>  mq_setattr     -       mq_getsetattr   i:ipp   mq_setattr
>
>  timerfd_create EXTRA   timerfd_create  i:ii    timerfd_create
> -timerfd_settime        EXTRA   timerfd_settime64       i:iipp  timerfd_settime
>  timerfd_gettime        EXTRA   timerfd_gettime64       i:ip    timerfd_gettime
>
>  fanotify_init  EXTRA   fanotify_init   i:ii    fanotify_init
> diff --git a/sysdeps/unix/sysv/linux/timerfd_settime.c b/sysdeps/unix/sysv/linux/timerfd_settime.c
> new file mode 100644
> index 00000000000..830faeada77
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/timerfd_settime.c
> @@ -0,0 +1,104 @@
> +/* Copyright (C) 2003-2019 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public License as
> +   published by the Free Software Foundation; either version 2.1 of the
> +   License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; see the file COPYING.LIB.  If
> +   not, see <http://www.gnu.org/licenses/>.  */
> +
> +#include <errno.h>
> +#include <stdlib.h>
> +#include <time.h>
> +#include <sysdep.h>
> +
> +int
> +timerfd_settime (int __ufd, int __flags, const struct itimerspec *__utmr,
> +                 struct itimerspec *__otmr)
> +{
> +#ifdef __ASSUME_TIME64_SYSCALLS
> +  /* Delete the kernel timer object.  */
> +   return INLINE_SYSCALL (timerfd_settime64, 4, __ufd, __flags, __utmr, __otmr);
> +#else
> +   int ret;
> +# ifdef __NR_timerfd_settime64
> +#  if __TIMESIZE == 64
> +  ret = INLINE_SYSCALL (timerfd_settime64, 4, __ufd, __flags, __utmr, __otmr);
> +
> +  if (ret == 0 || errno != ENOSYS)
> +    {
> +      return ret;
> +    }
> +#  else
> +  struct __itimerspec64 ts64;
> +  ret = INLINE_SYSCALL (timerfd_settime64, 4, __ufd, __flags, __utmr, &ts64);
> +
> +  if (ret == 0 || errno != ENOSYS)
> +    {
> +      __utmr->it_interval.tv_sec = ts64.it_interval.tv_sec
> +      __utmr->it_interval.tv_nsec = ts64.it_interval.tv_nsec
> +      if (! in_time_t_range (__utmr->it_interval.tv_sec))
> +        {
> +          __set_errno (EOVERFLOW);
> +          return -1;
> +        }
> +
> +      __utmr->it_value.tv_sec = ts64.it_value.tv_sec
> +      __utmr->it_value.tv_nsec = ts64.it_value.tv_nsec
> +      if (! in_time_t_range (__utmr->it_value.tv_sec))
> +        {
> +          __set_errno (EOVERFLOW);
> +          return -1;
> +        }
> +
> +      return 0;
> +    }
> +#  endif /* __TIMESIZE == 64 */
> +# endif /* __NR_timerfd_settime */
> +# if __TIMESIZE == 64
> +  struct itimerspec ts32;
> +
> +  if (! in_time_t_range (__utmr->it_interval.tv_sec) ||
> +      ! in_time_t_range (__utmr->it_value.tv_sec))
> +    {
> +      __set_errno (EOVERFLOW);
> +      return -1;
> +    }
> +
> +  ret = INLINE_SYSCALL (timerfd_settime, 4, __ufd, __flags, __utmr, &ts32);
> +
> +  if (ret == 0 || errno != ENOSYS)
> +    {
> +      __utmr->it_interval.tv_sec = ts32.it_interval.tv_sec
> +      __utmr->it_interval.tv_nsec = ts32.it_interval.tv_nsec
> +      if (! in_time_t_range (__utmr->it_interval.tv_sec))
> +        {
> +          __set_errno (EOVERFLOW);
> +          return -1;
> +        }
> +
> +      __utmr->it_value.tv_sec = ts32.it_value.tv_sec
> +      __utmr->it_value.tv_nsec = ts32.it_value.tv_nsec
> +      if (! in_time_t_range (__utmr->it_value.tv_sec))
> +        {
> +          __set_errno (EOVERFLOW);
> +          return -1;
> +        }
> +
> +      return 0;
> +    }
> +  return ret;
> +# else
> +    return INLINE_SYSCALL (timerfd_settime, 4, __ufd, __flags, __utmr, __otmr);
> +# endif /* __TIMESIZE == 64 */
> +#endif /* __ASSUME_TIME64_SYSCALLS */
> +}
> --
> 2.22.0
>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-10  1:20   ` Paul Eggert
@ 2019-08-10  1:30     ` Alistair Francis
  2019-08-11 13:52       ` Florian Weimer
  0 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-10  1:30 UTC (permalink / raw)
  To: Paul Eggert
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Fri, Aug 9, 2019 at 6:20 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
>
> Alistair Francis wrote:
> > -    int tz_minuteswest;              /* Minutes west of GMT.  */
> > -    int tz_dsttime;          /* Nonzero if DST is ever in effect.  */
> > +    int tz_minuteswest_dep;          /* Minutes west of GMT.  */
> > +    int tz_dsttime_dep;              /* Nonzero if DST is ever in effect.  */
> These two members should be declared with __attribute_deprecated__. And once we
> do that, do we still need to change their names? I don't recall any other
> instance of such name-changing.

The name changing is coming from a suggestion here [1]. I do find it a
little aggressive though as I do see some build failures, specifically
for systemd.

>
> If we do change their names, I suggest a more-obvious suffix than "_dep" (which
> could stand for a lot of things); "_deprecated" would be clearer.

I'll change the name if we still decided to stick with the name change.

1: https://sourceware.org/ml/libc-alpha/2019-07/msg00614.html

Alistair

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-10  1:30     ` Alistair Francis
@ 2019-08-11 13:52       ` Florian Weimer
  2019-08-11 16:59         ` Alistair Francis
  2019-08-11 17:28         ` Rich Felker
  0 siblings, 2 replies; 73+ messages in thread
From: Florian Weimer @ 2019-08-11 13:52 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Paul Eggert, Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Palmer Dabbelt, macro, Zong Li

* Alistair Francis:

> On Fri, Aug 9, 2019 at 6:20 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
>>
>> Alistair Francis wrote:
>> > -    int tz_minuteswest;              /* Minutes west of GMT.  */
>> > -    int tz_dsttime;          /* Nonzero if DST is ever in effect.  */
>> > +    int tz_minuteswest_dep;          /* Minutes west of GMT.  */
>> > +    int tz_dsttime_dep;              /* Nonzero if DST is ever in effect.  */
>> These two members should be declared with __attribute_deprecated__. And once we
>> do that, do we still need to change their names? I don't recall any other
>> instance of such name-changing.
>
> The name changing is coming from a suggestion here [1]. I do find it a
> little aggressive though as I do see some build failures, specifically
> for systemd.

Good point.  systemd does this:

        tz.tz_minuteswest = -minutesdelta;
        tz.tz_dsttime = 0; /* DST_NONE */

        /*
         * If the RTC does not run in UTC but in local time, the very first
         * call to settimeofday() will set the kernel's timezone and will warp the
         * system clock, so that it runs in UTC instead of the local time we
         * have read from the RTC.
         */
        if (settimeofday(tv_null, &tz) < 0)
                return negative_errno();

It seems to me that struct timezone is not actually deprecated on the
kernel side when used with settimeofday.  This would be something which
has to happen before we can change its definition.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-11 13:52       ` Florian Weimer
@ 2019-08-11 16:59         ` Alistair Francis
  2019-08-11 17:28         ` Rich Felker
  1 sibling, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-11 16:59 UTC (permalink / raw)
  To: Florian Weimer
  Cc: Paul Eggert, Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Palmer Dabbelt, macro, Zong Li

On Sun, Aug 11, 2019 at 6:52 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Alistair Francis:
>
> > On Fri, Aug 9, 2019 at 6:20 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
> >>
> >> Alistair Francis wrote:
> >> > -    int tz_minuteswest;              /* Minutes west of GMT.  */
> >> > -    int tz_dsttime;          /* Nonzero if DST is ever in effect.  */
> >> > +    int tz_minuteswest_dep;          /* Minutes west of GMT.  */
> >> > +    int tz_dsttime_dep;              /* Nonzero if DST is ever in effect.  */
> >> These two members should be declared with __attribute_deprecated__. And once we
> >> do that, do we still need to change their names? I don't recall any other
> >> instance of such name-changing.
> >
> > The name changing is coming from a suggestion here [1]. I do find it a
> > little aggressive though as I do see some build failures, specifically
> > for systemd.
>
> Good point.  systemd does this:
>
>         tz.tz_minuteswest = -minutesdelta;
>         tz.tz_dsttime = 0; /* DST_NONE */
>
>         /*
>          * If the RTC does not run in UTC but in local time, the very first
>          * call to settimeofday() will set the kernel's timezone and will warp the
>          * system clock, so that it runs in UTC instead of the local time we
>          * have read from the RTC.
>          */
>         if (settimeofday(tv_null, &tz) < 0)
>                 return negative_errno();
>
> It seems to me that struct timezone is not actually deprecated on the
> kernel side when used with settimeofday.  This would be something which
> has to happen before we can change its definition.

Ok, so in this case for 32-bit y2038 safe platforms (without
gettimeofday and settimeofday) we still seem fine to ignore the struct
timezone. It doesn't look like we can rename the members yet though.
Can we mark them as deprecated in the glibc source? That will just
generate warnings instead of errors right?

Alistair

>
> Thanks,
> Florian

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-11 13:52       ` Florian Weimer
  2019-08-11 16:59         ` Alistair Francis
@ 2019-08-11 17:28         ` Rich Felker
  2019-08-12  8:22           ` Florian Weimer
  1 sibling, 1 reply; 73+ messages in thread
From: Rich Felker @ 2019-08-11 17:28 UTC (permalink / raw)
  To: libc-alpha

On Sun, Aug 11, 2019 at 03:52:45PM +0200, Florian Weimer wrote:
> * Alistair Francis:
> 
> > On Fri, Aug 9, 2019 at 6:20 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
> >>
> >> Alistair Francis wrote:
> >> > -    int tz_minuteswest;              /* Minutes west of GMT.  */
> >> > -    int tz_dsttime;          /* Nonzero if DST is ever in effect.  */
> >> > +    int tz_minuteswest_dep;          /* Minutes west of GMT.  */
> >> > +    int tz_dsttime_dep;              /* Nonzero if DST is ever in effect.  */
> >> These two members should be declared with __attribute_deprecated__. And once we
> >> do that, do we still need to change their names? I don't recall any other
> >> instance of such name-changing.
> >
> > The name changing is coming from a suggestion here [1]. I do find it a
> > little aggressive though as I do see some build failures, specifically
> > for systemd.
> 
> Good point.  systemd does this:
> 
>         tz.tz_minuteswest = -minutesdelta;
>         tz.tz_dsttime = 0; /* DST_NONE */
> 
>         /*
>          * If the RTC does not run in UTC but in local time, the very first
>          * call to settimeofday() will set the kernel's timezone and will warp the
>          * system clock, so that it runs in UTC instead of the local time we
>          * have read from the RTC.
>          */
>         if (settimeofday(tv_null, &tz) < 0)
>                 return negative_errno();
> 
> It seems to me that struct timezone is not actually deprecated on the
> kernel side when used with settimeofday.  This would be something which
> has to happen before we can change its definition.

The only effect I'm aware of it ever having had on the kernel side was
actively harmful: applying the offset to the timestamps of all files
on fatfs mounts. This has all kinds of consistency problems with DST,
timezone changes, etc. and is lossy/destructive of data. Back in 2005
I recall writing a script to do a best-case repair on digital camera
timestamps (correctly recorded on the fatfs in UTC) that Linux mangled
via moving them to hdd under several different local timezones.

systemd should not be doing this at all. If anyone wants this feature
it should be a mount option tzoff=..., not a global that's secretly
set to match your system tz.

Rich

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-11 17:28         ` Rich Felker
@ 2019-08-12  8:22           ` Florian Weimer
  0 siblings, 0 replies; 73+ messages in thread
From: Florian Weimer @ 2019-08-12  8:22 UTC (permalink / raw)
  To: Rich Felker; +Cc: libc-alpha

* Rich Felker:

> On Sun, Aug 11, 2019 at 03:52:45PM +0200, Florian Weimer wrote:
>> * Alistair Francis:
>> 
>> > On Fri, Aug 9, 2019 at 6:20 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
>> >>
>> >> Alistair Francis wrote:
>> >> > -    int tz_minuteswest;              /* Minutes west of GMT.  */
>> >> > -    int tz_dsttime;          /* Nonzero if DST is ever in effect.  */
>> >> > +    int tz_minuteswest_dep;          /* Minutes west of GMT.  */
>> >> > +    int tz_dsttime_dep;              /* Nonzero if DST is ever in effect.  */
>> >> These two members should be declared with __attribute_deprecated__. And once we
>> >> do that, do we still need to change their names? I don't recall any other
>> >> instance of such name-changing.
>> >
>> > The name changing is coming from a suggestion here [1]. I do find it a
>> > little aggressive though as I do see some build failures, specifically
>> > for systemd.
>> 
>> Good point.  systemd does this:
>> 
>>         tz.tz_minuteswest = -minutesdelta;
>>         tz.tz_dsttime = 0; /* DST_NONE */
>> 
>>         /*
>>          * If the RTC does not run in UTC but in local time, the very first
>>          * call to settimeofday() will set the kernel's timezone and will warp the
>>          * system clock, so that it runs in UTC instead of the local time we
>>          * have read from the RTC.
>>          */
>>         if (settimeofday(tv_null, &tz) < 0)
>>                 return negative_errno();
>> 
>> It seems to me that struct timezone is not actually deprecated on the
>> kernel side when used with settimeofday.  This would be something which
>> has to happen before we can change its definition.
>
> The only effect I'm aware of it ever having had on the kernel side was
> actively harmful: applying the offset to the timestamps of all files
> on fatfs mounts. This has all kinds of consistency problems with DST,
> timezone changes, etc. and is lossy/destructive of data. Back in 2005
> I recall writing a script to do a best-case repair on digital camera
> timestamps (correctly recorded on the fatfs in UTC) that Linux mangled
> via moving them to hdd under several different local timezones.

Fair enough.  I filed:

  <https://github.com/systemd/systemd/issues/13305>

Let's see what happens.

> systemd should not be doing this at all. If anyone wants this feature
> it should be a mount option tzoff=..., not a global that's secretly
> set to match your system tz.

It looks like time_offset already exists.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-10  1:03 ` [RFC v4 07/24] time: Deprecate struct timezone members Alistair Francis
  2019-08-10  1:20   ` Paul Eggert
@ 2019-08-12 15:42   ` Zack Weinberg
  2019-08-12 20:20     ` Joseph Myers
  2019-08-12 22:11     ` Alistair Francis
  1 sibling, 2 replies; 73+ messages in thread
From: Zack Weinberg @ 2019-08-12 15:42 UTC (permalink / raw)
  To: Alistair Francis, GNU C Library

On Fri, Aug 9, 2019 at 9:04 PM Alistair Francis
<alistair.francis@wdc.com> wrote:
>
> Append the struct timezone members with '_dep'. This indicates that
> these members are deprecated and will cause build failures on code that
> is currently using the members.

I had been working on a more thorough version of this patch, one that
removed these fields altogether (replacing them with `char
__preserve_historic_size[2*sizeof(int)]`) and changed _all_ of the
code that touches them, within glibc, to either ignore the fields or
zero them out.  This patch tripped over an Alpha-only ABI headache
(Alpha has compatibility versions of both gettimeofday and
settimeofday) and then I ran out of time to work on it.

In view of the reported behavior of systemd, though, I now think
neither your approach nor mine is exactly what we should do.  We
should do something along these lines for the next release:

 - We should _not_ rename the fields of struct timezone, but we should
mark them __attribute_deprecated__ so that code still using them
triggers compile warnings.
 - We should do the same for the timezone fields of struct timeb.
 - Our implementation of gettimeofday should always pass NULL for
struct timezone to the kernel, and write zeroes to any struct timezone
argument that is supplied.  (This will transitively apply to ftime.)
 - We should leave settimeofday alone until the kernel has an
alternative means of doing the "RTC clock warp" thing that systemd is
trying to do.

Do you have time to work that patch up?  You can get my
patch-in-progress from
https://sourceware.org/git/?p=glibc.git;a=log;h=refs/heads/zack/gtod-no-timezone
(please grab at least the changes to manual/time.texi).  If you don't
have time, I will try to find time to work on it this week.

zw

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 02/24] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-08-10  1:03 ` [RFC v4 02/24] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable Alistair Francis
@ 2019-08-12 17:22   ` Joseph Myers
  2019-08-14 18:24     ` Alistair Francis
  0 siblings, 1 reply; 73+ messages in thread
From: Joseph Myers @ 2019-08-12 17:22 UTC (permalink / raw)
  To: Alistair Francis
  Cc: libc-alpha, arnd, adhemerval.zanella, fweimer, palmer, macro,
	zongbox, alistair23

On Fri, 9 Aug 2019, Alistair Francis wrote:

> diff --git a/nptl/thrd_sleep.c b/nptl/thrd_sleep.c
> index 07a51808df2..fc495b56c67 100644
> --- a/nptl/thrd_sleep.c
> +++ b/nptl/thrd_sleep.c
> @@ -25,14 +25,68 @@ int
>  thrd_sleep (const struct timespec* time_point, struct timespec* remaining)
>  {
>    INTERNAL_SYSCALL_DECL (err);
> -  int ret = INTERNAL_SYSCALL_CANCEL (nanosleep, err, time_point, remaining);
> +  int ret = -1;
> +
> +#ifdef __ASSUME_TIME64_SYSCALLS
> +  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, CLOCK_REALTIME,
> +                                 0, time_point, remaining);
> +#else

This still has the same problem as has been explained for previous 
versions of the patch series: if time_t is 32-bit but 
__ASSUME_TIME64_SYSCALLS is defined, it is not valid to call the 
clock_nanosleep_time64 with a 32-bit timespec; you have to call it with a 
64-bit timespec.  That is, if you call clock_nanosleep_time64 at all in 
the case where the original function was called with a 32-bit timespec 
(and I think you should do so) then you need to have conversions.

Please fix this *throughout* the patch series *before* posting the next 
version.  That is, for every patch in the series you need to consider what 
is appropriate for systems with 32-bit time - *not* just what is 
appropriate for RV32.

The pattern we have previously discussed for 64-bit time support is that 
the code should (a) define the function (__thrd_sleep_time64, say) for 
64-bit time (which then only needs conversions in the reverse direction - 
if the 64-bit syscall is not in fact available, but the 32-bit one is), 
(b) if __TIMESIZE != 64, defines the 32-bit function as a thin wrapper 
round that, (c) in the appropriate internal header, has a #define of the 
name such as __thrd_sleep_time64 to the name such as thrd_sleep, in the 
case where __TIMESIZE == 64 and thus no wrapper is needed.

> +# ifdef __NR_clock_nanosleep_time64
> +#  if __TIMESIZE == 64
> +  long int ret_64;
> +
> +  ret_64 = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, CLOCK_REALTIME,
> +                                    0, time_point, remaining);
> +
> +  if (ret_64 == 0 || errno != ENOSYS)
> +    ret = ret_64;
> +#  else
> +  timespec64 ts64;
> +
> +  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> +                                 CLOCK_REALTIME, 0, time_point,
> +                                 ts64);
> +
> +  if (ret == 0 || errno != ENOSYS)
> +    {
> +      remaining->tv_sec = ts64.tv_sec;
> +      remaining->tv_nsec = ts64.tv_nsec;
> +    }

thrd_sleep has *two* timespec arguments, one input and one output.  It's 
not sufficient to just convert the output, as here; if you're doing 
conversions, you have to convert *both*.

It is valid for the output argument to be NULL.  You need to avoid writing 
to *remaining in that case.

Please try to test such 64-bit time changes in configurations covering as 
many of the different cases in the code as possible, both at compile time 
and at run time, and include details in the patch submissions of what 
configurations you tested (architecture, kernel headers version, 
--enable-kernel version, kernel version used when running the testsuite).  
I'd hope such testing would have shown up the issue with the output 
argument being NULL, as well as the ABI breakage.

Relevant configurations should include at least (a) one that has always 
had 64-bit time, e.g. x86_64; (b) one with 32-bit time and old kernel 
headers (any kernel version at runtime); (c) one with 32-bit time and new 
kernel headers, old kernel at runtime; (d) one with 32-bit time and new 
kernel headers, new kernel at runtime but no --enable-kernel; (e) one with 
32-bit time and new kernel at runtime and new --enable-kernel.  (New = 5.1 
or later.)  I think that's a basic minimum for testing any patches related 
to 64-bit time.  (If Florian's changes to provide syscall tables within 
glibc go in, case (b) disappears.)

(In this case, you're also passing the struct ts64 by value to the syscall 
rather than a pointer to it.  And as this is C, not C++, I'm not sure a 
declaration "timespec64 ts64;" without "struct" would have compiled.)

> diff --git a/sysdeps/unix/sysv/linux/nanosleep.c b/sysdeps/unix/sysv/linux/nanosleep.c

> +#if __TIMESIZE == 32
> +struct timespec64
> +{
> +  long long int tv_sec;   /* Seconds.  */
> +  long int tv_nsec;  /* Nanoseconds.  */
> +};

If we need such a structure different from the "struct __timespec64" in 
Lukasz's patches, it surely does not belong in the .c file for one 
particular function without a very detailed comment explaining exactly why 
it's so specific to that function rather than in a more generic internal 
header.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 03/24] sysdeps/gettimeofday: Use clock_gettime64 if avaliable
  2019-08-10  1:03 ` [RFC v4 03/24] sysdeps/gettimeofday: Use clock_gettime64 if avaliable Alistair Francis
@ 2019-08-12 17:27   ` Joseph Myers
  0 siblings, 0 replies; 73+ messages in thread
From: Joseph Myers @ 2019-08-12 17:27 UTC (permalink / raw)
  To: Alistair Francis
  Cc: libc-alpha, arnd, adhemerval.zanella, fweimer, palmer, macro,
	zongbox, alistair23

On Fri, 9 Aug 2019, Alistair Francis wrote:

> The Linux documentation says that "The use of the timezone structure
> is obsolete; the tz argument should normally be specified as NULL."

The relevant information to include in commit messages here isn't what the 
documentation says, it's what the interfaces actually do, as detailed in 
<https://sourceware.org/ml/libc-alpha/2019-07/msg00574.html>.

>  __gettimeofday (struct timeval *tv, struct timezone *tz)

> +#ifdef __ASSUME_TIME64_SYSCALLS
> +  long int ret;
> +  struct timespec now;
> +
> +  ret = INLINE_VSYSCALL (clock_gettime64, 2, CLOCK_REALTIME,
> +                         &now);

This is using a timespec (possibly 32-bit) with a syscall that requires 
the 64-bit version.  You need to address such issues throughout the patch 
series.  As illustrated here, it's not just cases where you have a 
mismatch with the function interface; you need to make sure, in every 
case, that where you pass internal variables to 64-bit time syscalls they 
have the correct type as well.

> +#else
> +# ifdef __NR_clock_nanosleep_time64

No, this code isn't using clock_nanosleep_time64.  The #ifdef should be 
for the syscall it actually uses.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 05/24] sysdeps/clock_gettime: Use clock_gettime64 if avaliable
  2019-08-10  1:03 ` [RFC v4 05/24] sysdeps/clock_gettime: " Alistair Francis
@ 2019-08-12 19:46   ` Joseph Myers
  2019-08-13 23:48     ` Alistair Francis
  0 siblings, 1 reply; 73+ messages in thread
From: Joseph Myers @ 2019-08-12 19:46 UTC (permalink / raw)
  To: Alistair Francis
  Cc: libc-alpha, arnd, adhemerval.zanella, fweimer, palmer, macro,
	zongbox, alistair23

On Fri, 9 Aug 2019, Alistair Francis wrote:

>  /* Get current value of CLOCK and store it in TP.  */
> +
>  int
>  __clock_gettime (clockid_t clock_id, struct timespec *tp)
>  {
> -  return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp);
> +
> +#ifdef __ASSUME_TIME64_SYSCALLS
> +   return INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp);
> +#else

This has the usual problems with missing conversions.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
  2019-08-10  1:03 ` [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable Alistair Francis
@ 2019-08-12 19:46   ` Joseph Myers
  2019-08-15 18:03     ` Alistair Francis
  0 siblings, 1 reply; 73+ messages in thread
From: Joseph Myers @ 2019-08-12 19:46 UTC (permalink / raw)
  To: Alistair Francis
  Cc: libc-alpha, arnd, adhemerval.zanella, fweimer, palmer, macro,
	zongbox, alistair23

On Fri, 9 Aug 2019, Alistair Francis wrote:

> diff --git a/sysdeps/unix/sysv/linux/timespec_get.c b/sysdeps/unix/sysv/linux/timespec_get.c
> index 52080ddf08a..97ef9c5f799 100644
> --- a/sysdeps/unix/sysv/linux/timespec_get.c
> +++ b/sysdeps/unix/sysv/linux/timespec_get.c
> @@ -24,6 +24,58 @@
>  #endif
>  #include <sysdep-vdso.h>
>  
> +int
> +__timespec_get (struct timespec *ts, int base)
> +{
> +#ifdef __ASSUME_TIME64_SYSCALLS
> +  return INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
> +#else

This has the usual problems with missing conversions.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 08/24] sysdeps/stat: Copy the statx struct to stat instead of stat64
  2019-08-10  1:03 ` [RFC v4 08/24] sysdeps/stat: Copy the statx struct to stat instead of stat64 Alistair Francis
@ 2019-08-12 20:01   ` Joseph Myers
  2019-08-12 22:26     ` Alistair Francis
  0 siblings, 1 reply; 73+ messages in thread
From: Joseph Myers @ 2019-08-12 20:01 UTC (permalink / raw)
  To: Alistair Francis
  Cc: libc-alpha, arnd, adhemerval.zanella, fweimer, palmer, macro,
	zongbox, alistair23

On Fri, 9 Aug 2019, Alistair Francis wrote:

> When copying the statx struct to the stat stuct use the original stat
> struct instead of the stat64 struct. As the padding in the original is
> type 'unsigned short int' but the padding in the stat64 is 'unsigned int'
> the copy  can result in misallgined data. This would then incorrectly
> trigger the stat_overflow() failure.

This indicates there's something else wrong with the port.  By design, the 
following apply for linux/generic/wordsize-32 ports of glibc:

* The layout of struct stat and struct stat64 is identical, except that 
some bytes that are padding in struct stat serve as high parts of fields 
that are wider in struct stat64 (and thus have endian-dependent positions 
as determined by the __field64 macro in bits/stat.h).

* Conversions from statx have to go to stat64, including setting those 
high parts as appropriate, so that the subsequent overflow checks (which 
work by examining those padding fields) can correctly detect whether 
overflow occurred and set errno to EOVERFLOW accordingly.  See my C-SKY 
port reviews that resulted in the code we have now 
<https://sourceware.org/ml/libc-alpha/2018-11/msg00624.html> 
<https://sourceware.org/ml/libc-alpha/2018-11/msg00668.html>.

> This would be very obvious when using a 64-bit ino_t type on a 32-bit
> system, such as the RV32 port.

If those types are 64-bit, you should not have padding around them in 
struct stat, so as to preserve the property that struct stat and struct 
stat64 have the same layout.  I suppose this means bits/stat.h needs to 
check further macros such as __OFF_T_MATCHES_OFF64_T.

You'll also need to ensure that XSTAT_IS_XSTAT64 is defined to 1.  And 
you'll need to make wordsize-32/overflow.h define trivial versions of the 
*_overflow functions in cases where the types match (this should be done 
in that file, rather than making an RV32-specific copy, to benefit future 
ports that make the same choices as RV32).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 09/24] Documentation for the RISC-V 32-bit port
  2019-08-10  1:03 ` [RFC v4 09/24] Documentation for the RISC-V 32-bit port Alistair Francis
@ 2019-08-12 20:02   ` Joseph Myers
  0 siblings, 0 replies; 73+ messages in thread
From: Joseph Myers @ 2019-08-12 20:02 UTC (permalink / raw)
  To: Alistair Francis
  Cc: libc-alpha, arnd, adhemerval.zanella, fweimer, palmer, macro,
	zongbox, alistair23

On Fri, 9 Aug 2019, Alistair Francis wrote:

> diff --git a/NEWS b/NEWS
> index 4326997dddf..27742944e9a 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -306,6 +306,12 @@ Major new features:
>    "%EY" to control how the year number is formatted; they have the
>    same effect that they would on "%Ey".
>  
> +* Support RISC-V port for 32-bit. The ISA and ABI pairs supported as follows:
> +
> +    - rv32imac ilp32
> +    - rv32imafdc ilp32
> +    - rv32imafdc ilp32d

This is the 2.29 section of NEWS.  You need to add to the 2.31 section.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 24/24] timerfd_settime: Use 64-bit call if avaliable
  2019-08-10  1:04 ` [RFC v4 24/24] timerfd_settime: Use 64-bit call if avaliable Alistair Francis
  2019-08-10  1:28   ` Alistair Francis
@ 2019-08-12 20:09   ` Joseph Myers
  1 sibling, 0 replies; 73+ messages in thread
From: Joseph Myers @ 2019-08-12 20:09 UTC (permalink / raw)
  To: Alistair Francis
  Cc: libc-alpha, arnd, adhemerval.zanella, fweimer, palmer, macro,
	zongbox, alistair23

On Fri, 9 Aug 2019, Alistair Francis wrote:

> diff --git a/sysdeps/unix/sysv/linux/sys/timerfd.h b/sysdeps/unix/sysv/linux/sys/timerfd.h
> index 5e5ad351a0d..51f63b357c1 100644
> --- a/sysdeps/unix/sysv/linux/sys/timerfd.h
> +++ b/sysdeps/unix/sysv/linux/sys/timerfd.h
> @@ -24,6 +24,13 @@
>  /* Get the platform-dependent flags.  */
>  #include <bits/timerfd.h>
>  
> +#if __TIMESIZE == 32
> +struct __itimerspec64
> +  {
> +    struct __timespec64 it_interval;
> +    struct __timespec64 it_value;
> +  };
> +#endif

This does not belong in an installed header (until we have actual 
_TIME_BITS support added to all installed headers).

>  enum
> @@ -40,16 +47,16 @@ __BEGIN_DECLS
>  /* Return file descriptor for new interval timer source.  */
>  extern int timerfd_create (__clockid_t __clock_id, int __flags) __THROW;
>  
> -/* Set next expiration time of interval timer source UFD to UTMR.  If
> -   FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
> -   absolute.  Optionally return the old expiration time in OTMR.  */
> -extern int timerfd_settime (int __ufd, int __flags,
> -			    const struct itimerspec *__utmr,
> -			    struct itimerspec *__otmr) __THROW;
> -
>  /* Return the next expiration time of UFD.  */
>  extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
>  
>  __END_DECLS
>  
> +/* Set next expiration time of interval timer source UFD to UTMR.  If
> +   FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
> +   absolute.  Optionally return the old expiration time in OTMR.  */
> +int timerfd_settime (int __ufd, int __flags,
> +        const struct itimerspec *__utmr,
> +        struct itimerspec *__otmr) __THROW;

This move is wrong.  All function declarations in installed headers must 
be between __BEGIN_DECLS and __END_DECLS so they have C linkage in C++.

This patch has no commit message explaining what it's supposed to be doing 
and why.  Please include a proper explanation with *every* patch of what 
it's doing, how it's been tested, etc.

> diff --git a/sysdeps/unix/sysv/linux/timerfd_settime.c b/sysdeps/unix/sysv/linux/timerfd_settime.c
> new file mode 100644
> index 00000000000..830faeada77
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/timerfd_settime.c
> @@ -0,0 +1,104 @@
> +/* Copyright (C) 2003-2019 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.

We don't use "Contributed by" in new source files.

What file with copyrightable content dating from 2003 is this based on?  
You should state that in your ChangeLog entry, if you're copying 
significant content from another file (if not, of course the copyright 
years should just be 2019).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-12 15:42   ` Zack Weinberg
@ 2019-08-12 20:20     ` Joseph Myers
  2019-08-12 21:08       ` Zack Weinberg
  2019-08-12 22:11     ` Alistair Francis
  1 sibling, 1 reply; 73+ messages in thread
From: Joseph Myers @ 2019-08-12 20:20 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: Alistair Francis, GNU C Library

On Mon, 12 Aug 2019, Zack Weinberg wrote:

>  - Our implementation of gettimeofday should always pass NULL for
> struct timezone to the kernel, and write zeroes to any struct timezone
> argument that is supplied.  (This will transitively apply to ftime.)

Given that the kernel timezone is in fact meaningful (for the kernel's 
interpretation of data shared with other OSes, such as the RTC clock and 
some filesystem timestamps, that is kept in local time - just not for the 
purpose for which the timezone settings in gettimeofday / settimeofday 
were originally intended), I think gettimeofday should continue to read 
that information from the kernel when the kernel provides it (i.e., the 
uses of the kernel timezone mean that other syscalls do *not* supersede 
the gettimeofday syscall for this purpose and so access to that 
information from that syscall should continue to be provided).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-12 20:20     ` Joseph Myers
@ 2019-08-12 21:08       ` Zack Weinberg
  2019-08-12 21:26         ` Joseph Myers
  0 siblings, 1 reply; 73+ messages in thread
From: Zack Weinberg @ 2019-08-12 21:08 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Alistair Francis, GNU C Library

On Mon, Aug 12, 2019 at 4:20 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Mon, 12 Aug 2019, Zack Weinberg wrote:
>
> >  - Our implementation of gettimeofday should always pass NULL for
> > struct timezone to the kernel, and write zeroes to any struct timezone
> > argument that is supplied.  (This will transitively apply to ftime.)
>
> Given that the kernel timezone is in fact meaningful (for the kernel's
> interpretation of data shared with other OSes, such as the RTC clock and
> some filesystem timestamps, that is kept in local time - just not for the
> purpose for which the timezone settings in gettimeofday / settimeofday
> were originally intended), I think gettimeofday should continue to read
> that information from the kernel when the kernel provides it

Insisting on this would mean that we'd have to go back to the kernel
people to request a new API _before_ we could proceed with the time64
transition.  I don't like that idea.  Also, unlike settimeofday where
we know there is at least one real, intentional user, I am betting
that all or nearly all existing uses of gettimeofday with a non-NULL
timezone argument are actually bugs.

Instead, what if we add Linux-specific set_hw_timezone(const struct
timezone *) and get_hw_timezone(struct timezone *) (sys/timex.h seems
like an appropriate place for the prototypes) that will call
settimeofday/gettimeofday now, or whatever new interface the kernel
people invent to replace this function, in the future.  We can then
proceed to make both gettimeofday and settimeofday behave-as-if they
always calls clock_[gs]ettime(CLOCK_REALTIME) under the hood, and this
issue is decoupled from the time64 transition.

zw

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-12 21:08       ` Zack Weinberg
@ 2019-08-12 21:26         ` Joseph Myers
  2019-08-12 22:13           ` Alistair Francis
                             ` (2 more replies)
  0 siblings, 3 replies; 73+ messages in thread
From: Joseph Myers @ 2019-08-12 21:26 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: Alistair Francis, GNU C Library

On Mon, 12 Aug 2019, Zack Weinberg wrote:

> On Mon, Aug 12, 2019 at 4:20 PM Joseph Myers <joseph@codesourcery.com> wrote:
> >
> > On Mon, 12 Aug 2019, Zack Weinberg wrote:
> >
> > >  - Our implementation of gettimeofday should always pass NULL for
> > > struct timezone to the kernel, and write zeroes to any struct timezone
> > > argument that is supplied.  (This will transitively apply to ftime.)
> >
> > Given that the kernel timezone is in fact meaningful (for the kernel's
> > interpretation of data shared with other OSes, such as the RTC clock and
> > some filesystem timestamps, that is kept in local time - just not for the
> > purpose for which the timezone settings in gettimeofday / settimeofday
> > were originally intended), I think gettimeofday should continue to read
> > that information from the kernel when the kernel provides it
> 
> Insisting on this would mean that we'd have to go back to the kernel
> people to request a new API _before_ we could proceed with the time64

No, but it might mean that these two functions are exceptions to the 
general rule of functions for 32-bit time being thin wrappers round their 
64-bit counterparts.  (For the existing ABIs I think keeping interfacing 
with the kernel timezone is also a matter of ABI compatibility for these 
functions, even if the new _TIME_BITS=64 version of gettimeofday just 
writes zeroes to the timezone.)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-12 15:42   ` Zack Weinberg
  2019-08-12 20:20     ` Joseph Myers
@ 2019-08-12 22:11     ` Alistair Francis
  1 sibling, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-12 22:11 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: Alistair Francis, GNU C Library

On Mon, Aug 12, 2019 at 8:42 AM Zack Weinberg <zackw@panix.com> wrote:
>
> On Fri, Aug 9, 2019 at 9:04 PM Alistair Francis
> <alistair.francis@wdc.com> wrote:
> >
> > Append the struct timezone members with '_dep'. This indicates that
> > these members are deprecated and will cause build failures on code that
> > is currently using the members.
>
> I had been working on a more thorough version of this patch, one that
> removed these fields altogether (replacing them with `char
> __preserve_historic_size[2*sizeof(int)]`) and changed _all_ of the
> code that touches them, within glibc, to either ignore the fields or
> zero them out.  This patch tripped over an Alpha-only ABI headache
> (Alpha has compatibility versions of both gettimeofday and
> settimeofday) and then I ran out of time to work on it.
>
> In view of the reported behavior of systemd, though, I now think
> neither your approach nor mine is exactly what we should do.  We
> should do something along these lines for the next release:
>
>  - We should _not_ rename the fields of struct timezone, but we should
> mark them __attribute_deprecated__ so that code still using them
> triggers compile warnings.

This sounds good to me

>  - We should do the same for the timezone fields of struct timeb.
>  - Our implementation of gettimeofday should always pass NULL for
> struct timezone to the kernel, and write zeroes to any struct timezone
> argument that is supplied.  (This will transitively apply to ftime.)

I don't think this is the right idea here and reading further down the
list it seems like not everyone is on board.

>  - We should leave settimeofday alone until the kernel has an
> alternative means of doing the "RTC clock warp" thing that systemd is
> trying to do.

Agreed, at least for systems that have a settimeofday syscall.

>
> Do you have time to work that patch up?  You can get my
> patch-in-progress from
> https://sourceware.org/git/?p=glibc.git;a=log;h=refs/heads/zack/gtod-no-timezone
> (please grab at least the changes to manual/time.texi).  If you don't
> have time, I will try to find time to work on it this week.

I do have time and am happy to do it, the problem is that WDC still
doesn't have a FSF contributor agreement so from my understanding the
patch couldn't be applied.

Alistair

>
> zw

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-12 21:26         ` Joseph Myers
@ 2019-08-12 22:13           ` Alistair Francis
  2019-08-12 23:16           ` Zack Weinberg
  2019-08-13  0:53           ` Paul Eggert
  2 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-12 22:13 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Zack Weinberg, Alistair Francis, GNU C Library

On Mon, Aug 12, 2019 at 2:26 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Mon, 12 Aug 2019, Zack Weinberg wrote:
>
> > On Mon, Aug 12, 2019 at 4:20 PM Joseph Myers <joseph@codesourcery.com> wrote:
> > >
> > > On Mon, 12 Aug 2019, Zack Weinberg wrote:
> > >
> > > >  - Our implementation of gettimeofday should always pass NULL for
> > > > struct timezone to the kernel, and write zeroes to any struct timezone
> > > > argument that is supplied.  (This will transitively apply to ftime.)
> > >
> > > Given that the kernel timezone is in fact meaningful (for the kernel's
> > > interpretation of data shared with other OSes, such as the RTC clock and
> > > some filesystem timestamps, that is kept in local time - just not for the
> > > purpose for which the timezone settings in gettimeofday / settimeofday
> > > were originally intended), I think gettimeofday should continue to read
> > > that information from the kernel when the kernel provides it
> >
> > Insisting on this would mean that we'd have to go back to the kernel
> > people to request a new API _before_ we could proceed with the time64
>
> No, but it might mean that these two functions are exceptions to the
> general rule of functions for 32-bit time being thin wrappers round their
> 64-bit counterparts.  (For the existing ABIs I think keeping interfacing
> with the kernel timezone is also a matter of ABI compatibility for these
> functions, even if the new _TIME_BITS=64 version of gettimeofday just
> writes zeroes to the timezone.)

This is what I was picturing as well, with the individual members
marked as deprecated.

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 08/24] sysdeps/stat: Copy the statx struct to stat instead of stat64
  2019-08-12 20:01   ` Joseph Myers
@ 2019-08-12 22:26     ` Alistair Francis
  2019-08-12 23:02       ` Joseph Myers
  0 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-12 22:26 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Mon, Aug 12, 2019 at 1:01 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Fri, 9 Aug 2019, Alistair Francis wrote:
>
> > When copying the statx struct to the stat stuct use the original stat
> > struct instead of the stat64 struct. As the padding in the original is
> > type 'unsigned short int' but the padding in the stat64 is 'unsigned int'
> > the copy  can result in misallgined data. This would then incorrectly
> > trigger the stat_overflow() failure.
>
> This indicates there's something else wrong with the port.  By design, the
> following apply for linux/generic/wordsize-32 ports of glibc:
>
> * The layout of struct stat and struct stat64 is identical, except that
> some bytes that are padding in struct stat serve as high parts of fields
> that are wider in struct stat64 (and thus have endian-dependent positions
> as determined by the __field64 macro in bits/stat.h).

__ino_t is a 64-bit value in RV32, so in both stat and stat64 it's the
same thing. The __pad1 changes in size between the two structs as one
is a short and one is just an int. I don't see how they are identical.

>
> * Conversions from statx have to go to stat64, including setting those
> high parts as appropriate, so that the subsequent overflow checks (which
> work by examining those padding fields) can correctly detect whether
> overflow occurred and set errno to EOVERFLOW accordingly.  See my C-SKY
> port reviews that resulted in the code we have now
> <https://sourceware.org/ml/libc-alpha/2018-11/msg00624.html>
> <https://sourceware.org/ml/libc-alpha/2018-11/msg00668.html>.

Ok, this makes sense.

>
> > This would be very obvious when using a 64-bit ino_t type on a 32-bit
> > system, such as the RV32 port.
>
> If those types are 64-bit, you should not have padding around them in
> struct stat, so as to preserve the property that struct stat and struct
> stat64 have the same layout.  I suppose this means bits/stat.h needs to
> check further macros such as __OFF_T_MATCHES_OFF64_T.

Changing the padding would fix the problem. Just to be clear is that
what you are suggesting?

>
> You'll also need to ensure that XSTAT_IS_XSTAT64 is defined to 1.  And
> you'll need to make wordsize-32/overflow.h define trivial versions of the
> *_overflow functions in cases where the types match (this should be done
> in that file, rather than making an RV32-specific copy, to benefit future
> ports that make the same choices as RV32).

I think I tested that and it didn't fix the problem so I dropped it.
I'll add the XSTAT_IS_XSTAT64 define back.

I'm not sure what you mean by then the types match?

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 08/24] sysdeps/stat: Copy the statx struct to stat instead of stat64
  2019-08-12 22:26     ` Alistair Francis
@ 2019-08-12 23:02       ` Joseph Myers
  2019-08-12 23:10         ` Alistair Francis
  0 siblings, 1 reply; 73+ messages in thread
From: Joseph Myers @ 2019-08-12 23:02 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Mon, 12 Aug 2019, Alistair Francis wrote:

> > * The layout of struct stat and struct stat64 is identical, except that
> > some bytes that are padding in struct stat serve as high parts of fields
> > that are wider in struct stat64 (and thus have endian-dependent positions
> > as determined by the __field64 macro in bits/stat.h).
> 
> __ino_t is a 64-bit value in RV32, so in both stat and stat64 it's the
> same thing. The __pad1 changes in size between the two structs as one
> is a short and one is just an int. I don't see how they are identical.

What file are you looking at, in what version of the source tree?

I'm looking at sysdeps/unix/sysv/linux/generic/bits/stat.h.  As far as I 
can tell, your patch series doesn't change that file.  That's the version 
used by RV64 and it should be used by RV32 (the headers installed for RV32 
and RV64 should be identical apart from the special cases of 
gnu/lib-names-*.h and gnu/stubs-*.h; if it isn't, that needs to be fixed).

In that file, __pad1 is of type __dev_t in both struct stat and struct 
stat64.

> > If those types are 64-bit, you should not have padding around them in
> > struct stat, so as to preserve the property that struct stat and struct
> > stat64 have the same layout.  I suppose this means bits/stat.h needs to
> > check further macros such as __OFF_T_MATCHES_OFF64_T.
> 
> Changing the padding would fix the problem. Just to be clear is that
> what you are suggesting?

Yes.

Either change the definition of __field64, or the uses of it.

Changing the definition runs into the complication that it's used three 
times and each has its own macro to say whether the two types in question 
match, but you could always have a #error if some match and others don't.

> > You'll also need to ensure that XSTAT_IS_XSTAT64 is defined to 1.  And
> > you'll need to make wordsize-32/overflow.h define trivial versions of the
> > *_overflow functions in cases where the types match (this should be done
> > in that file, rather than making an RV32-specific copy, to benefit future
> > ports that make the same choices as RV32).
> 
> I think I tested that and it didn't fix the problem so I dropped it.
> I'll add the XSTAT_IS_XSTAT64 define back.
> 
> I'm not sure what you mean by then the types match?

off_t and off64_t match if they have the same size and alignment (if 
__OFF_T_MATCHES_OFF64_T is defined).  Likewise for the other pairs.

If off_t and off64_t match, there is no need for the "buf->__st_size_pad 
== 0" check in stat_overflow (and once you've removed the padding in that 
case, that check won't even compile because __st_size_pad won't exist).  
Likewise for the other pairs.  In practice, you can probably just make 
that function return 0 if all three macros are defined, rather than 
allowing for arbitrary subsets of the types matching or not matching.

Similar considerations apply to statfs_overflow if the types and padding 
used in struct statfs match those used in struct statfs64.  So apply 
similar considerations to the two versions of that structure.

You probably don't need to do anything special with lseek_overflow because 
the compiler should just optimize that away when off_t and loff_t are the 
same type.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 08/24] sysdeps/stat: Copy the statx struct to stat instead of stat64
  2019-08-12 23:02       ` Joseph Myers
@ 2019-08-12 23:10         ` Alistair Francis
  2019-08-12 23:31           ` Joseph Myers
  0 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-12 23:10 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Mon, Aug 12, 2019 at 4:02 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Mon, 12 Aug 2019, Alistair Francis wrote:
>
> > > * The layout of struct stat and struct stat64 is identical, except that
> > > some bytes that are padding in struct stat serve as high parts of fields
> > > that are wider in struct stat64 (and thus have endian-dependent positions
> > > as determined by the __field64 macro in bits/stat.h).
> >
> > __ino_t is a 64-bit value in RV32, so in both stat and stat64 it's the
> > same thing. The __pad1 changes in size between the two structs as one
> > is a short and one is just an int. I don't see how they are identical.
>
> What file are you looking at, in what version of the source tree?

I'm looking at sysdeps/unix/sysv/linux/bits/stat.h, it has a different
definition then the one you are looking at.

>
> I'm looking at sysdeps/unix/sysv/linux/generic/bits/stat.h.  As far as I
> can tell, your patch series doesn't change that file.  That's the version
> used by RV64 and it should be used by RV32 (the headers installed for RV32
> and RV64 should be identical apart from the special cases of
> gnu/lib-names-*.h and gnu/stubs-*.h; if it isn't, that needs to be fixed).

It looks like __field64(__ino_t, __ino64_t, st_ino) will use type int
for RV32 (I don't think __USE_FILE_OFFSET64 is defined) which might
need some changes.

>
> In that file, __pad1 is of type __dev_t in both struct stat and struct
> stat64.

In the file you are looking at that is correct.

>
> > > If those types are 64-bit, you should not have padding around them in
> > > struct stat, so as to preserve the property that struct stat and struct
> > > stat64 have the same layout.  I suppose this means bits/stat.h needs to
> > > check further macros such as __OFF_T_MATCHES_OFF64_T.
> >
> > Changing the padding would fix the problem. Just to be clear is that
> > what you are suggesting?
>
> Yes.
>
> Either change the definition of __field64, or the uses of it.

Yep, in the file you are looking at that seems the best way to go.

>
> Changing the definition runs into the complication that it's used three
> times and each has its own macro to say whether the two types in question
> match, but you could always have a #error if some match and others don't.
>
> > > You'll also need to ensure that XSTAT_IS_XSTAT64 is defined to 1.  And
> > > you'll need to make wordsize-32/overflow.h define trivial versions of the
> > > *_overflow functions in cases where the types match (this should be done
> > > in that file, rather than making an RV32-specific copy, to benefit future
> > > ports that make the same choices as RV32).
> >
> > I think I tested that and it didn't fix the problem so I dropped it.
> > I'll add the XSTAT_IS_XSTAT64 define back.
> >
> > I'm not sure what you mean by then the types match?
>
> off_t and off64_t match if they have the same size and alignment (if
> __OFF_T_MATCHES_OFF64_T is defined).  Likewise for the other pairs.
>
> If off_t and off64_t match, there is no need for the "buf->__st_size_pad
> == 0" check in stat_overflow (and once you've removed the padding in that
> case, that check won't even compile because __st_size_pad won't exist).
> Likewise for the other pairs.  In practice, you can probably just make
> that function return 0 if all three macros are defined, rather than
> allowing for arbitrary subsets of the types matching or not matching.

Ok, I think I understand. I'll update the patch series.

>
> Similar considerations apply to statfs_overflow if the types and padding
> used in struct statfs match those used in struct statfs64.  So apply
> similar considerations to the two versions of that structure.

Ok

Alistair

>
> You probably don't need to do anything special with lseek_overflow because
> the compiler should just optimize that away when off_t and loff_t are the
> same type.
>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-12 21:26         ` Joseph Myers
  2019-08-12 22:13           ` Alistair Francis
@ 2019-08-12 23:16           ` Zack Weinberg
  2019-08-13  0:53           ` Paul Eggert
  2 siblings, 0 replies; 73+ messages in thread
From: Zack Weinberg @ 2019-08-12 23:16 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Alistair Francis, GNU C Library

On Mon, Aug 12, 2019 at 5:26 PM Joseph Myers <joseph@codesourcery.com> wrote:
> On Mon, 12 Aug 2019, Zack Weinberg wrote:
> > On Mon, Aug 12, 2019 at 4:20 PM Joseph Myers <joseph@codesourcery.com> wrote:
> > > On Mon, 12 Aug 2019, Zack Weinberg wrote:
> > >
> > > >  - Our implementation of gettimeofday should always pass NULL for
> > > > struct timezone to the kernel, and write zeroes to any struct timezone
> > > > argument that is supplied.  (This will transitively apply to ftime.)
> > >
> > > Given that the kernel timezone is in fact meaningful (for the kernel's
> > > interpretation of data shared with other OSes, such as the RTC clock and
> > > some filesystem timestamps, that is kept in local time - just not for the
> > > purpose for which the timezone settings in gettimeofday / settimeofday
> > > were originally intended), I think gettimeofday should continue to read
> > > that information from the kernel when the kernel provides it
> >
> > Insisting on this would mean that we'd have to go back to the kernel
> > people to request a new API _before_ we could proceed with the time64
>
>  (For the existing ABIs I think keeping interfacing
> with the kernel timezone is also a matter of ABI compatibility for these
> functions, even if the new _TIME_BITS=64 version of gettimeofday just
> writes zeroes to the timezone.)

I really can't agree with that.  At all.

The kernel time zone is a trip hazard for the overwhelming majority of
applications.  We would probably be _fixing bugs_ (well, rendering
them harmless) with the above proposed change to gettimeofday.

Also, I think having gettimeofday behave differently between different
architectures is a bad idea, and having gettimeofday behave
differently depending on _TIME_BITS is an even worse idea.  And we
know we _can't_ have gettimeofday mimic the old behavior when the only
available get-time syscall is clock_gettime, so...

zw

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 08/24] sysdeps/stat: Copy the statx struct to stat instead of stat64
  2019-08-12 23:10         ` Alistair Francis
@ 2019-08-12 23:31           ` Joseph Myers
  2019-08-13 20:40             ` Alistair Francis
  0 siblings, 1 reply; 73+ messages in thread
From: Joseph Myers @ 2019-08-12 23:31 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Mon, 12 Aug 2019, Alistair Francis wrote:

> I'm looking at sysdeps/unix/sysv/linux/bits/stat.h, it has a different
> definition then the one you are looking at.

That file is not relevant for any Linux kernel port added in the past 
several years.  All recent ports should use the asm-generic structure 
layouts.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-12 21:26         ` Joseph Myers
  2019-08-12 22:13           ` Alistair Francis
  2019-08-12 23:16           ` Zack Weinberg
@ 2019-08-13  0:53           ` Paul Eggert
  2019-08-13  1:04             ` Zack Weinberg
  2 siblings, 1 reply; 73+ messages in thread
From: Paul Eggert @ 2019-08-13  0:53 UTC (permalink / raw)
  To: Joseph Myers, Zack Weinberg; +Cc: Alistair Francis, GNU C Library

Joseph Myers wrote:
> it might mean that these two functions are exceptions to the
> general rule of functions for 32-bit time being thin wrappers round their
> 64-bit counterparts.

If I'm understanding you correctly, you're suggesting that the existing-ABI 
get/settimeofday calls behave as before (albeit with __attribute_deprecated__ 
warnings at compile-time), whereas the new-ABI gettimeofday clears *TZ if TZ is 
nonnull and the new-ABI settimeofday ignores TZ.  That way, the one or two 
ancient apps that rely on this stuff will still work if compiled in 32-bit 
time_t mode. This sounds like a good way to go forward.

It might also make sense for the new-ABI gettimeofday to simply ignore its TZ 
argument, as that would be easier to document and explain (plus a bit faster for 
the typical gettimeofday case).

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 07/24] time: Deprecate struct timezone members
  2019-08-13  0:53           ` Paul Eggert
@ 2019-08-13  1:04             ` Zack Weinberg
  0 siblings, 0 replies; 73+ messages in thread
From: Zack Weinberg @ 2019-08-13  1:04 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Joseph Myers, Alistair Francis, GNU C Library

On Mon, Aug 12, 2019 at 8:53 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
> Joseph Myers wrote:
> > it might mean that these two functions are exceptions to the
> > general rule of functions for 32-bit time being thin wrappers round their
> > 64-bit counterparts.
>
> If I'm understanding you correctly, you're suggesting that the existing-ABI
> get/settimeofday calls behave as before (albeit with __attribute_deprecated__
> warnings at compile-time), whereas the new-ABI gettimeofday clears *TZ if TZ is
> nonnull and the new-ABI settimeofday ignores TZ.

This is also what I understand Joseph to be suggesting.

> That way, the one or two
> ancient apps that rely on this stuff will still work if compiled in 32-bit
> time_t mode. This sounds like a good way to go forward.

However, I don't agree with this assessment of it I think it would be
confusing, and potentially a source of bugs that only affect less
popular architectures, if new-ABI and old-ABI gettimeofday don't treat
the TZ argument the same.  And I suspect that any "ancient apps" are
actually mishandling time zones and we'd be doing them a favor by
making them think they're operating in UTC from now on.

(systemd's use of the timezone argument to settimeofday is a separate issue.)

> It might also make sense for the new-ABI gettimeofday to simply ignore its TZ
> argument, as that would be easier to document and explain (plus a bit faster for
> the typical gettimeofday case).

That's not safe; callers that pass a non-NULL TZ argument to
gettimeofday may well rely on it writing _something_ there.  If it
doesn't, they'll be operating on stack garbage.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 08/24] sysdeps/stat: Copy the statx struct to stat instead of stat64
  2019-08-12 23:31           ` Joseph Myers
@ 2019-08-13 20:40             ` Alistair Francis
  0 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-13 20:40 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Mon, Aug 12, 2019 at 4:31 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Mon, 12 Aug 2019, Alistair Francis wrote:
>
> > I'm looking at sysdeps/unix/sysv/linux/bits/stat.h, it has a different
> > definition then the one you are looking at.
>
> That file is not relevant for any Linux kernel port added in the past
> several years.  All recent ports should use the asm-generic structure
> layouts.

Ok, now I understand. I have made all of the changes you requested.

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 05/24] sysdeps/clock_gettime: Use clock_gettime64 if avaliable
  2019-08-12 19:46   ` Joseph Myers
@ 2019-08-13 23:48     ` Alistair Francis
  2019-08-14 16:37       ` Joseph Myers
  0 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-13 23:48 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Mon, Aug 12, 2019 at 12:46 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Fri, 9 Aug 2019, Alistair Francis wrote:
>
> >  /* Get current value of CLOCK and store it in TP.  */
> > +
> >  int
> >  __clock_gettime (clockid_t clock_id, struct timespec *tp)
> >  {
> > -  return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp);
> > +
> > +#ifdef __ASSUME_TIME64_SYSCALLS
> > +   return INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp);
> > +#else
>
> This has the usual problems with missing conversions.

I was under the impression (although possibly incorrectly) that if
__ASSUME_TIME64_SYSCALLS is defined we would have a 64-bit time_t. Is
__ASSUME_TIME64_SYSCALLS going to be defined on 32-bit architectures
that are still using a 32-bit time_t?

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 05/24] sysdeps/clock_gettime: Use clock_gettime64 if avaliable
  2019-08-13 23:48     ` Alistair Francis
@ 2019-08-14 16:37       ` Joseph Myers
  2019-08-14 18:12         ` Alistair Francis
  0 siblings, 1 reply; 73+ messages in thread
From: Joseph Myers @ 2019-08-14 16:37 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Tue, 13 Aug 2019, Alistair Francis wrote:

> I was under the impression (although possibly incorrectly) that if
> __ASSUME_TIME64_SYSCALLS is defined we would have a 64-bit time_t. Is
> __ASSUME_TIME64_SYSCALLS going to be defined on 32-bit architectures
> that are still using a 32-bit time_t?

Yes.  --enable-kernel=5.1.0 is not an ABI-changing option; it only affects 
what syscalls glibc can assume to be present at runtime in the kernel it 
runs on.

__ASSUME_TIME64_SYSCALLS means only that certain syscalls using 64-bit 
time are assumed to be available: either suffixed versions such as 
__NR_clock_gettime64, or corresponding unsuffixed versions such as 
__NR_clock_gettime in the case where those use 64-bit time and have 
exactly the same semantics and so "#define __NR_clock_gettime64 
__NR_clock_gettime" is OK.  (Because the kernel headers must be at least 
as recent as the minimum kernel version used at runtime, it also implies 
that the kernel headers do define the syscall numbers - but as noted, the 
syscalls might be __NR_clock_gettime etc. rather than the suffixed 
versions.)

All four combinations of __ASSUME_TIME64_SYSCALLS and __TIMESIZE are 
valid.

1. __TIMESIZE == 64 and __ASSUME_TIME64_SYSCALLS defined means a glibc 
port does not support anything other than 64-bit time *as its userspace 
ABI*, with the minimum kernel version ensuring appropriate syscalls are 
available.  Cases of this include:

(a) Classic 64-bit systems (__WORDSIZE == 64, unsuffixed syscalls).

(b) x32 (__WORDSIZE == 32, __SYSCALL_WORDSIZE == 64, unsuffixed syscalls).

(c) New glibc ports with 32-bit "long int" in the syscall interface 
(__WORDSIZE == 32 and __SYSCALL_WORDSIZE == 32) but only supporting 64-bit 
time as its userspace ABI and with the configured minimum kernel version 
(5.1 or later) ensuring appropriate (suffixed) syscalls are available (and 
unsuffixed ones don't exist at all).  This is the case that applies to 
RV32.

2. __TIMESIZE == 64 and __ASSUME_TIME64_SYSCALLS not defined means a glibc 
port that does not support anything other than 64-bit time *as its 
userspace ABI*, but with the minimum kernel version not ensuring 
appropriate syscalls are available.  This implies __WORDSIZE == 32 and 
__SYSCALL_WORDSIZE == 32.  This is a hypothetical case, if a new glibc 
port were added for a 32-bit architecture that was supported in the Linux 
kernel before 5.1, and if it were chosen to have 64-bit time as the 
userspace ABI for this port but to support using kernels before 5.1.  As 
it's hypothetical, it's not something you're expected to test unless 
adding such a port - but most of the support for it should naturally fall 
out from the Y2038 implementation anyway (the support for 64-bit 
interfaces to use 32-bit syscalls when run on older kernels).

3. __TIMESIZE == 32 and __ASSUME_TIME64_SYSCALLS defined means a 32-bit 
glibc port, where the unsuffixed time-related ABIs in glibc use 32-bit 
time but the Y2038 work will add corresponding suffixed ABIs (and 
_TIME_BITS headers support) that use 64-bit time - and where the minimum 
kernel version ensures 64-bit-time (suffixed) syscalls are available.  So 
the suffixed ABIs for 64-bit time can call those suffixed syscalls 
unconditionally, but the unsuffixed ABIs need to do appropriate 
translation between 32-bit and 64-bit time to call those syscalls (and the 
expected design is that the unsuffixed ABIs will generally be thin 
wrappers that do such translation and call the suffixed ones).

4. __TIMESIZE == 32 and __ASSUME_TIME64_SYSCALLS not defined means a 
32-bit glibc port, where the unsuffixed time-related ABIs in glibc use 
32-bit time but the Y2038 work will add corresponding suffixed ABIs (and 
_TIME_BITS headers support) that use 64-bit time - and where the minimum 
kernel version does not ensure that 64-bit-time (suffixed) syscalls are 
available.  Thus, the suffixed ABIs for 64-bit time need to have support 
for falling back to the 32-bit syscalls when the 64-bit ones are not 
available.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 05/24] sysdeps/clock_gettime: Use clock_gettime64 if avaliable
  2019-08-14 16:37       ` Joseph Myers
@ 2019-08-14 18:12         ` Alistair Francis
  0 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-14 18:12 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Wed, Aug 14, 2019 at 9:37 AM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Tue, 13 Aug 2019, Alistair Francis wrote:
>
> > I was under the impression (although possibly incorrectly) that if
> > __ASSUME_TIME64_SYSCALLS is defined we would have a 64-bit time_t. Is
> > __ASSUME_TIME64_SYSCALLS going to be defined on 32-bit architectures
> > that are still using a 32-bit time_t?
>
> Yes.  --enable-kernel=5.1.0 is not an ABI-changing option; it only affects
> what syscalls glibc can assume to be present at runtime in the kernel it
> runs on.
>
> __ASSUME_TIME64_SYSCALLS means only that certain syscalls using 64-bit
> time are assumed to be available: either suffixed versions such as
> __NR_clock_gettime64, or corresponding unsuffixed versions such as
> __NR_clock_gettime in the case where those use 64-bit time and have
> exactly the same semantics and so "#define __NR_clock_gettime64
> __NR_clock_gettime" is OK.  (Because the kernel headers must be at least
> as recent as the minimum kernel version used at runtime, it also implies
> that the kernel headers do define the syscall numbers - but as noted, the
> syscalls might be __NR_clock_gettime etc. rather than the suffixed
> versions.)
>
> All four combinations of __ASSUME_TIME64_SYSCALLS and __TIMESIZE are
> valid.
>
> 1. __TIMESIZE == 64 and __ASSUME_TIME64_SYSCALLS defined means a glibc
> port does not support anything other than 64-bit time *as its userspace
> ABI*, with the minimum kernel version ensuring appropriate syscalls are
> available.  Cases of this include:
>
> (a) Classic 64-bit systems (__WORDSIZE == 64, unsuffixed syscalls).
>
> (b) x32 (__WORDSIZE == 32, __SYSCALL_WORDSIZE == 64, unsuffixed syscalls).
>
> (c) New glibc ports with 32-bit "long int" in the syscall interface
> (__WORDSIZE == 32 and __SYSCALL_WORDSIZE == 32) but only supporting 64-bit
> time as its userspace ABI and with the configured minimum kernel version
> (5.1 or later) ensuring appropriate (suffixed) syscalls are available (and
> unsuffixed ones don't exist at all).  This is the case that applies to
> RV32.
>
> 2. __TIMESIZE == 64 and __ASSUME_TIME64_SYSCALLS not defined means a glibc
> port that does not support anything other than 64-bit time *as its
> userspace ABI*, but with the minimum kernel version not ensuring
> appropriate syscalls are available.  This implies __WORDSIZE == 32 and
> __SYSCALL_WORDSIZE == 32.  This is a hypothetical case, if a new glibc
> port were added for a 32-bit architecture that was supported in the Linux
> kernel before 5.1, and if it were chosen to have 64-bit time as the
> userspace ABI for this port but to support using kernels before 5.1.  As
> it's hypothetical, it's not something you're expected to test unless
> adding such a port - but most of the support for it should naturally fall
> out from the Y2038 implementation anyway (the support for 64-bit
> interfaces to use 32-bit syscalls when run on older kernels).
>
> 3. __TIMESIZE == 32 and __ASSUME_TIME64_SYSCALLS defined means a 32-bit
> glibc port, where the unsuffixed time-related ABIs in glibc use 32-bit
> time but the Y2038 work will add corresponding suffixed ABIs (and
> _TIME_BITS headers support) that use 64-bit time - and where the minimum
> kernel version ensures 64-bit-time (suffixed) syscalls are available.  So
> the suffixed ABIs for 64-bit time can call those suffixed syscalls
> unconditionally, but the unsuffixed ABIs need to do appropriate
> translation between 32-bit and 64-bit time to call those syscalls (and the
> expected design is that the unsuffixed ABIs will generally be thin
> wrappers that do such translation and call the suffixed ones).

Ok, I didn't realise that this was a possible case, I will update the series.

Alistair

>
> 4. __TIMESIZE == 32 and __ASSUME_TIME64_SYSCALLS not defined means a
> 32-bit glibc port, where the unsuffixed time-related ABIs in glibc use
> 32-bit time but the Y2038 work will add corresponding suffixed ABIs (and
> _TIME_BITS headers support) that use 64-bit time - and where the minimum
> kernel version does not ensure that 64-bit-time (suffixed) syscalls are
> available.  Thus, the suffixed ABIs for 64-bit time need to have support
> for falling back to the 32-bit syscalls when the 64-bit ones are not
> available.
>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 02/24] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-08-12 17:22   ` Joseph Myers
@ 2019-08-14 18:24     ` Alistair Francis
  2019-08-14 20:15       ` Joseph Myers
  2019-08-14 21:39       ` Stepan Golosunov
  0 siblings, 2 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-14 18:24 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

   On Mon, Aug 12, 2019 at 10:22 AM Joseph Myers
<joseph@codesourcery.com> wrote:
>
> On Fri, 9 Aug 2019, Alistair Francis wrote:
>
> > diff --git a/nptl/thrd_sleep.c b/nptl/thrd_sleep.c
> > index 07a51808df2..fc495b56c67 100644
> > --- a/nptl/thrd_sleep.c
> > +++ b/nptl/thrd_sleep.c
> > @@ -25,14 +25,68 @@ int
> >  thrd_sleep (const struct timespec* time_point, struct timespec* remaining)
> >  {
> >    INTERNAL_SYSCALL_DECL (err);
> > -  int ret = INTERNAL_SYSCALL_CANCEL (nanosleep, err, time_point, remaining);
> > +  int ret = -1;
> > +
> > +#ifdef __ASSUME_TIME64_SYSCALLS
> > +  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, CLOCK_REALTIME,
> > +                                 0, time_point, remaining);
> > +#else
>
> This still has the same problem as has been explained for previous
> versions of the patch series: if time_t is 32-bit but
> __ASSUME_TIME64_SYSCALLS is defined, it is not valid to call the
> clock_nanosleep_time64 with a 32-bit timespec; you have to call it with a
> 64-bit timespec.  That is, if you call clock_nanosleep_time64 at all in
> the case where the original function was called with a 32-bit timespec
> (and I think you should do so) then you need to have conversions.

As discussed in a different thread, I will update the series to
support 32 and 64 bit time_t with __ASSUME_TIME64_SYSCALLS defined.

>
> Please fix this *throughout* the patch series *before* posting the next
> version.  That is, for every patch in the series you need to consider what
> is appropriate for systems with 32-bit time - *not* just what is
> appropriate for RV32.
>
> The pattern we have previously discussed for 64-bit time support is that
> the code should (a) define the function (__thrd_sleep_time64, say) for
> 64-bit time (which then only needs conversions in the reverse direction -
> if the 64-bit syscall is not in fact available, but the 32-bit one is),
> (b) if __TIMESIZE != 64, defines the 32-bit function as a thin wrapper
> round that, (c) in the appropriate internal header, has a #define of the

Doesn't having a thing wrapper around __thrd_sleep64() result in
unnecessary conversions? When __NR_clock_nanosleep_time64 is not
defined we will end up converting a 32-bit time_t to a 64-bit time_t
just to convert it back to a 32-bit time_t.

It seems simpler to me to just keep the structure here and fix the
32-bit time_t when __ASSUME_TIME64_SYSCALLS is defined. That will
probably result in a helper function for
defined(__ASSUME_TIME64_SYSCALLS) ||
__NR_clock_nanosleep_time64 as they are very similar.

> name such as __thrd_sleep_time64 to the name such as thrd_sleep, in the
> case where __TIMESIZE == 64 and thus no wrapper is needed.
>
> > +# ifdef __NR_clock_nanosleep_time64
> > +#  if __TIMESIZE == 64
> > +  long int ret_64;
> > +
> > +  ret_64 = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, CLOCK_REALTIME,
> > +                                    0, time_point, remaining);
> > +
> > +  if (ret_64 == 0 || errno != ENOSYS)
> > +    ret = ret_64;
> > +#  else
> > +  timespec64 ts64;
> > +
> > +  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> > +                                 CLOCK_REALTIME, 0, time_point,
> > +                                 ts64);
> > +
> > +  if (ret == 0 || errno != ENOSYS)
> > +    {
> > +      remaining->tv_sec = ts64.tv_sec;
> > +      remaining->tv_nsec = ts64.tv_nsec;
> > +    }
>
> thrd_sleep has *two* timespec arguments, one input and one output.  It's
> not sufficient to just convert the output, as here; if you're doing
> conversions, you have to convert *both*.

Good point, I will fix this.

>
> It is valid for the output argument to be NULL.  You need to avoid writing
> to *remaining in that case.

I will fix this.

>
> Please try to test such 64-bit time changes in configurations covering as
> many of the different cases in the code as possible, both at compile time
> and at run time, and include details in the patch submissions of what
> configurations you tested (architecture, kernel headers version,
> --enable-kernel version, kernel version used when running the testsuite).
> I'd hope such testing would have shown up the issue with the output
> argument being NULL, as well as the ABI breakage.

Before I send a patch series I will run more tests.

>
> Relevant configurations should include at least (a) one that has always
> had 64-bit time, e.g. x86_64; (b) one with 32-bit time and old kernel
> headers (any kernel version at runtime); (c) one with 32-bit time and new
> kernel headers, old kernel at runtime; (d) one with 32-bit time and new
> kernel headers, new kernel at runtime but no --enable-kernel; (e) one with
> 32-bit time and new kernel at runtime and new --enable-kernel.  (New = 5.1
> or later.)  I think that's a basic minimum for testing any patches related
> to 64-bit time.  (If Florian's changes to provide syscall tables within
> glibc go in, case (b) disappears.)

Setting up all these cases will take a long time, which is why I
haven't done it yet for a RFC series.

>
> (In this case, you're also passing the struct ts64 by value to the syscall
> rather than a pointer to it.  And as this is C, not C++, I'm not sure a
> declaration "timespec64 ts64;" without "struct" would have compiled.)

Will fix.

>
> > diff --git a/sysdeps/unix/sysv/linux/nanosleep.c b/sysdeps/unix/sysv/linux/nanosleep.c
>
> > +#if __TIMESIZE == 32
> > +struct timespec64
> > +{
> > +  long long int tv_sec;   /* Seconds.  */
> > +  long int tv_nsec;  /* Nanoseconds.  */
> > +};
>
> If we need such a structure different from the "struct __timespec64" in
> Lukasz's patches, it surely does not belong in the .c file for one
> particular function without a very detailed comment explaining exactly why
> it's so specific to that function rather than in a more generic internal
> header.

This can probably be removed then.

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 23/24] WIP: syscall.list: Call 64-bit versions of syscalls
  2019-08-10  1:04 ` [RFC v4 23/24] WIP: syscall.list: Call 64-bit versions of syscalls Alistair Francis
@ 2019-08-14 18:39   ` Alistair Francis
  2019-08-14 18:57     ` Florian Weimer
  0 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-14 18:39 UTC (permalink / raw)
  To: Alistair Francis
  Cc: GNU C Library, Arnd Bergmann, Adhemerval Zanella, Florian Weimer,
	Palmer Dabbelt, macro, Zong Li

On Fri, Aug 9, 2019 at 6:04 PM Alistair Francis
<alistair.francis@wdc.com> wrote:
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  sysdeps/unix/sysv/linux/syscalls.list | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
> index e374f97b5f8..4844d1a9a3b 100644
> --- a/sysdeps/unix/sysv/linux/syscalls.list
> +++ b/sysdeps/unix/sysv/linux/syscalls.list
> @@ -5,7 +5,7 @@ alarm           -       alarm           i:i     alarm
>  bdflush                EXTRA   bdflush         i:ii    __compat_bdflush        bdflush@GLIBC_2.0:GLIBC_2.23
>  capget         EXTRA   capget          i:pp    capget
>  capset         EXTRA   capset          i:pp    capset
> -clock_adjtime  EXTRA   clock_adjtime   i:ip    clock_adjtime
> +clock_adjtime  EXTRA   clock_adjtime64 i:ip    clock_adjtime
>  create_module  EXTRA   create_module   3       __compat_create_module  create_module@GLIBC_2.0:GLIBC_2.23
>  delete_module  EXTRA   delete_module   3       delete_module
>  epoll_create   EXTRA   epoll_create    i:i     epoll_create
> @@ -52,7 +52,7 @@ sched_getp    -       sched_getparam  i:ip    __sched_getparam        sched_getparam
>  sched_gets     -       sched_getscheduler      i:i     __sched_getscheduler    sched_getscheduler
>  sched_primax   -       sched_get_priority_max  i:i     __sched_get_priority_max        sched_get_priority_max
>  sched_primin   -       sched_get_priority_min  i:i     __sched_get_priority_min        sched_get_priority_min
> -sched_rr_gi    -       sched_rr_get_interval   i:ip    __sched_rr_get_interval sched_rr_get_interval
> +sched_rr_gi    -       sched_rr_get_interval_time64    i:ip    __sched_rr_get_interval sched_rr_get_interval
>  sched_setp     -       sched_setparam  i:ip    __sched_setparam        sched_setparam
>  sched_sets     -       sched_setscheduler      i:iip   __sched_setscheduler    sched_setscheduler
>  sched_yield    -       sched_yield     i:      __sched_yield   sched_yield
> @@ -96,8 +96,8 @@ fremovexattr  -       fremovexattr    i:is    fremovexattr
>  mq_setattr     -       mq_getsetattr   i:ipp   mq_setattr
>
>  timerfd_create EXTRA   timerfd_create  i:ii    timerfd_create
> -timerfd_settime        EXTRA   timerfd_settime i:iipp  timerfd_settime
> -timerfd_gettime        EXTRA   timerfd_gettime i:ip    timerfd_gettime
> +timerfd_settime        EXTRA   timerfd_settime64       i:iipp  timerfd_settime
> +timerfd_gettime        EXTRA   timerfd_gettime64       i:ip    timerfd_gettime

Does anyone have ideas/opinions on how to handle this correctly?

Alistair

>
>  fanotify_init  EXTRA   fanotify_init   i:ii    fanotify_init
>
> --
> 2.22.0
>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 23/24] WIP: syscall.list: Call 64-bit versions of syscalls
  2019-08-14 18:39   ` Alistair Francis
@ 2019-08-14 18:57     ` Florian Weimer
  2019-08-15 21:43       ` Alistair Francis
  0 siblings, 1 reply; 73+ messages in thread
From: Florian Weimer @ 2019-08-14 18:57 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Palmer Dabbelt, macro, Zong Li

* Alistair Francis:

> On Fri, Aug 9, 2019 at 6:04 PM Alistair Francis
> <alistair.francis@wdc.com> wrote:
>>
>> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
>> ---
>>  sysdeps/unix/sysv/linux/syscalls.list | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
>> index e374f97b5f8..4844d1a9a3b 100644
>> --- a/sysdeps/unix/sysv/linux/syscalls.list
>> +++ b/sysdeps/unix/sysv/linux/syscalls.list
>> @@ -5,7 +5,7 @@ alarm           -       alarm           i:i     alarm
>>  bdflush                EXTRA   bdflush         i:ii    __compat_bdflush        bdflush@GLIBC_2.0:GLIBC_2.23
>>  capget         EXTRA   capget          i:pp    capget
>>  capset         EXTRA   capset          i:pp    capset
>> -clock_adjtime  EXTRA   clock_adjtime   i:ip    clock_adjtime
>> +clock_adjtime  EXTRA   clock_adjtime64 i:ip    clock_adjtime
>>  create_module  EXTRA   create_module   3       __compat_create_module  create_module@GLIBC_2.0:GLIBC_2.23
>>  delete_module  EXTRA   delete_module   3       delete_module
>>  epoll_create   EXTRA   epoll_create    i:i     epoll_create
>> @@ -52,7 +52,7 @@ sched_getp    -       sched_getparam  i:ip    __sched_getparam        sched_getparam
>>  sched_gets     -       sched_getscheduler      i:i     __sched_getscheduler    sched_getscheduler
>>  sched_primax   -       sched_get_priority_max  i:i     __sched_get_priority_max        sched_get_priority_max
>>  sched_primin   -       sched_get_priority_min  i:i     __sched_get_priority_min        sched_get_priority_min
>> -sched_rr_gi    -       sched_rr_get_interval   i:ip    __sched_rr_get_interval sched_rr_get_interval
>> +sched_rr_gi    -       sched_rr_get_interval_time64    i:ip    __sched_rr_get_interval sched_rr_get_interval
>>  sched_setp     -       sched_setparam  i:ip    __sched_setparam        sched_setparam
>>  sched_sets     -       sched_setscheduler      i:iip   __sched_setscheduler    sched_setscheduler
>>  sched_yield    -       sched_yield     i:      __sched_yield   sched_yield
>> @@ -96,8 +96,8 @@ fremovexattr  -       fremovexattr    i:is    fremovexattr
>>  mq_setattr     -       mq_getsetattr   i:ipp   mq_setattr
>>
>>  timerfd_create EXTRA   timerfd_create  i:ii    timerfd_create
>> -timerfd_settime        EXTRA   timerfd_settime i:iipp  timerfd_settime
>> -timerfd_gettime        EXTRA   timerfd_gettime i:ip    timerfd_gettime
>> +timerfd_settime        EXTRA   timerfd_settime64       i:iipp  timerfd_settime
>> +timerfd_gettime        EXTRA   timerfd_gettime64       i:ip    timerfd_gettime
>
> Does anyone have ideas/opinions on how to handle this correctly?

As in many of the other cases, you can add this to <sysdep.h>:

#define __NR_timerfd_settime __NR_timerfd_settime64
#define __NR_timerfd_gettime __NR_timerfd_gettime64

Once a second such port arrives, we can factor out these common system
call renamings into a generic-64 subdirectory.

I still think it's just wrong that the kernel doesn't provide these
names as part of the UAPI headers.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 02/24] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-08-14 18:24     ` Alistair Francis
@ 2019-08-14 20:15       ` Joseph Myers
  2019-08-14 21:39       ` Stepan Golosunov
  1 sibling, 0 replies; 73+ messages in thread
From: Joseph Myers @ 2019-08-14 20:15 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Wed, 14 Aug 2019, Alistair Francis wrote:

> > The pattern we have previously discussed for 64-bit time support is that
> > the code should (a) define the function (__thrd_sleep_time64, say) for
> > 64-bit time (which then only needs conversions in the reverse direction -
> > if the 64-bit syscall is not in fact available, but the 32-bit one is),
> > (b) if __TIMESIZE != 64, defines the 32-bit function as a thin wrapper
> > round that, (c) in the appropriate internal header, has a #define of the
> 
> Doesn't having a thing wrapper around __thrd_sleep64() result in
> unnecessary conversions? When __NR_clock_nanosleep_time64 is not

The conversions are in userspace, i.e. a few instructions.

We need a clearly defined consistent convention for the pattern used for 
function implementations for 32-bit and 64-bit time, not every function 
doing things in its own way.  For functions such a 
pthread_mutex_timedlock, with hundreds of lines of code, thin wrappers are 
clearly the only reasonably approach to avoid large amounts of code 
duplication.  That in turn leads to using thin wrappers consistently 
everywhere the functions are defined in C, unless there is a clear reason 
for a particular function to be different.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 02/24] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-08-14 18:24     ` Alistair Francis
  2019-08-14 20:15       ` Joseph Myers
@ 2019-08-14 21:39       ` Stepan Golosunov
  1 sibling, 0 replies; 73+ messages in thread
From: Stepan Golosunov @ 2019-08-14 21:39 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Joseph Myers, Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

14.08.2019 ц≈ 11:20:54 -0700 Alistair Francis ц▌ц│ц░ц┴ц⌠ц│ц▄:
>    On Mon, Aug 12, 2019 at 10:22 AM Joseph Myers
> <joseph@codesourcery.com> wrote:
> > The pattern we have previously discussed for 64-bit time support is that
> > the code should (a) define the function (__thrd_sleep_time64, say) for
> > 64-bit time (which then only needs conversions in the reverse direction -
> > if the 64-bit syscall is not in fact available, but the 32-bit one is),
> > (b) if __TIMESIZE != 64, defines the 32-bit function as a thin wrapper
> > round that, (c) in the appropriate internal header, has a #define of the
> 
> Doesn't having a thing wrapper around __thrd_sleep64() result in
> unnecessary conversions? When __NR_clock_nanosleep_time64 is not
> defined we will end up converting a 32-bit time_t to a 64-bit time_t
> just to convert it back to a 32-bit time_t.

The only purpose of handling __NR_clock_nanosleep_time64 being not
defined (when __ASSUME_TIME64_SYSCALLS is not defined too) is just to
avoid compilation failure with old kernel headers.  There is no point
to optimize this case.  And Florian proposed patches that remove it
altogether.

> It seems simpler to me to just keep the structure here and fix the
> 32-bit time_t when __ASSUME_TIME64_SYSCALLS is defined. That will
> probably result in a helper function for
> defined(__ASSUME_TIME64_SYSCALLS) ||
> __NR_clock_nanosleep_time64 as they are very similar.

If you add support for a 64-bit time version of a function on
__TIMESIZE==32 architectures, you'll end up with 2 functions.  And it
is much simpler to have 32-bit-time one as a thin wrapper around
64-bit-time one.  Code will be more tested this way.

And if you do not add such support it should be sufficient to do just

#ifdef __NR_nanosleep
  int ret = INTERNAL_SYSCALL_CANCEL (nanosleep, err, time_point, remaining);
#else
  int ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep, err, CLOCK_MONOTONIC,
                                     0, time_point, remaining);
#endif

plus
#define __NR_clock_nanosleep __NR_clock_nanosleep64
in sysdep.h for rv32.

(I am not sure whether the #ifdef __NR_nanosleep part is needed.)

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
  2019-08-12 19:46   ` Joseph Myers
@ 2019-08-15 18:03     ` Alistair Francis
  2019-08-15 19:46       ` Joseph Myers
  0 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-15 18:03 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Mon, Aug 12, 2019 at 12:46 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Fri, 9 Aug 2019, Alistair Francis wrote:
>
> > diff --git a/sysdeps/unix/sysv/linux/timespec_get.c b/sysdeps/unix/sysv/linux/timespec_get.c
> > index 52080ddf08a..97ef9c5f799 100644
> > --- a/sysdeps/unix/sysv/linux/timespec_get.c
> > +++ b/sysdeps/unix/sysv/linux/timespec_get.c
> > @@ -24,6 +24,58 @@
> >  #endif
> >  #include <sysdep-vdso.h>
> >
> > +int
> > +__timespec_get (struct timespec *ts, int base)
> > +{
> > +#ifdef __ASSUME_TIME64_SYSCALLS
> > +  return INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
> > +#else
>
> This has the usual problems with missing conversions.

Is this the type of layout you are looking for? (untested, just a general idea)

int
__timespec_get64 (struct __timespec64 *ts, int base)
{
#ifdef __ASSUME_TIME64_SYSCALLS
  return INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
#else
  long int ret;
# ifdef __NR_clock_gettime64
  ret = INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);

  if (ret == 0 || errno != ENOSYS)
    {
      return ret;
    }
# endif /* __NR_clock_gettime64 */
  struct timespec ts32;

  if (! in_time_t_range (ts->tv_sec))
    {
      __set_errno (EOVERFLOW);
      return -1;
    }

  valid_timespec64_to_timespec (ts, &ts32);
  ret = INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts32);

  if ((ret == 0 || errno != ENOSYS) && ts)
    {
      ts->tv_sec = ts32.tv_sec;
      ts->tv_nsec = ts32.tv_nsec;
    }
  return ret;
#endif
}

#if __TIMESIZE != 64
int
__timespec_get32 (struct timespec *ts, int base)
{
  struct __timespec64 ts64;

  ret = __timespec_get64 (ts64, base);

  if ((ret == 0 || errno != ENOSYS) && ts)
    {
      ts->tv_sec = ts64.tv_sec;
      ts->tv_nsec = ts64.tv_nsec;
    }

  return ret;
}
#endif

#if __TIMESIZE == 64
# define __timespec_get __timespec_get64
#else
# define __timespec_get __timespec_get32
#endif

/* Set TS to calendar time based in time base BASE.  */
int
timespec_get (struct timespec *ts, int base)
{
  switch (base)
    {
      int res;
      INTERNAL_SYSCALL_DECL (err);
    case TIME_UTC:
      res = __timespec_get (ts, base);
      if (INTERNAL_SYSCALL_ERROR_P (res, err))
        return 0;
      break;

    default:
      return 0;
    }

  return base;
}

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
  2019-08-15 18:03     ` Alistair Francis
@ 2019-08-15 19:46       ` Joseph Myers
  2019-08-15 20:52         ` Alistair Francis
  0 siblings, 1 reply; 73+ messages in thread
From: Joseph Myers @ 2019-08-15 19:46 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Thu, 15 Aug 2019, Alistair Francis wrote:

> Is this the type of layout you are looking for? (untested, just a general idea)

I'm not convinced making timespec_get into a wrapper round another 
function is a good thing.

You need to end up, in the __TIMESIZE == 32 case, with two functions that 
have the public timespec_get semantics - not two internal functions and a 
single wrapper - in preparation for when we support _TIME_BITS == 64.  So 
I'd expect defining __timespec_get64 as a function with the public 
semantics (not as an internal function that only calls the syscall), and 
conditionally defining timespec_get as a thin wrapper in the case of 
32-bit time_t, and having a #define of __timespec_get64 to timespec_get in 
an internal header in the case of 64-bit time_t.

> int
> __timespec_get64 (struct __timespec64 *ts, int base)
> {
> #ifdef __ASSUME_TIME64_SYSCALLS
>   return INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
> #else

You need

# ifndef __NR_clock_gettime64
#  define __NR_clock_gettime64 __NR_clock_gettime
# endif

here, because 64-bit platforms define __ASSUME_TIME64_SYSCALLS but with 
unsuffixed syscall names.

>   long int ret;
> # ifdef __NR_clock_gettime64
>   ret = INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
> 
>   if (ret == 0 || errno != ENOSYS)
>     {
>       return ret;
>     }

You need to check INTERNAL_SYSCALL_ERRNO (...) not errno; errno isn't set 
by INTERNAL_*, only by INLINE_*.

No braces when only a single statement is inside them.

>   ret = INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts32);
> 
>   if ((ret == 0 || errno != ENOSYS) && ts)

No need to consider ENOSYS here.  NULL ts isn't valid so no need to check 
for it being non-NULL.

> /* Set TS to calendar time based in time base BASE.  */
> int
> timespec_get (struct timespec *ts, int base)
> {
>   switch (base)
>     {
>       int res;
>       INTERNAL_SYSCALL_DECL (err);
>     case TIME_UTC:
>       res = __timespec_get (ts, base);
>       if (INTERNAL_SYSCALL_ERROR_P (res, err))
>         return 0;

This wrapper is using an uninitialized variable err.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
  2019-08-15 19:46       ` Joseph Myers
@ 2019-08-15 20:52         ` Alistair Francis
  2019-08-15 20:59           ` Joseph Myers
  0 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-15 20:52 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Thu, Aug 15, 2019 at 12:46 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 15 Aug 2019, Alistair Francis wrote:
>
> > Is this the type of layout you are looking for? (untested, just a general idea)
>
> I'm not convinced making timespec_get into a wrapper round another
> function is a good thing.
>
> You need to end up, in the __TIMESIZE == 32 case, with two functions that
> have the public timespec_get semantics - not two internal functions and a
> single wrapper - in preparation for when we support _TIME_BITS == 64.  So
> I'd expect defining __timespec_get64 as a function with the public
> semantics (not as an internal function that only calls the syscall), and
> conditionally defining timespec_get as a thin wrapper in the case of
> 32-bit time_t, and having a #define of __timespec_get64 to timespec_get in
> an internal header in the case of 64-bit time_t.

Ok, so more like this?

#if __TIMESIZE == 64
# define timespec_get __timespec_get64
#else
# define timespec_get __timespec_get32
#endif

/* Set TS to calendar time based in time base BASE.  */
int
__timespec_get64 (struct timespec *ts, int base)
{
  switch (base)
    {
      int res;
      INTERNAL_SYSCALL_DECL (err);
    case TIME_UTC:
#ifdef __ASSUME_TIME64_SYSCALLS
  res = INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
#else
# ifdef __NR_clock_gettime64
  res = INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
# endif /* __NR_clock_gettime64 */
  struct timespec ts32;

  if (! in_time_t_range (ts->tv_sec))
    {
      __set_errno (EOVERFLOW);
      return -1;
    }

  valid_timespec64_to_timespec (ts, &ts32);
  res = INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts32);

  if (res == 0 || !INTERNAL_SYSCALL_ERROR_P (res, err))
    {
      ts->tv_sec = ts32.tv_sec;
      ts->tv_nsec = ts32.tv_nsec;
    }
#endif

      if (INTERNAL_SYSCALL_ERROR_P (res, err))
        return 0;
      break;

    default:
      return 0;
    }

  return base;
}

#if __TIMESIZE != 64
int
__timespec_get32 (struct timespec *ts, int base)
{
  struct __timespec64 ts64;

  ret = __timespec_get64 (ts64, base);

  if (res == 0 || !INTERNAL_SYSCALL_ERROR_P (res, err))
    {
      ts->tv_sec = ts64.tv_sec;
      ts->tv_nsec = ts64.tv_nsec;
    }

  return ret;
}
#endif

>
> > int
> > __timespec_get64 (struct __timespec64 *ts, int base)
> > {
> > #ifdef __ASSUME_TIME64_SYSCALLS
> >   return INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
> > #else
>
> You need
>
> # ifndef __NR_clock_gettime64
> #  define __NR_clock_gettime64 __NR_clock_gettime
> # endif
>
> here, because 64-bit platforms define __ASSUME_TIME64_SYSCALLS but with
> unsuffixed syscall names.

The kernel defines 64 suffixed syscalls, is this required because
older kernels don't do this?

>
> >   long int ret;
> > # ifdef __NR_clock_gettime64
> >   ret = INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
> >
> >   if (ret == 0 || errno != ENOSYS)
> >     {
> >       return ret;
> >     }
>
> You need to check INTERNAL_SYSCALL_ERRNO (...) not errno; errno isn't set
> by INTERNAL_*, only by INLINE_*.

Fixed! Thanks

>
> No braces when only a single statement is inside them.
>
> >   ret = INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts32);
> >
> >   if ((ret == 0 || errno != ENOSYS) && ts)
>
> No need to consider ENOSYS here.  NULL ts isn't valid so no need to check
> for it being non-NULL.

Fixed

>
> > /* Set TS to calendar time based in time base BASE.  */
> > int
> > timespec_get (struct timespec *ts, int base)
> > {
> >   switch (base)
> >     {
> >       int res;
> >       INTERNAL_SYSCALL_DECL (err);
> >     case TIME_UTC:
> >       res = __timespec_get (ts, base);
> >       if (INTERNAL_SYSCALL_ERROR_P (res, err))
> >         return 0;
>
> This wrapper is using an uninitialized variable err.

Good point, fixed.

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
  2019-08-15 20:52         ` Alistair Francis
@ 2019-08-15 20:59           ` Joseph Myers
  2019-08-15 21:16             ` Alistair Francis
  0 siblings, 1 reply; 73+ messages in thread
From: Joseph Myers @ 2019-08-15 20:59 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Thu, 15 Aug 2019, Alistair Francis wrote:

> Ok, so more like this?
> 
> #if __TIMESIZE == 64
> # define timespec_get __timespec_get64
> #else
> # define timespec_get __timespec_get32
> #endif

No.  Please see what's done for mktime, for example (but it's simpler here 
because mktime supports being built outside of glibc, which is irrelevant 
for timespec_get).

* The function __mktime64 is defined, unconditionally.

* The function mktime is defined as a thin wrapper, conditionally (only 
when 32-bit time is supported).

* There's no __mktime32 anywhere.

* mktime-internal.h deals with defining __mktime64 back to mktime in the 
case where __TIMESIZE == 64 and so only a single function is needed with 
no wrapper.

> > # ifndef __NR_clock_gettime64
> > #  define __NR_clock_gettime64 __NR_clock_gettime
> > # endif
> >
> > here, because 64-bit platforms define __ASSUME_TIME64_SYSCALLS but with
> > unsuffixed syscall names.
> 
> The kernel defines 64 suffixed syscalls, is this required because
> older kernels don't do this?

The kernel does *not* define 64-suffixed syscalls on platforms where 
__SYSCALL_WORDSIZE == 64.  It defined unsuffixed syscalls with the same 
semantics.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
  2019-08-15 20:59           ` Joseph Myers
@ 2019-08-15 21:16             ` Alistair Francis
  2019-08-15 21:19               ` Joseph Myers
  0 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-15 21:16 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Thu, Aug 15, 2019 at 1:59 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 15 Aug 2019, Alistair Francis wrote:
>
> > Ok, so more like this?
> >
> > #if __TIMESIZE == 64
> > # define timespec_get __timespec_get64
> > #else
> > # define timespec_get __timespec_get32
> > #endif
>
> No.  Please see what's done for mktime, for example (but it's simpler here
> because mktime supports being built outside of glibc, which is irrelevant
> for timespec_get).
>
> * The function __mktime64 is defined, unconditionally.
>
> * The function mktime is defined as a thin wrapper, conditionally (only
> when 32-bit time is supported).
>
> * There's no __mktime32 anywhere.
>
> * mktime-internal.h deals with defining __mktime64 back to mktime in the
> case where __TIMESIZE == 64 and so only a single function is needed with
> no wrapper.

There is no internal header for timespec_get, would you prefer me to
create one or put the define in time/time.h?

>
> > > # ifndef __NR_clock_gettime64
> > > #  define __NR_clock_gettime64 __NR_clock_gettime
> > > # endif
> > >
> > > here, because 64-bit platforms define __ASSUME_TIME64_SYSCALLS but with
> > > unsuffixed syscall names.
> >
> > The kernel defines 64 suffixed syscalls, is this required because
> > older kernels don't do this?
>
> The kernel does *not* define 64-suffixed syscalls on platforms where
> __SYSCALL_WORDSIZE == 64.  It defined unsuffixed syscalls with the same
> semantics.

Ah, you are right. I have added these defines.

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
  2019-08-15 21:16             ` Alistair Francis
@ 2019-08-15 21:19               ` Joseph Myers
  2019-08-15 21:23                 ` Alistair Francis
  0 siblings, 1 reply; 73+ messages in thread
From: Joseph Myers @ 2019-08-15 21:19 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Thu, 15 Aug 2019, Alistair Francis wrote:

> There is no internal header for timespec_get, would you prefer me to
> create one or put the define in time/time.h?

time/time.h is an installed header, so it mustn't go there.  
include/time.h would be fine (it has several such defines, for 
__localtime64 etc.).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
  2019-08-15 21:19               ` Joseph Myers
@ 2019-08-15 21:23                 ` Alistair Francis
  2019-08-15 21:28                   ` Joseph Myers
  0 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-15 21:23 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Thu, Aug 15, 2019 at 2:19 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 15 Aug 2019, Alistair Francis wrote:
>
> > There is no internal header for timespec_get, would you prefer me to
> > create one or put the define in time/time.h?
>
> time/time.h is an installed header, so it mustn't go there.
> include/time.h would be fine (it has several such defines, for
> __localtime64 etc.).

Ok, I have this in include/time.h:

#if __TIMESIZE == 64
#define timespec_get __timespec_get64
#else

and this in the c file:

/* Set TS to calendar time based in time base BASE.  */
int
__timespec_get64 (struct timespec *ts, int base)
{
  switch (base)
    {
      int res;
      INTERNAL_SYSCALL_DECL (err);
    case TIME_UTC:
#ifdef __ASSUME_TIME64_SYSCALLS
# ifndef __NR_clock_gettime64
#  define __NR_clock_gettime64 __NR_clock_gettime
# endif
  res = INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
#else
# ifdef __NR_clock_gettime64
  res = INTERNAL_VSYSCALL (clock_gettime64, err, 2, CLOCK_REALTIME, ts);
# endif /* __NR_clock_gettime64 */
  struct timespec ts32;

  if (! in_time_t_range (ts->tv_sec))
    {
      __set_errno (EOVERFLOW);
      return -1;
    }

  valid_timespec64_to_timespec (ts, &ts32);
  res = INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts32);

  if (res == 0 || !INTERNAL_SYSCALL_ERROR_P (res, err))
    {
      ts->tv_sec = ts32.tv_sec;
      ts->tv_nsec = ts32.tv_nsec;
    }
#endif

      if (INTERNAL_SYSCALL_ERROR_P (res, err))
        return 0;
      break;

    default:
      return 0;
    }

  return base;
}

#if __TIMESIZE != 64
int
timespec_get (struct timespec *ts, int base)
{
  struct __timespec64 ts64;

  ret = __timespec_get64 (ts64, base);

  if (res == 0 || !INTERNAL_SYSCALL_ERROR_P (res, err))
    {
      ts->tv_sec = ts64.tv_sec;
      ts->tv_nsec = ts64.tv_nsec;
    }

  return ret;
}
#endif

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
  2019-08-15 21:23                 ` Alistair Francis
@ 2019-08-15 21:28                   ` Joseph Myers
  2019-08-15 21:35                     ` Alistair Francis
  0 siblings, 1 reply; 73+ messages in thread
From: Joseph Myers @ 2019-08-15 21:28 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Thu, 15 Aug 2019, Alistair Francis wrote:

> On Thu, Aug 15, 2019 at 2:19 PM Joseph Myers <joseph@codesourcery.com> wrote:
> >
> > On Thu, 15 Aug 2019, Alistair Francis wrote:
> >
> > > There is no internal header for timespec_get, would you prefer me to
> > > create one or put the define in time/time.h?
> >
> > time/time.h is an installed header, so it mustn't go there.
> > include/time.h would be fine (it has several such defines, for
> > __localtime64 etc.).
> 
> Ok, I have this in include/time.h:
> 
> #if __TIMESIZE == 64
> #define timespec_get __timespec_get64
> #else

That should be the other way round (defining __timespec_get64 to 
timespec_get so that timespec_get gets properly exported from libc).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable
  2019-08-15 21:28                   ` Joseph Myers
@ 2019-08-15 21:35                     ` Alistair Francis
  0 siblings, 0 replies; 73+ messages in thread
From: Alistair Francis @ 2019-08-15 21:35 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Thu, Aug 15, 2019 at 2:28 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 15 Aug 2019, Alistair Francis wrote:
>
> > On Thu, Aug 15, 2019 at 2:19 PM Joseph Myers <joseph@codesourcery.com> wrote:
> > >
> > > On Thu, 15 Aug 2019, Alistair Francis wrote:
> > >
> > > > There is no internal header for timespec_get, would you prefer me to
> > > > create one or put the define in time/time.h?
> > >
> > > time/time.h is an installed header, so it mustn't go there.
> > > include/time.h would be fine (it has several such defines, for
> > > __localtime64 etc.).
> >
> > Ok, I have this in include/time.h:
> >
> > #if __TIMESIZE == 64
> > #define timespec_get __timespec_get64
> > #else
>
> That should be the other way round (defining __timespec_get64 to
> timespec_get so that timespec_get gets properly exported from libc).

Ok.

Thanks for your help with this. I'll update the other patches with a
similar style and look at sending a full patch series after running
tests.

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 23/24] WIP: syscall.list: Call 64-bit versions of syscalls
  2019-08-14 18:57     ` Florian Weimer
@ 2019-08-15 21:43       ` Alistair Francis
  2019-08-19 11:30         ` Florian Weimer
  0 siblings, 1 reply; 73+ messages in thread
From: Alistair Francis @ 2019-08-15 21:43 UTC (permalink / raw)
  To: Florian Weimer
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Palmer Dabbelt, macro, Zong Li

On Wed, Aug 14, 2019 at 11:57 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Alistair Francis:
>
> > On Fri, Aug 9, 2019 at 6:04 PM Alistair Francis
> > <alistair.francis@wdc.com> wrote:
> >>
> >> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> >> ---
> >>  sysdeps/unix/sysv/linux/syscalls.list | 8 ++++----
> >>  1 file changed, 4 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
> >> index e374f97b5f8..4844d1a9a3b 100644
> >> --- a/sysdeps/unix/sysv/linux/syscalls.list
> >> +++ b/sysdeps/unix/sysv/linux/syscalls.list
> >> @@ -5,7 +5,7 @@ alarm           -       alarm           i:i     alarm
> >>  bdflush                EXTRA   bdflush         i:ii    __compat_bdflush        bdflush@GLIBC_2.0:GLIBC_2.23
> >>  capget         EXTRA   capget          i:pp    capget
> >>  capset         EXTRA   capset          i:pp    capset
> >> -clock_adjtime  EXTRA   clock_adjtime   i:ip    clock_adjtime
> >> +clock_adjtime  EXTRA   clock_adjtime64 i:ip    clock_adjtime
> >>  create_module  EXTRA   create_module   3       __compat_create_module  create_module@GLIBC_2.0:GLIBC_2.23
> >>  delete_module  EXTRA   delete_module   3       delete_module
> >>  epoll_create   EXTRA   epoll_create    i:i     epoll_create
> >> @@ -52,7 +52,7 @@ sched_getp    -       sched_getparam  i:ip    __sched_getparam        sched_getparam
> >>  sched_gets     -       sched_getscheduler      i:i     __sched_getscheduler    sched_getscheduler
> >>  sched_primax   -       sched_get_priority_max  i:i     __sched_get_priority_max        sched_get_priority_max
> >>  sched_primin   -       sched_get_priority_min  i:i     __sched_get_priority_min        sched_get_priority_min
> >> -sched_rr_gi    -       sched_rr_get_interval   i:ip    __sched_rr_get_interval sched_rr_get_interval
> >> +sched_rr_gi    -       sched_rr_get_interval_time64    i:ip    __sched_rr_get_interval sched_rr_get_interval
> >>  sched_setp     -       sched_setparam  i:ip    __sched_setparam        sched_setparam
> >>  sched_sets     -       sched_setscheduler      i:iip   __sched_setscheduler    sched_setscheduler
> >>  sched_yield    -       sched_yield     i:      __sched_yield   sched_yield
> >> @@ -96,8 +96,8 @@ fremovexattr  -       fremovexattr    i:is    fremovexattr
> >>  mq_setattr     -       mq_getsetattr   i:ipp   mq_setattr
> >>
> >>  timerfd_create EXTRA   timerfd_create  i:ii    timerfd_create
> >> -timerfd_settime        EXTRA   timerfd_settime i:iipp  timerfd_settime
> >> -timerfd_gettime        EXTRA   timerfd_gettime i:ip    timerfd_gettime
> >> +timerfd_settime        EXTRA   timerfd_settime64       i:iipp  timerfd_settime
> >> +timerfd_gettime        EXTRA   timerfd_gettime64       i:ip    timerfd_gettime
> >
> > Does anyone have ideas/opinions on how to handle this correctly?
>
> As in many of the other cases, you can add this to <sysdep.h>:
>
> #define __NR_timerfd_settime __NR_timerfd_settime64
> #define __NR_timerfd_gettime __NR_timerfd_gettime64
>
> Once a second such port arrives, we can factor out these common system
> call renamings into a generic-64 subdirectory.

Great! That's a straightforward fix.

Alistair

>
> I still think it's just wrong that the kernel doesn't provide these
> names as part of the UAPI headers.
>
> Thanks,
> Florian

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 23/24] WIP: syscall.list: Call 64-bit versions of syscalls
  2019-08-15 21:43       ` Alistair Francis
@ 2019-08-19 11:30         ` Florian Weimer
  0 siblings, 0 replies; 73+ messages in thread
From: Florian Weimer @ 2019-08-19 11:30 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Palmer Dabbelt, macro, Zong Li

* Alistair Francis:

> On Wed, Aug 14, 2019 at 11:57 AM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * Alistair Francis:
>>
>> > On Fri, Aug 9, 2019 at 6:04 PM Alistair Francis
>> > <alistair.francis@wdc.com> wrote:
>> >>
>> >> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
>> >> ---
>> >>  sysdeps/unix/sysv/linux/syscalls.list | 8 ++++----
>> >>  1 file changed, 4 insertions(+), 4 deletions(-)
>> >>
>> >> diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
>> >> index e374f97b5f8..4844d1a9a3b 100644
>> >> --- a/sysdeps/unix/sysv/linux/syscalls.list
>> >> +++ b/sysdeps/unix/sysv/linux/syscalls.list
>> >> @@ -5,7 +5,7 @@ alarm           -       alarm           i:i     alarm
>> >>  bdflush                EXTRA   bdflush         i:ii    __compat_bdflush        bdflush@GLIBC_2.0:GLIBC_2.23
>> >>  capget         EXTRA   capget          i:pp    capget
>> >>  capset         EXTRA   capset          i:pp    capset
>> >> -clock_adjtime  EXTRA   clock_adjtime   i:ip    clock_adjtime
>> >> +clock_adjtime  EXTRA   clock_adjtime64 i:ip    clock_adjtime
>> >>  create_module  EXTRA   create_module   3       __compat_create_module  create_module@GLIBC_2.0:GLIBC_2.23
>> >>  delete_module  EXTRA   delete_module   3       delete_module
>> >>  epoll_create   EXTRA   epoll_create    i:i     epoll_create
>> >> @@ -52,7 +52,7 @@ sched_getp    -       sched_getparam  i:ip    __sched_getparam        sched_getparam
>> >>  sched_gets     -       sched_getscheduler      i:i     __sched_getscheduler    sched_getscheduler
>> >>  sched_primax   -       sched_get_priority_max  i:i     __sched_get_priority_max        sched_get_priority_max
>> >>  sched_primin   -       sched_get_priority_min  i:i     __sched_get_priority_min        sched_get_priority_min
>> >> -sched_rr_gi    -       sched_rr_get_interval   i:ip    __sched_rr_get_interval sched_rr_get_interval
>> >> +sched_rr_gi    -       sched_rr_get_interval_time64    i:ip    __sched_rr_get_interval sched_rr_get_interval
>> >>  sched_setp     -       sched_setparam  i:ip    __sched_setparam        sched_setparam
>> >>  sched_sets     -       sched_setscheduler      i:iip   __sched_setscheduler    sched_setscheduler
>> >>  sched_yield    -       sched_yield     i:      __sched_yield   sched_yield
>> >> @@ -96,8 +96,8 @@ fremovexattr  -       fremovexattr    i:is    fremovexattr
>> >>  mq_setattr     -       mq_getsetattr   i:ipp   mq_setattr
>> >>
>> >>  timerfd_create EXTRA   timerfd_create  i:ii    timerfd_create
>> >> -timerfd_settime        EXTRA   timerfd_settime i:iipp  timerfd_settime
>> >> -timerfd_gettime        EXTRA   timerfd_gettime i:ip    timerfd_gettime
>> >> +timerfd_settime        EXTRA   timerfd_settime64       i:iipp  timerfd_settime
>> >> +timerfd_gettime        EXTRA   timerfd_gettime64       i:ip    timerfd_gettime
>> >
>> > Does anyone have ideas/opinions on how to handle this correctly?
>>
>> As in many of the other cases, you can add this to <sysdep.h>:
>>
>> #define __NR_timerfd_settime __NR_timerfd_settime64
>> #define __NR_timerfd_gettime __NR_timerfd_gettime64
>>
>> Once a second such port arrives, we can factor out these common system
>> call renamings into a generic-64 subdirectory.
>
> Great! That's a straightforward fix.

Note that getting this to work on legacy architectures (which have a
32-bit time_t) today obviously requires vastly different steps.

I do not know if completing this work is a requirement for acceptance of
the RV32 port (I don't think it should be, but others might disagree).

Thanks,
Florian

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC v4 24/24] timerfd_settime: Use 64-bit call if avaliable
  2019-08-10  1:28   ` Alistair Francis
@ 2019-08-20 20:11     ` Maciej W. Rozycki
  0 siblings, 0 replies; 73+ messages in thread
From: Maciej W. Rozycki @ 2019-08-20 20:11 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, Zong Li

On Fri, 9 Aug 2019, Alistair Francis wrote:

> This commit was clearly not tested very well (it's missing
> semicolons), just see it more as pseudo code.
[...]
> > diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> > index 1ab6bcbfc81..89128e80868 100644
> > --- a/sysdeps/unix/sysv/linux/Makefile
> > +++ b/sysdeps/unix/sysv/linux/Makefile
> > @@ -19,6 +19,8 @@ sysdep_routines += clone umount umount2 readahead \
> >                    eventfd eventfd_read eventfd_write prlimit \
> >                    personality epoll_wait tee vmsplice splice \
> >                    open_by_handle_at mlock2 pkey_mprotect pkey_set pkey_get

 Missing trailing backslash here too, which breaks building.

> > +                  timerfd_settime

  Maciej

^ permalink raw reply	[flat|nested] 73+ messages in thread

end of thread, other threads:[~2019-08-20 20:11 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-10  1:03 [RFC v4 00/24] RISC-V glibc port for the 32-bit Alistair Francis
2019-08-10  1:03 ` [RFC v4 17/24] RISC-V: Hard float support for the 32 bit Alistair Francis
2019-08-10  1:03 ` [RFC v4 01/24] sunrpc/clnt_udp: Ensure total_deadline is initalised Alistair Francis
2019-08-10  1:03 ` [RFC v4 06/24] sysdeps/timespec_get: Use clock_gettime64 if avaliable Alistair Francis
2019-08-12 19:46   ` Joseph Myers
2019-08-15 18:03     ` Alistair Francis
2019-08-15 19:46       ` Joseph Myers
2019-08-15 20:52         ` Alistair Francis
2019-08-15 20:59           ` Joseph Myers
2019-08-15 21:16             ` Alistair Francis
2019-08-15 21:19               ` Joseph Myers
2019-08-15 21:23                 ` Alistair Francis
2019-08-15 21:28                   ` Joseph Myers
2019-08-15 21:35                     ` Alistair Francis
2019-08-10  1:03 ` [RFC v4 05/24] sysdeps/clock_gettime: " Alistair Francis
2019-08-12 19:46   ` Joseph Myers
2019-08-13 23:48     ` Alistair Francis
2019-08-14 16:37       ` Joseph Myers
2019-08-14 18:12         ` Alistair Francis
2019-08-10  1:03 ` [RFC v4 07/24] time: Deprecate struct timezone members Alistair Francis
2019-08-10  1:20   ` Paul Eggert
2019-08-10  1:30     ` Alistair Francis
2019-08-11 13:52       ` Florian Weimer
2019-08-11 16:59         ` Alistair Francis
2019-08-11 17:28         ` Rich Felker
2019-08-12  8:22           ` Florian Weimer
2019-08-12 15:42   ` Zack Weinberg
2019-08-12 20:20     ` Joseph Myers
2019-08-12 21:08       ` Zack Weinberg
2019-08-12 21:26         ` Joseph Myers
2019-08-12 22:13           ` Alistair Francis
2019-08-12 23:16           ` Zack Weinberg
2019-08-13  0:53           ` Paul Eggert
2019-08-13  1:04             ` Zack Weinberg
2019-08-12 22:11     ` Alistair Francis
2019-08-10  1:03 ` [RFC v4 16/24] RISC-V: The ABI implementation for the 32-bit Alistair Francis
2019-08-10  1:03 ` [RFC v4 10/24] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64 Alistair Francis
2019-08-10  1:03 ` [RFC v4 03/24] sysdeps/gettimeofday: Use clock_gettime64 if avaliable Alistair Francis
2019-08-12 17:27   ` Joseph Myers
2019-08-10  1:03 ` [RFC v4 13/24] RISC-V: Use 64-bit timespec in clock_gettime vdso calls Alistair Francis
2019-08-10  1:03 ` [RFC v4 08/24] sysdeps/stat: Copy the statx struct to stat instead of stat64 Alistair Francis
2019-08-12 20:01   ` Joseph Myers
2019-08-12 22:26     ` Alistair Francis
2019-08-12 23:02       ` Joseph Myers
2019-08-12 23:10         ` Alistair Francis
2019-08-12 23:31           ` Joseph Myers
2019-08-13 20:40             ` Alistair Francis
2019-08-10  1:03 ` [RFC v4 12/24] RISC-V: define __NR_* as __NR_*_time64/64 for 32-bit Alistair Francis
2019-08-10  1:03 ` [RFC v4 04/24] sysdeps/wait: Use waitid if avaliable Alistair Francis
2019-08-10  1:03 ` [RFC v4 15/24] RISC-V: Add path of library directories for RV32 Alistair Francis
2019-08-10  1:03 ` [RFC v4 02/24] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable Alistair Francis
2019-08-12 17:22   ` Joseph Myers
2019-08-14 18:24     ` Alistair Francis
2019-08-14 20:15       ` Joseph Myers
2019-08-14 21:39       ` Stepan Golosunov
2019-08-10  1:03 ` [RFC v4 09/24] Documentation for the RISC-V 32-bit port Alistair Francis
2019-08-12 20:02   ` Joseph Myers
2019-08-10  1:04 ` [RFC v4 21/24] Add RISC-V 32-bit target to build-many-glibcs.py Alistair Francis
2019-08-10  1:04 ` [RFC v4 24/24] timerfd_settime: Use 64-bit call if avaliable Alistair Francis
2019-08-10  1:28   ` Alistair Francis
2019-08-20 20:11     ` Maciej W. Rozycki
2019-08-12 20:09   ` Joseph Myers
2019-08-10  1:04 ` [RFC v4 23/24] WIP: syscall.list: Call 64-bit versions of syscalls Alistair Francis
2019-08-14 18:39   ` Alistair Francis
2019-08-14 18:57     ` Florian Weimer
2019-08-15 21:43       ` Alistair Francis
2019-08-19 11:30         ` Florian Weimer
2019-08-10  1:04 ` [RFC v4 19/24] RISC-V: Build Infastructure for the 32-bit Alistair Francis
2019-08-10  1:04 ` [RFC v4 22/24] RISC-V: Use 64-bit vdso syscalls for RV32 Alistair Francis
2019-08-10  1:04 ` [RFC v4 20/24] RISC-V: Fix llrint and llround missing exceptions on RV32 Alistair Francis
2019-08-10  1:04 ` [RFC v4 11/24] RISC-V: define __NR_futex as __NR_futex_time64 for 32-bit Alistair Francis
2019-08-10  1:04 ` [RFC v4 18/24] RISC-V: Add ABI lists Alistair Francis
2019-08-10  1:04 ` [RFC v4 14/24] RISC-V: Support dynamic loader for the 32-bit Alistair Francis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).