unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [RFC v5 00/21]  RISC-V glibc port for the 32-bit
@ 2019-08-29 16:50 Alistair Francis
  2019-08-29 16:50 ` [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised Alistair Francis
                   ` (21 more replies)
  0 siblings, 22 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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] and __ASSUME_TIME64_SYSCALLS patch [3].

All testing has been done on a 5.3 kernel with these two patches back
ported from linux-next:
 - pidfd: add P_PIDFD to waitid()
 - waitid: Add support for waiting for the current process group
to fix the waitid() syscall race.

Issues still to address:
 - Wait for Lukasz's patche series mentioned above to be merged (2)
 - Get the RV32 tests running. At the moment the tests are hanging and
   I'm trying to investigate.
 - Rebased on the clock_gettime series [4] on list once it is merged.

1: https://sourceware.org/ml/libc-alpha/2018-07/msg00892.html
2: https://sourceware.org/ml/libc-alpha/2019-05/msg00661.html
3: https://patchwork.ozlabs.org/project/glibc/list/?series=127618
4: https://patchwork.ozlabs.org/project/glibc/list/?series=127832

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.rfc5

RFC v5:
 - Hopefully finally get the correct layout for the *64 syscalls
 - Sort out the Changelog
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 (12):
  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
  sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts
  sysdeps/statfs: Handle 64-bit ino_t types on 32-bit hosts
  RISC-V: Use 64-bit time_t and off_t for RV32 and RV64
  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

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

 NEWS                                          |    6 +
 README                                        |    1 +
 include/time.h                                |    8 +
 nptl/thrd_sleep.c                             |   69 +-
 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/sysv/linux/clock_getres.c        |    4 +
 sysdeps/unix/sysv/linux/clock_gettime.c       |   48 +-
 sysdeps/unix/sysv/linux/clock_nanosleep.c     |   74 +-
 sysdeps/unix/sysv/linux/generic/bits/stat.h   |    5 +-
 sysdeps/unix/sysv/linux/generic/bits/statfs.h |    5 +-
 .../sysv/linux/generic/wordsize-32/overflow.h |    8 +
 sysdeps/unix/sysv/linux/gettimeofday.c        |   59 +-
 sysdeps/unix/sysv/linux/nanosleep.c           |   65 +-
 sysdeps/unix/sysv/linux/nanosleep_nocancel.c  |   64 +-
 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    |   19 +-
 sysdeps/unix/sysv/linux/riscv/kernel_stat.h   |   23 +
 sysdeps/unix/sysv/linux/riscv/ldconfig.h      |    2 +-
 sysdeps/unix/sysv/linux/riscv/libc-vdso.h     |    9 +-
 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        |   73 +
 sysdeps/unix/sysv/linux/timespec_get.c        |   48 +-
 sysdeps/unix/sysv/linux/wait.c                |   41 +-
 sysdeps/unix/sysv/linux/waitpid.c             |   59 +-
 sysdeps/unix/sysv/linux/waitpid_nocancel.c    |   56 +-
 61 files changed, 4915 insertions(+), 52 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/kernel_stat.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

-- 
2.22.0


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

* [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 17:22   ` Joseph Myers
  2019-08-29 16:50 ` [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable Alistair Francis
                   ` (20 subsequent siblings)
  21 siblings, 1 reply; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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: Ensure total_deadline is initalised.
---
 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 related	[flat|nested] 46+ messages in thread

* [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
  2019-08-29 16:50 ` [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 17:25   ` Joseph Myers
  2019-10-14 13:59   ` Lukasz Majewski
  2019-08-29 16:50 ` [RFC v5 03/21] sysdeps/gettimeofday: Use clock_gettime64 " Alistair Francis
                   ` (19 subsequent siblings)
  21 siblings, 2 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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()"

Signed-off-by: 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/clock_nanosleep.c: Likewise.
	* sysdeps/unix/sysv/linux/nanosleep_nocancel.c: Likewise.
---
 include/time.h                               |  6 ++
 nptl/thrd_sleep.c                            | 69 ++++++++++++++++--
 sysdeps/unix/sysv/linux/clock_nanosleep.c    | 74 ++++++++++++++++++--
 sysdeps/unix/sysv/linux/nanosleep.c          | 65 ++++++++++++++++-
 sysdeps/unix/sysv/linux/nanosleep_nocancel.c | 64 ++++++++++++++++-
 5 files changed, 264 insertions(+), 14 deletions(-)

diff --git a/include/time.h b/include/time.h
index 95b31429212..6d81f91384b 100644
--- a/include/time.h
+++ b/include/time.h
@@ -172,6 +172,12 @@ libc_hidden_proto (__difftime64)
 
 extern double __difftime (time_t time1, time_t time0);
 
+#if __TIMESIZE == 64
+#define __thrd_sleep_time64 thrd_sleep
+#define __clock_nanosleep_time64 __clock_nanosleep
+#define __nanosleep_time64 __nanosleep
+#define __nanosleep_nocancel_time64 __nanosleep_nocancel
+#endif
 
 /* Use in the clock_* functions.  Size of the field representing the
    actual clock ID.  */
diff --git a/nptl/thrd_sleep.c b/nptl/thrd_sleep.c
index 07a51808df2..e85da561c68 100644
--- a/nptl/thrd_sleep.c
+++ b/nptl/thrd_sleep.c
@@ -22,18 +22,79 @@
 #include "thrd_priv.h"
 
 int
-thrd_sleep (const struct timespec* time_point, struct timespec* remaining)
+__thrd_sleep_time64 (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
+# ifndef __NR_clock_nanosleep_time64
+#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
+# endif
+  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, CLOCK_REALTIME,
+                                 0, time_point, remaining);
+#else
+# ifdef __NR_clock_nanosleep_time64
+  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;
+# endif /* __NR_clock_nanosleep_time64 */
+  if (ret < 0)
+    {
+      struct timespec tp32, tr32;
+
+      if (! in_time_t_range (time_point->tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      valid_timespec64_to_timespec (time_point, &tp32);
+      ret =  INTERNAL_SYSCALL_CANCEL (nanosleep, err, &tp32, &tr32);
+
+      if ((ret == 0 || errno != ENOSYS) && remaining)
+        valid_timespec_to_timespec64(&tr32, remaining);
+    }
+#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;
 }
+
+#if __TIMESIZE != 64
+int
+thrd_sleep (const struct timespec* time_point, struct timespec* remaining)
+{
+  int ret;
+  timespec64 tp64, tr64;
+
+  valid_timespec_to_timespec64(time_point, &tp64);
+  ret = __thrd_sleep_time64 (&tp64, &tr64);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      if (! in_time_t_range (tr64->tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      if (remaining)
+        valid_timespec64_to_timespec(&tr32, remaining);
+    }
+
+  return ret;
+}
+#endif
diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c b/sysdeps/unix/sysv/linux/clock_nanosleep.c
index 0cb6614dc92..64302fbcc69 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)
+__clock_nanosleep_time64 (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,9 +37,70 @@ __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
+# ifndef __NR_clock_nanosleep_time64
+#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
+# endif
+  r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, clock_id,
+                               flags, req, rem);
+#else
+# ifdef __NR_clock_nanosleep_time64
+  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;
+# endif /* __NR_clock_nanosleep_time64 */
+  if (r < 0)
+    {
+      struct timespec ts32, tr32;
+
+      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)
+        valid_timespec_to_timespec64(&tr32, rem);
+    }
+#endif /* __ASSUME_TIME64_SYSCALLS */
+
   return (INTERNAL_SYSCALL_ERROR_P (r, err)
-	  ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
+          ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
 }
+
+#if __TIMESIZE != 64
+int
+__clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
+                   struct timespec *rem)
+{
+  int r;
+  timespec64 treq64, trem64;
+
+  valid_timespec_to_timespec64(req, &treq64)
+  r = __clock_nanosleep_time64 (clock_id, flags, &treq64, &trem64);
+
+  if (r == 0 || errno != ENOSYS)
+    {
+      if (! in_time_t_range (trem64->tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      if (remaining)
+        valid_timespec64_to_timespec(&tr32, remaining);
+    }
+
+  return r;
+}
+#endif
+
 weak_alias (__clock_nanosleep, clock_nanosleep)
diff --git a/sysdeps/unix/sysv/linux/nanosleep.c b/sysdeps/unix/sysv/linux/nanosleep.c
index f14ae565af5..9a8dd5a4b82 100644
--- a/sysdeps/unix/sysv/linux/nanosleep.c
+++ b/sysdeps/unix/sysv/linux/nanosleep.c
@@ -22,10 +22,71 @@
 
 /* Pause execution for a number of nanoseconds.  */
 int
+__nanosleep_time64 (const struct timespec *requested_time,
+                    struct timespec *remaining)
+{
+#if defined(__ASSUME_TIME64_SYSCALLS)
+# ifndef __NR_clock_nanosleep_time64
+#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
+# endif
+  return SYSCALL_CANCEL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
+                         requested_time, remaining);
+#else
+# ifdef __NR_clock_nanosleep_time64
+  long int ret_64;
+
+  ret_64 = SYSCALL_CANCEL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
+                           requested_time, remaining);
+
+  if (ret_64 == 0 || errno != ENOSYS)
+    return ret_64;
+# endif /* __NR_clock_nanosleep_time64 */
+  int ret;
+  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)
+    valid_timespec_to_timespec64(&tr32, remaining);
+
+  return ret;
+#endif /* __ASSUME_TIME64_SYSCALLS */
+}
+
+#if __TIMESIZE != 64
+int
 __nanosleep (const struct timespec *requested_time,
-	     struct timespec *remaining)
+             struct timespec *remaining)
 {
-  return SYSCALL_CANCEL (nanosleep, requested_time, remaining);
+  int r;
+  timespec64 treq64, trem64;
+
+
+  valid_timespec_to_timespec64(req, &treq64);
+  r = __nanosleep_time64 (&treq64, &trem64);
+
+  if (r == 0 || errno != ENOSYS)
+    {
+      if (! in_time_t_range (trem64->tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      if (remaining)
+        valid_timespec64_to_timespec(&tr32, remaining);
+    }
+
+  return r;
 }
+#endif
+
 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..03f5be2ff9e 100644
--- a/sysdeps/unix/sysv/linux/nanosleep_nocancel.c
+++ b/sysdeps/unix/sysv/linux/nanosleep_nocancel.c
@@ -20,10 +20,70 @@
 #include <sysdep-cancel.h>
 #include <not-cancel.h>
 
+int
+__nanosleep_nocancel_time64 (const struct timespec *requested_time,
+                             struct timespec *remaining)
+{
+#ifdef __ASSUME_TIME64_SYSCALLS
+# ifndef __NR_clock_nanosleep_time64
+#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
+# endif
+  return INLINE_SYSCALL_CALL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
+                              requested_time, remaining);
+#else
+# ifdef __NR_clock_nanosleep_time64
+  long int ret_64;
+
+  ret_64 = INLINE_SYSCALL_CALL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
+                                requested_time, remaining);
+
+  if (ret_64 == 0 || errno != ENOSYS)
+    return ret_64;
+# endif /* __NR_clock_nanosleep_time64 */
+  int ret;
+  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)
+    valid_timespec_to_timespec64(&tr32, remaining);
+
+  return ret;
+#endif /* __ASSUME_TIME64_SYSCALLS */
+}
+
+#if __TIMESIZE != 64
 int
 __nanosleep_nocancel (const struct timespec *requested_time,
-		      struct timespec *remaining)
+                      struct timespec *remaining)
 {
-  return INLINE_SYSCALL_CALL (nanosleep, requested_time, remaining);
+  int ret;
+  timespec64 treq64, trem64;
+
+  valid_timespec_to_timespec64(req, &treq64)
+  ret = __nanosleep_nocancel_time64 (&treq64, &trem64);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      if (! in_time_t_range (trem64->tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      if (remaining)
+        valid_timespec64_to_timespec(&tr32, remaining);
+    }
+
+  return ret;
 }
+#endif
+
 hidden_def (__nanosleep_nocancel)
-- 
2.22.0


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

* [RFC v5 03/21] sysdeps/gettimeofday: Use clock_gettime64 if avaliable
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
  2019-08-29 16:50 ` [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised Alistair Francis
  2019-08-29 16:50 ` [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 04/21] sysdeps/wait: Use waitid " Alistair Francis
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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.

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;
}

Arnd used Debian code search and found the following uses of struct timezone:

drivers/media/platform/vivid/vivid-rds-gen.c:
(sys_tz.tz_minuteswest >= 0 ? 0x20 : 0) |
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:
record->end_utc_bias = cpu_to_le16(sys_tz.tz_minuteswest * 60);
drivers/scsi/3w-9xxx.c: local_time = (u32)(ktime_get_real_seconds() -
(sys_tz.tz_minuteswest * 60));
drivers/scsi/3w-sas.c:  local_time = (u32)(ktime_get_real_seconds() -
(sys_tz.tz_minuteswest * 60));
drivers/scsi/aacraid/commsup.c: local_time = (now->tv_sec -
(sys_tz.tz_minuteswest * 60));
drivers/scsi/arcmsr/arcmsr_hba.c:
time64_to_tm(ktime_get_real_seconds(), -sys_tz.tz_minuteswest * 60,
&tm);
drivers/scsi/mvumi.c:           local_time = (time -
(sys_tz.tz_minuteswest * 60));
drivers/scsi/smartpqi/smartpqi_init.c:  time64_to_tm(local_time,
-sys_tz.tz_minuteswest * 60, &tm);
fs/affs/amigaffs.c:     secs -= sys_tz.tz_minuteswest * 60 + ((8 * 365
+ 2) * 24 * 60 * 60);
fs/affs/inode.c:                         sys_tz.tz_minuteswest * 60;
fs/fat/misc.c:         sys_tz.tz_minuteswest) * SECS_PER_MIN;
fs/hfs/hfs_fs.h:        return ut + sys_tz.tz_minuteswest * 60;
fs/hfs/inode.c: HFS_I(inode)->tz_secondswest = sys_tz.tz_minuteswest * 60;
fs/hfs/sysdep.c:        diff = sys_tz.tz_minuteswest * 60 -
HFS_I(inode)->tz_secondswest;
fs/hpfs/hpfs_fn.h:      return t + sys_tz.tz_minuteswest * 60 +
hpfs_sb(s)->sb_timeshift;
fs/udf/udftime.c:       offset = -sys_tz.tz_minuteswest;
kernel/debug/kdb/kdb_main.c:            sys_tz.tz_minuteswest);
kernel/time/ntp.c:              adjust.tv_sec -= (sys_tz.tz_minuteswest * 60);
kernel/time/timekeeping.c:      if (sys_tz.tz_minuteswest != 0) {
kernel/time/vsyscall.c:         vdata[CS_HRES_COARSE].tz_minuteswest =
sys_tz.tz_minuteswest;
lib/vdso/gettimeofday.c:                tz->tz_minuteswest =
vd[CS_HRES_COARSE].tz_minuteswest;
net/netfilter/xt_time.c:                stamp -= 60 * sys_tz.tz_minuteswest;

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

	* sysdeps/unix/sysv/linux/gettimeofday.c: Use clock_gettime64 syscall
	for gettimeofday.
---
 sysdeps/unix/sysv/linux/gettimeofday.c | 59 +++++++++++++++++++++++++-
 1 file changed, 58 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/gettimeofday.c b/sysdeps/unix/sysv/linux/gettimeofday.c
index a74f03825a5..af342f219ec 100644
--- a/sysdeps/unix/sysv/linux/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/gettimeofday.c
@@ -32,8 +32,65 @@
 int
 __gettimeofday (struct timeval *tv, struct timezone *tz)
 {
-  return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
+  long int ret_64;
+#ifdef __ASSUME_TIME64_SYSCALLS
+# ifndef __NR_clock_gettime64
+#  define __NR_clock_gettime64 __NR_clock_gettime
+# endif
+  struct timespec now;
+
+  ret_64 = INLINE_VSYSCALL (clock_gettime64, 2, CLOCK_REALTIME,
+                         &now);
+
+  if (ret_64 == 0 || errno != ENOSYS)
+    valid_timespec64_to_timeval((struct __timespec64*) &now, tv);
+
+  return ret_64;
+#else
+# ifdef __NR_clock_gettime64
+  ret_64 = INLINE_VSYSCALL (clock_gettime64, 2, CLOCK_REALTIME,
+                         &now);
+
+  if (ret_64 == 0 || errno != ENOSYS)
+    {
+      valid_timespec64_to_timeval((struct __timespec64*) &now, tv);
+      return ret_64;
+    }
+# endif /* __NR_clock_gettime64 */
+  int ret = INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
+
+  if (! in_time_t_range (tv->tv_sec))
+    {
+      __set_errno (EOVERFLOW);
+      return -1;
+    }
+
+  return ret;
+#endif
 }
+
+#if __TIMESIZE != 64
+int
+__gettimeofday (struct timeval *tv, struct timezone *tz)
+{
+  int ret;
+  timeval64 tv64;
+  struct __timespec64 now;
+
+  ret = __gettimeofday (&tv64, tz);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      /* Convert from timespec to timeval */
+      tv->tv_sec = tv64.tv_sec;
+      tv->tv_usec = tv64.tv_nsec;
+      return ret;
+    }
+
+  return ret;
+}
+#endif
+
 libc_hidden_def (__gettimeofday)
 weak_alias (__gettimeofday, gettimeofday)
 libc_hidden_weak (gettimeofday)
-- 
2.22.0


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

* [RFC v5 04/21] sysdeps/wait: Use waitid if avaliable
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (2 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 03/21] sysdeps/gettimeofday: Use clock_gettime64 " Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 05/21] sysdeps/clock_gettime: Use clock_gettime64 " Alistair Francis
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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.

For full support we need the 5.4+ kernel as that allows a pid of 0 with
the P_PGID idtype.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

	* 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/wait.c             | 41 +++++++++++++--
 sysdeps/unix/sysv/linux/waitpid.c          | 59 +++++++++++++++++++++-
 sysdeps/unix/sysv/linux/waitpid_nocancel.c | 56 +++++++++++++++++++-
 3 files changed, 151 insertions(+), 5 deletions(-)

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..003d9ad8113 100644
--- a/sysdeps/unix/sysv/linux/waitpid.c
+++ b/sysdeps/unix/sysv/linux/waitpid.c
@@ -20,14 +20,71 @@
 #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)
+    {
+      /* Linux Kernels 5.4+ support pid 0 with P_PGID to specify wait on
+       * the current PID's group. Earlier kernels will return -EINVAL.
+       */
+      idtype = P_PGID;
+    }
+
+  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..63a3571b8a5 100644
--- a/sysdeps/unix/sysv/linux/waitpid_nocancel.c
+++ b/sysdeps/unix/sysv/linux/waitpid_nocancel.c
@@ -27,8 +27,62 @@ __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)
+    {
+      /* Linux Kernels 5.4+ support pid 0 with P_PGID to specify wait on
+       * the current PID's group. Earlier kernels will return -EINVAL.
+       */
+      idtype = P_PGID;
+    }
+
+  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 related	[flat|nested] 46+ messages in thread

* [RFC v5 05/21] sysdeps/clock_gettime: Use clock_gettime64 if avaliable
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (3 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 04/21] sysdeps/wait: Use waitid " Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-10-29 12:00   ` Lukasz Majewski
  2019-08-29 16:50 ` [RFC v5 06/21] sysdeps/timespec_get: " Alistair Francis
                   ` (16 subsequent siblings)
  21 siblings, 1 reply; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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: Use clock_gettime64 if avaliable.
---
 include/time.h                          |  1 +
 sysdeps/unix/sysv/linux/clock_gettime.c | 48 ++++++++++++++++++++++++-
 2 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/include/time.h b/include/time.h
index 6d81f91384b..1e33f34e1f6 100644
--- a/include/time.h
+++ b/include/time.h
@@ -177,6 +177,7 @@ extern double __difftime (time_t time1, time_t time0);
 #define __clock_nanosleep_time64 __clock_nanosleep
 #define __nanosleep_time64 __nanosleep
 #define __nanosleep_nocancel_time64 __nanosleep_nocancel
+#define __clock_gettime64 __clock_gettime
 #endif
 
 /* Use in the clock_* functions.  Size of the field representing the
diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c
index 5fc47fb7dc7..ea98af9bf1a 100644
--- a/sysdeps/unix/sysv/linux/clock_gettime.c
+++ b/sysdeps/unix/sysv/linux/clock_gettime.c
@@ -28,9 +28,55 @@
 
 /* Get current value of CLOCK and store it in TP.  */
 int
+__clock_gettime64 (clockid_t clock_id, struct timespec *tp)
+{
+#ifdef __ASSUME_TIME64_SYSCALLS
+# ifndef __NR_clock_gettime64
+#  define __NR_clock_gettime64 __NR_clock_gettime
+# endif
+   return INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp);
+#else
+   int ret;
+# ifdef __NR_clock_gettime64
+  ret = INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp);
+
+  if (ret == 0 || errno != ENOSYS)
+    return ret;
+# endif /* __NR_clock_gettime64 */
+  struct timespec tp32;
+
+  ret = INLINE_VSYSCALL (clock_gettime, 2, clock_id, &tp32);
+
+  if (ret == 0 || errno != ENOSYS)
+    valid_timespec_to_timespec64(tp32, tp);
+
+  return ret;
+#endif /* __ASSUME_TIME64_SYSCALLS */
+}
+
+#if __TIMESIZE != 64
+int
 __clock_gettime (clockid_t clock_id, struct timespec *tp)
 {
-  return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp);
+  int ret;
+  struct __timespec64 tp64;
+
+  ret = __clock_gettime64 (clock_id, &tp64);
+
+  if (ret == 0 || errno != ENOSYS)
+    {
+      if (! in_time_t_range (tp64.tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+
+      valid_timespec64_to_timespec(&tp64, tp);
+
+      return ret;
+    }
 }
+#endif
+
 weak_alias (__clock_gettime, clock_gettime)
 libc_hidden_def (__clock_gettime)
-- 
2.22.0


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

* [RFC v5 06/21] sysdeps/timespec_get: Use clock_gettime64 if avaliable
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (4 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 05/21] sysdeps/clock_gettime: Use clock_gettime64 " Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 07/21] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts Alistair Francis
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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: Use clock_gettime64
	if avaliable.
---
 include/time.h                         |  1 +
 sysdeps/unix/sysv/linux/timespec_get.c | 48 ++++++++++++++++++++++++--
 2 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/include/time.h b/include/time.h
index 1e33f34e1f6..ae88eac62d6 100644
--- a/include/time.h
+++ b/include/time.h
@@ -178,6 +178,7 @@ extern double __difftime (time_t time1, time_t time0);
 #define __nanosleep_time64 __nanosleep
 #define __nanosleep_nocancel_time64 __nanosleep_nocancel
 #define __clock_gettime64 __clock_gettime
+#define __timespec_get64 timespec_get
 #endif
 
 /* Use in the clock_* functions.  Size of the field representing the
diff --git a/sysdeps/unix/sysv/linux/timespec_get.c b/sysdeps/unix/sysv/linux/timespec_get.c
index 52080ddf08a..f53e75d5719 100644
--- a/sysdeps/unix/sysv/linux/timespec_get.c
+++ b/sysdeps/unix/sysv/linux/timespec_get.c
@@ -26,16 +26,34 @@
 
 /* Set TS to calendar time based in time base BASE.  */
 int
-timespec_get (struct timespec *ts, int base)
+__timespec_get64 (struct timespec *ts, int base)
 {
   switch (base)
     {
       int res;
       INTERNAL_SYSCALL_DECL (err);
     case TIME_UTC:
-      res = INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, ts);
+#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;
+
+      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;
+        return 0;
       break;
 
     default:
@@ -44,3 +62,27 @@ timespec_get (struct timespec *ts, int base)
 
   return base;
 }
+
+#if __TIMESIZE != 64
+int
+timespec_get (struct timespec *ts, int base)
+{
+  int ret;
+  struct __timespec64 ts64;
+
+  ret = __timespec_get64 (&ts64, base);
+
+  if (ret == 0 || !INTERNAL_SYSCALL_ERROR_P (ret, err))
+    {
+      ts->tv_sec = ts64.tv_sec;
+      ts->tv_nsec = ts64.tv_nsec;
+      if (! in_time_t_range (ts64.tv_sec))
+        {
+          __set_errno (EOVERFLOW);
+          return -1;
+        }
+    }
+
+  return ret;
+}
+#endif
-- 
2.22.0


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

* [RFC v5 07/21] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (5 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 06/21] sysdeps/timespec_get: " Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 08/21] sysdeps/statfs: " Alistair Francis
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

On a 32-bit platform with a 64-bit ino_t type (__INO_T_MATCHES_INO64_T
defined) we want to update the stat struct to remove the padding as it
isn't required. As we don't have the padding we also need to update the
overflow checker to not access the undefined members.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

	* sysdeps/unix/sysv/linux/generic/bits/stat.h: Handle 64-bit ino_t types
	on 32-bit hosts.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h: Likewise.
---
 sysdeps/unix/sysv/linux/generic/bits/stat.h            | 5 ++++-
 sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/generic/bits/stat.h b/sysdeps/unix/sysv/linux/generic/bits/stat.h
index e5c26501047..ddb1e593051 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/stat.h
@@ -40,7 +40,10 @@
 /* Versions of the `xmknod' interface.  */
 #define _MKNOD_VER_LINUX	0
 
-#if defined __USE_FILE_OFFSET64
+#if defined(__USE_FILE_OFFSET64) || __INO_T_MATCHES_INO64_T == 1
+# if __INO_T_MATCHES_INO64_T == 1 && __OFF_T_MATCHES_OFF64_T != 1
+#  error "ino_t and off_t must both be the same type"
+# endif
 # define __field64(type, type64, name) type64 name
 #elif __WORDSIZE == 64
 # define __field64(type, type64, name) type name
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
index 6c17047e4c6..d402d139329 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
@@ -36,12 +36,16 @@ static inline off_t lseek_overflow (loff_t res)
 
 static inline int stat_overflow (struct stat *buf)
 {
+#if defined (__INO_T_MATCHES_INO64_T)
+  return 0;
+#else
   if (buf->__st_ino_pad == 0 && buf->__st_size_pad == 0
       && buf->__st_blocks_pad == 0)
     return 0;
 
   __set_errno (EOVERFLOW);
   return -1;
+#endif
 }
 
 /* Note that f_files and f_ffree may validly be a sign-extended -1.  */
-- 
2.22.0


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

* [RFC v5 08/21] sysdeps/statfs: Handle 64-bit ino_t types on 32-bit hosts
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (6 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 07/21] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 09/21] Documentation for the RISC-V 32-bit port Alistair Francis
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 UTC (permalink / raw)
  To: libc-alpha
  Cc: arnd, adhemerval.zanella, fweimer, palmer, macro, zongbox,
	alistair.francis, alistair23

On a 32-bit platform with a 64-bit ino_t type (__INO_T_MATCHES_INO64_T
defined) we want to update the statfs struct to remove the padding as it
isn't required. As we don't have the padding we also need to update the
overflow checker to not access the undefined members.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

	* sysdeps/unix/sysv/linux/generic/bits/statfs.h: Handle 64-bit ino_t
	types on 32-bit hosts.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h: Likewise.
---
 sysdeps/unix/sysv/linux/generic/bits/statfs.h          | 5 ++++-
 sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/generic/bits/statfs.h b/sysdeps/unix/sysv/linux/generic/bits/statfs.h
index 77de4d2fd00..a22e059ddc6 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/statfs.h
@@ -32,7 +32,10 @@
    using __USE_FILE_OFFSET64 only see the low 32 bits of some
    of the fields (the __fsblkcnt_t and __fsfilcnt_t fields).  */
 
-#if defined __USE_FILE_OFFSET64
+#if defined(__USE_FILE_OFFSET64) || __INO_T_MATCHES_INO64_T == 1
+# if __INO_T_MATCHES_INO64_T == 1 && __OFF_T_MATCHES_OFF64_T != 1
+#  error "ino_t and off_t must both be the same type"
+# endif
 # define __field64(type, type64, name) type64 name
 #elif __WORDSIZE == 64
 # define __field64(type, type64, name) type name
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
index d402d139329..4c2e43f9d67 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
+++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
@@ -51,6 +51,9 @@ static inline int stat_overflow (struct stat *buf)
 /* Note that f_files and f_ffree may validly be a sign-extended -1.  */
 static inline int statfs_overflow (struct statfs *buf)
 {
+#if defined (__INO_T_MATCHES_INO64_T)
+  return 0;
+#else
   if (buf->__f_blocks_pad == 0 && buf->__f_bfree_pad == 0
       && buf->__f_bavail_pad == 0
       && (buf->__f_files_pad == 0
@@ -61,4 +64,5 @@ static inline int statfs_overflow (struct statfs *buf)
 
   __set_errno (EOVERFLOW);
   return -1;
+#endif
 }
-- 
2.22.0


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

* [RFC v5 09/21] Documentation for the RISC-V 32-bit port
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (7 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 08/21] sysdeps/statfs: " Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 10/21] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64 Alistair Francis
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 NEWS   | 6 ++++++
 README | 1 +
 2 files changed, 7 insertions(+)

diff --git a/NEWS b/NEWS
index a64b89986ac..289ff0404ee 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,12 @@ Major new features:
   18661-1:2014 and TS 18661-3:2015 as amended by the resolution of
   Clarification Request 13 to TS 18661-3.
 
+* 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 totalorder and totalordermag functions, and the corresponding
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 related	[flat|nested] 46+ messages in thread

* [RFC v5 10/21] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (8 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 09/21] Documentation for the RISC-V 32-bit port Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 11/21] RISC-V: Define __NR_* as __NR_*_time64/64 for 32-bit Alistair Francis
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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>

	* 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.
	* sysdeps/unix/sysv/linux/riscv/kernel_stat.h: Likewise.
---
 .../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/kernel_stat.h   | 23 +++++
 5 files changed, 250 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
 create mode 100644 sysdeps/unix/sysv/linux/riscv/kernel_stat.h

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 */
diff --git a/sysdeps/unix/sysv/linux/riscv/kernel_stat.h b/sysdeps/unix/sysv/linux/riscv/kernel_stat.h
new file mode 100644
index 00000000000..16a378332bd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/kernel_stat.h
@@ -0,0 +1,23 @@
+/* Copyright (C) 2011-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>
+
+#define STAT_IS_KERNEL_STAT 1
+
+#define XSTAT_IS_XSTAT64 1
+#define STATFS_IS_STATFS64 0
-- 
2.22.0


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

* [RFC v5 11/21] RISC-V: Define __NR_* as __NR_*_time64/64 for 32-bit
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (9 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 10/21] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64 Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 12/21] RISC-V: Use 64-bit timespec in clock_gettime vdso calls Alistair Francis
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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: Define __NR_* as
	__NR_*_time64/64 for 32-bit.
---
 sysdeps/unix/sysv/linux/riscv/sysdep.h | 73 ++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h
index 5470ea3d2a6..169d4152ccd 100644
--- a/sysdeps/unix/sysv/linux/riscv/sysdep.h
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h
@@ -116,6 +116,79 @@
 
 #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
+
+# 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
+
+# ifndef __NR_timerfd_settime
+#  define __NR_timerfd_settime __NR_timerfd_settime64
+# endif
+
+# ifndef __NR_timerfd_gettime
+#  define __NR_timerfd_gettime __NR_timerfd_gettime64
+# endif
+
+# ifndef __NR_sched_rr_get_interval
+#  define __NR_sched_rr_get_interval __NR_sched_rr_get_interval_time64
+# endif
+
+# ifndef __NR_clock_adjtime
+#  define __NR_clock_adjtime __NR_clock_adjtime64
+# endif
+#endif /* __riscv_xlen == 32 */
+
 #undef SYS_ify
 #define SYS_ify(syscall_name)	__NR_##syscall_name
 
-- 
2.22.0


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

* [RFC v5 12/21] RISC-V: Use 64-bit timespec in clock_gettime vdso calls
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (10 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 11/21] RISC-V: Define __NR_* as __NR_*_time64/64 for 32-bit Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 13/21] RISC-V: Support dynamic loader for the 32-bit Alistair Francis
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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: Use 64-bit timespec in
	clock_gettime vdso calls.
	* sysdeps/unix/sysv/linux/riscv/libc-vdso.h: Likewise.
---
 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 related	[flat|nested] 46+ messages in thread

* [RFC v5 13/21] RISC-V: Support dynamic loader for the 32-bit
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (11 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 12/21] RISC-V: Use 64-bit timespec in clock_gettime vdso calls Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 14/21] RISC-V: Add path of library directories for RV32 Alistair Francis
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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.
---
 sysdeps/unix/sysv/linux/riscv/ldconfig.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 related	[flat|nested] 46+ messages in thread

* [RFC v5 14/21] RISC-V: Add path of library directories for RV32
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (12 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 13/21] RISC-V: Support dynamic loader for the 32-bit Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 15/21] RISC-V: The ABI implementation for the 32-bit Alistair Francis
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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>
---
 sysdeps/unix/sysv/linux/riscv/dl-cache.h | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

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 related	[flat|nested] 46+ messages in thread

* [RFC v5 15/21] RISC-V: The ABI implementation for the 32-bit
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (13 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 14/21] RISC-V: Add path of library directories for RV32 Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 16/21] RISC-V: Hard float support for the 32 bit Alistair Francis
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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>
---
 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 +++++++++++++++++++
 5 files changed, 110 insertions(+), 4 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h

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 related	[flat|nested] 46+ messages in thread

* [RFC v5 16/21] RISC-V: Hard float support for the 32 bit
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (14 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 15/21] RISC-V: The ABI implementation for the 32-bit Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 17/21] RISC-V: Add ABI lists Alistair Francis
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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.
---
 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 ++++++++++++++++++++++++++++++
 4 files changed, 124 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/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 related	[flat|nested] 46+ messages in thread

* [RFC v5 17/21] RISC-V: Add ABI lists
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (15 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 16/21] RISC-V: Hard float support for the 32 bit Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 18/21] RISC-V: Build Infastructure for the 32-bit Alistair Francis
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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.
---
 .../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 +
 13 files changed, 3609 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/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 related	[flat|nested] 46+ messages in thread

* [RFC v5 18/21] RISC-V: Build Infastructure for the 32-bit
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (16 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 17/21] RISC-V: Add ABI lists Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 19/21] RISC-V: Fix llrint and llround missing exceptions on RV32 Alistair Francis
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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.
---
 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 ++++-
 9 files changed, 67 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/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 related	[flat|nested] 46+ messages in thread

* [RFC v5 19/21] RISC-V: Fix llrint and llround missing exceptions on RV32
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (17 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 18/21] RISC-V: Build Infastructure for the 32-bit Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 20/21] RISC-V: Use 64-bit vdso syscalls for RV32 Alistair Francis
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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.
---
 .../riscv/rv32/fix-fp-int-convert-overflow.h  | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 sysdeps/riscv/rv32/fix-fp-int-convert-overflow.h

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 related	[flat|nested] 46+ messages in thread

* [RFC v5 20/21] RISC-V: Use 64-bit vdso syscalls for RV32
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (18 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 19/21] RISC-V: Fix llrint and llround missing exceptions on RV32 Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 16:50 ` [RFC v5 21/21] Add RISC-V 32-bit target to build-many-glibcs.py Alistair Francis
  2019-08-29 17:28 ` [RFC v5 00/21] RISC-V glibc port for the 32-bit Joseph Myers
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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: Use 64-bit vdso syscalls
	for RV32
	* sysdeps/unix/sysv/linux/riscv/init-first.c: Likewise.
	* sysdeps/unix/sysv/linux/riscv/libc-vdso.h: Likewise.
---
 sysdeps/unix/sysv/linux/clock_getres.c     |  4 ++++
 sysdeps/unix/sysv/linux/riscv/init-first.c | 19 ++++++++++++-------
 sysdeps/unix/sysv/linux/riscv/libc-vdso.h  |  9 ++++++---
 3 files changed, 22 insertions(+), 10 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..7b7457a7a8b 100644
--- a/sysdeps/unix/sysv/linux/riscv/init-first.c
+++ b/sysdeps/unix/sysv/linux/riscv/init-first.c
@@ -22,12 +22,15 @@
 
 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 *)
+long int (*VDSO_SYMBOL (clock_gettime64)) (clockid_t, struct timespec *)
     attribute_hidden;
+
+#if __riscv_xlen == 64
 long int (*VDSO_SYMBOL (clock_getres)) (clockid_t, struct timespec *)
     attribute_hidden;
+long int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
+    attribute_hidden;
+#endif
 
 static inline void
 _libc_vdso_platform_setup (void)
@@ -38,17 +41,19 @@ _libc_vdso_platform_setup (void)
   PTR_MANGLE (p);
   VDSO_SYMBOL (getcpu) = p;
 
-  p = _dl_vdso_vsym ("__vdso_gettimeofday", &linux_version);
+  p = _dl_vdso_vsym ("__vdso_clock_gettime64", &linux_version);
   PTR_MANGLE (p);
-  VDSO_SYMBOL (gettimeofday) = p;
+  VDSO_SYMBOL (clock_gettime64) = p;
 
-  p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux_version);
+#if __riscv_xlen == 64
+  p = _dl_vdso_vsym ("__vdso_gettimeofday", &linux_version);
   PTR_MANGLE (p);
-  VDSO_SYMBOL (clock_gettime) = 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..3684168df4b 100644
--- a/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
@@ -24,11 +24,14 @@
 
 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 *)
+extern long int (*VDSO_SYMBOL (clock_gettime64)) (clockid_t, struct timespec *)
     attribute_hidden;
+
+#if __riscv_xlen == 64
 extern long int (*VDSO_SYMBOL (clock_getres)) (clockid_t, struct timespec *)
     attribute_hidden;
+extern long int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
+    attribute_hidden;
+#endif
 
 #endif /* _LIBC_VDSO_H */
-- 
2.22.0


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

* [RFC v5 21/21] Add RISC-V 32-bit target to build-many-glibcs.py
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (19 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 20/21] RISC-V: Use 64-bit vdso syscalls for RV32 Alistair Francis
@ 2019-08-29 16:50 ` Alistair Francis
  2019-08-29 17:28 ` [RFC v5 00/21] RISC-V glibc port for the 32-bit Joseph Myers
  21 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 16:50 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.
---
 scripts/build-many-glibcs.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

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 related	[flat|nested] 46+ messages in thread

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-08-29 16:50 ` [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised Alistair Francis
@ 2019-08-29 17:22   ` Joseph Myers
  2019-08-29 17:34     ` Zack Weinberg
  0 siblings, 1 reply; 46+ messages in thread
From: Joseph Myers @ 2019-08-29 17:22 UTC (permalink / raw)
  To: Alistair Francis
  Cc: libc-alpha, arnd, adhemerval.zanella, fweimer, palmer, macro,
	zongbox, alistair23

On Thu, 29 Aug 2019, Alistair Francis wrote:

> 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.

It's glibc practice (although missing from 
<https://sourceware.org/glibc/wiki/Style_and_Conventions>) that we *don't* 
add initializations like that to avoid warnings.  If necessary we may use 
the DIAG_* macros with appropriate comments about why the warning is a 
false positive (sometimes other approaches work to avoid the warnings, 
e.g. use of __builtin_unreachable () calls).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-08-29 16:50 ` [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable Alistair Francis
@ 2019-08-29 17:25   ` Joseph Myers
  2019-08-30 17:40     ` Alistair Francis
  2019-10-14 13:59   ` Lukasz Majewski
  1 sibling, 1 reply; 46+ messages in thread
From: Joseph Myers @ 2019-08-29 17:25 UTC (permalink / raw)
  To: Alistair Francis
  Cc: libc-alpha, arnd, adhemerval.zanella, fweimer, palmer, macro,
	zongbox, alistair23

On Thu, 29 Aug 2019, Alistair Francis wrote:

> +        valid_timespec_to_timespec64(&tr32, remaining);

Missing space before '('.  Likewise elsewhere in this patch (possibly 
elsewhere in the series).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [RFC v5 00/21]  RISC-V glibc port for the 32-bit
  2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
                   ` (20 preceding siblings ...)
  2019-08-29 16:50 ` [RFC v5 21/21] Add RISC-V 32-bit target to build-many-glibcs.py Alistair Francis
@ 2019-08-29 17:28 ` Joseph Myers
  2019-08-29 17:42   ` Alistair Francis
  21 siblings, 1 reply; 46+ messages in thread
From: Joseph Myers @ 2019-08-29 17:28 UTC (permalink / raw)
  To: Alistair Francis
  Cc: libc-alpha, arnd, adhemerval.zanella, fweimer, palmer, macro,
	zongbox, alistair23

On Thu, 29 Aug 2019, Alistair Francis wrote:

> All testing has been done on a 5.3 kernel with these two patches back
> ported from linux-next:
>  - pidfd: add P_PIDFD to waitid()
>  - waitid: Add support for waiting for the current process group
> to fix the waitid() syscall race.
> 
> Issues still to address:
>  - Wait for Lukasz's patche series mentioned above to be merged (2)
>  - Get the RV32 tests running. At the moment the tests are hanging and
>    I'm trying to investigate.
>  - Rebased on the clock_gettime series [4] on list once it is merged.

- Test the patches affecting architecture-independent code in several 
different configurations (for other architectures) that cover the 
time-related variants, as I listed at 
<https://sourceware.org/ml/libc-alpha/2019-08/msg00234.html>, and give the 
details of those variants when submitting the patch series, so we can have 
confidence that the main time-related variants have been tested 
sufficiently.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-08-29 17:22   ` Joseph Myers
@ 2019-08-29 17:34     ` Zack Weinberg
  2019-09-05 14:53       ` Alistair Francis
  0 siblings, 1 reply; 46+ messages in thread
From: Zack Weinberg @ 2019-08-29 17:34 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li, Alistair Francis

On Thu, Aug 29, 2019 at 1:22 PM Joseph Myers <joseph@codesourcery.com> wrote:
> On Thu, 29 Aug 2019, Alistair Francis wrote:
>The long pole is definitely the ml2014 build environment, unless for some reason we need the new version of pip first? I don't actually know.  I'm assu
> > 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.
>
> It's glibc practice (although missing from
> <https://sourceware.org/glibc/wiki/Style_and_Conventions>) that we *don't*
> add initializations like that to avoid warnings.

Although this has historically been glibc practice, I think it is
unwisely incautious, and we should change the policy to be that we
*do* add initializations whenever the compiler thinks a variable even
_might_ be used uninitialized.

zw

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

* Re: [RFC v5 00/21] RISC-V glibc port for the 32-bit
  2019-08-29 17:28 ` [RFC v5 00/21] RISC-V glibc port for the 32-bit Joseph Myers
@ 2019-08-29 17:42   ` Alistair Francis
  0 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-29 17:42 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 29, 2019 at 10:28 AM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 29 Aug 2019, Alistair Francis wrote:
>
> > All testing has been done on a 5.3 kernel with these two patches back
> > ported from linux-next:
> >  - pidfd: add P_PIDFD to waitid()
> >  - waitid: Add support for waiting for the current process group
> > to fix the waitid() syscall race.
> >
> > Issues still to address:
> >  - Wait for Lukasz's patche series mentioned above to be merged (2)
> >  - Get the RV32 tests running. At the moment the tests are hanging and
> >    I'm trying to investigate.
> >  - Rebased on the clock_gettime series [4] on list once it is merged.
>
> - Test the patches affecting architecture-independent code in several
> different configurations (for other architectures) that cover the
> time-related variants, as I listed at
> <https://sourceware.org/ml/libc-alpha/2019-08/msg00234.html>, and give the
> details of those variants when submitting the patch series, so we can have
> confidence that the main time-related variants have been tested
> sufficiently.

Yep!

I have started to build test for multiple platforms, so next will be
runtime testing them all. It's just a much slower process.

Alistair

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

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

* Re: [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-08-29 17:25   ` Joseph Myers
@ 2019-08-30 17:40     ` Alistair Francis
  0 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-08-30 17: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 Thu, Aug 29, 2019 at 10:25 AM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 29 Aug 2019, Alistair Francis wrote:
>
> > +        valid_timespec_to_timespec64(&tr32, remaining);
>
> Missing space before '('.  Likewise elsewhere in this patch (possibly
> elsewhere in the series).

I have fixed this in all of the patches.

Alistair

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

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

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-08-29 17:34     ` Zack Weinberg
@ 2019-09-05 14:53       ` Alistair Francis
  2019-09-05 15:02         ` Joseph Myers
  2019-09-05 15:07         ` Zack Weinberg
  0 siblings, 2 replies; 46+ messages in thread
From: Alistair Francis @ 2019-09-05 14:53 UTC (permalink / raw)
  To: Zack Weinberg
  Cc: Joseph Myers, Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Thu, Aug 29, 2019 at 10:34 AM Zack Weinberg <zackw@panix.com> wrote:
>
> On Thu, Aug 29, 2019 at 1:22 PM Joseph Myers <joseph@codesourcery.com> wrote:
> > On Thu, 29 Aug 2019, Alistair Francis wrote:
> >The long pole is definitely the ml2014 build environment, unless for some reason we need the new version of pip first? I don't actually know.  I'm assu
> > > 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.
> >
> > It's glibc practice (although missing from
> > <https://sourceware.org/glibc/wiki/Style_and_Conventions>) that we *don't*
> > add initializations like that to avoid warnings.
>
> Although this has historically been glibc practice, I think it is
> unwisely incautious, and we should change the policy to be that we
> *do* add initializations whenever the compiler thinks a variable even
> _might_ be used uninitialized.

Does that mean this patch is ok?

Alistair

>
> zw

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

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-09-05 14:53       ` Alistair Francis
@ 2019-09-05 15:02         ` Joseph Myers
  2019-09-05 15:06           ` Jeff Law
                             ` (2 more replies)
  2019-09-05 15:07         ` Zack Weinberg
  1 sibling, 3 replies; 46+ messages in thread
From: Joseph Myers @ 2019-09-05 15:02 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Zack Weinberg, Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Thu, 5 Sep 2019, Alistair Francis wrote:

> On Thu, Aug 29, 2019 at 10:34 AM Zack Weinberg <zackw@panix.com> wrote:
> >
> > On Thu, Aug 29, 2019 at 1:22 PM Joseph Myers <joseph@codesourcery.com> wrote:
> > > On Thu, 29 Aug 2019, Alistair Francis wrote:
> > >The long pole is definitely the ml2014 build environment, unless for some reason we need the new version of pip first? I don't actually know.  I'm assu
> > > > 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.
> > >
> > > It's glibc practice (although missing from
> > > <https://sourceware.org/glibc/wiki/Style_and_Conventions>) that we *don't*
> > > add initializations like that to avoid warnings.
> >
> > Although this has historically been glibc practice, I think it is
> > unwisely incautious, and we should change the policy to be that we
> > *do* add initializations whenever the compiler thinks a variable even
> > _might_ be used uninitialized.
> 
> Does that mean this patch is ok?

No.  You can't deduce consensus like that from two different views on a 
patch or a convention.  Even if we were to change the convention regarding 
how to silence such warnings, I see reason to have any less requirement 
for comments explaining why the warning is a false positive and that the 
initializer is only there to silence a warning than there is for the 
DIAG_* macros.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-09-05 15:02         ` Joseph Myers
@ 2019-09-05 15:06           ` Jeff Law
  2019-09-05 15:21             ` Joseph Myers
  2019-09-05 15:12           ` Zack Weinberg
  2019-09-06  0:46           ` Alistair Francis
  2 siblings, 1 reply; 46+ messages in thread
From: Jeff Law @ 2019-09-05 15:06 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Joseph Myers, Zack Weinberg, Alistair Francis, GNU C Library,
	Arnd Bergmann, Adhemerval Zanella, Florian Weimer, Palmer Dabbelt,
	macro, Zong Li

On 9/5/19 9:02 AM, Joseph Myers wrote:
> On Thu, 5 Sep 2019, Alistair Francis wrote:
> 
>> On Thu, Aug 29, 2019 at 10:34 AM Zack Weinberg <zackw@panix.com> wrote:
>>>
>>> On Thu, Aug 29, 2019 at 1:22 PM Joseph Myers <joseph@codesourcery.com> wrote:
>>>> On Thu, 29 Aug 2019, Alistair Francis wrote:
>>>> The long pole is definitely the ml2014 build environment, unless for some reason we need the new version of pip first? I don't actually know.  I'm assu
>>>>> 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.
>>>>
>>>> It's glibc practice (although missing from
>>>> <https://sourceware.org/glibc/wiki/Style_and_Conventions>) that we *don't*
>>>> add initializations like that to avoid warnings.
>>>
>>> Although this has historically been glibc practice, I think it is
>>> unwisely incautious, and we should change the policy to be that we
>>> *do* add initializations whenever the compiler thinks a variable even
>>> _might_ be used uninitialized.
>>
>> Does that mean this patch is ok?
> 
> No.  You can't deduce consensus like that from two different views on a 
> patch or a convention.  Even if we were to change the convention regarding 
> how to silence such warnings, I see reason to have any less requirement 
> for comments explaining why the warning is a false positive and that the 
> initializer is only there to silence a warning than there is for the 
> DIAG_* macros.
> 
BTW, has a bug been filed against GCC for the bogus warning?

Jeff

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

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-09-05 14:53       ` Alistair Francis
  2019-09-05 15:02         ` Joseph Myers
@ 2019-09-05 15:07         ` Zack Weinberg
  1 sibling, 0 replies; 46+ messages in thread
From: Zack Weinberg @ 2019-09-05 15:07 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

On Thu, Sep 5, 2019 at 10:53 AM Alistair Francis <alistair23@gmail.com> wrote:
> On Thu, Aug 29, 2019 at 10:34 AM Zack Weinberg <zackw@panix.com> wrote:
> > On Thu, Aug 29, 2019 at 1:22 PM Joseph Myers <joseph@codesourcery.com> wrote:
> > > On Thu, 29 Aug 2019, Alistair Francis wrote:
> > >The long pole is definitely the ml2014 build environment, unless for some reason we need the new version of pip first? I don't actually know.  I'm assu
> > > > 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.
> > >
> > > It's glibc practice (although missing from
> > > <https://sourceware.org/glibc/wiki/Style_and_Conventions>) that we *don't*
> > > add initializations like that to avoid warnings.
> >
> > Although this has historically been glibc practice, I think it is
> > unwisely incautious, and we should change the policy to be that we
> > *do* add initializations whenever the compiler thinks a variable even
> > _might_ be used uninitialized.
>
> Does that mean this patch is ok?

I haven't actually looked at your patch, so no, that was not a review.

zw

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

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-09-05 15:02         ` Joseph Myers
  2019-09-05 15:06           ` Jeff Law
@ 2019-09-05 15:12           ` Zack Weinberg
  2019-09-06  0:46           ` Alistair Francis
  2 siblings, 0 replies; 46+ messages in thread
From: Zack Weinberg @ 2019-09-05 15:12 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Thu, Sep 5, 2019 at 11:03 AM Joseph Myers <joseph@codesourcery.com> wrote:
> On Thu, 5 Sep 2019, Alistair Francis wrote:
> > On Thu, Aug 29, 2019 at 10:34 AM Zack Weinberg <zackw@panix.com> wrote:
> > >
> > > On Thu, Aug 29, 2019 at 1:22 PM Joseph Myers <joseph@codesourcery.com> wrote:
> > > > On Thu, 29 Aug 2019, Alistair Francis wrote:
> > > > > 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.
> > > >
> > > > It's glibc practice (although missing from
> > > > <https://sourceware.org/glibc/wiki/Style_and_Conventions>) that we *don't*
> > > > add initializations like that to avoid warnings.
> > >
> > > Although this has historically been glibc practice, I think it is
> > > unwisely incautious, and we should change the policy to be that we
> > > *do* add initializations whenever the compiler thinks a variable even
> > > _might_ be used uninitialized.
> >
> > Does that mean this patch is ok?
>
> No.  You can't deduce consensus like that from two different views on a
> patch or a convention.

Joseph, you have a tendency to throw up procedural objections to
_everything_, and I feel I need to ask you to tone it down a little.
This project has historically been perceived as unwelcoming to new
contributors, and I think a major remaining reason for that is all the
procedure -- some of which is genuinely necessary, but not all.

> Even if we were to change the convention regarding
> how to silence such warnings, I see reason to have any less requirement
> for comments explaining why the warning is a false positive and that the
> initializer is only there to silence a warning than there is for the
> DIAG_* macros.

In general I would agree, but this is the obsolete sunrpc directory
we're talking about; I don't think it's worth putting more than the
bare minimum effort into code that we plan to delete eventually.

zw

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

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-09-05 15:06           ` Jeff Law
@ 2019-09-05 15:21             ` Joseph Myers
  2019-09-05 15:27               ` Jeff Law
  2019-09-06  0:47               ` Alistair Francis
  0 siblings, 2 replies; 46+ messages in thread
From: Joseph Myers @ 2019-09-05 15:21 UTC (permalink / raw)
  To: Jeff Law
  Cc: Alistair Francis, Zack Weinberg, Alistair Francis, GNU C Library,
	Arnd Bergmann, Adhemerval Zanella, Florian Weimer, Palmer Dabbelt,
	macro, Zong Li

On Thu, 5 Sep 2019, Jeff Law wrote:

> BTW, has a bug been filed against GCC for the bogus warning?

In this case, it looks like the code is

  if (xargs != NULL)
    {
       total_deadline = ...
    }

  ...

  if (xargs != NULL)
    {
      use total_deadline
    }

(and xargs doesn't get modified in the function and the various gotos in 
this function are all after that setting of total_deadline).  So that 
should be a known issue (and we could consider if the existing comment

  /* Choose the timeout value.  For non-sending usage (xargs == NULL),
     the total deadline does not matter, only cu->cu_wait is used
     below.  */

is sufficient or should be extended to say explicitly the warning is 
bogus).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-09-05 15:21             ` Joseph Myers
@ 2019-09-05 15:27               ` Jeff Law
  2019-09-06  0:47               ` Alistair Francis
  1 sibling, 0 replies; 46+ messages in thread
From: Jeff Law @ 2019-09-05 15:27 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Alistair Francis, Zack Weinberg, Alistair Francis, GNU C Library,
	Arnd Bergmann, Adhemerval Zanella, Florian Weimer, Palmer Dabbelt,
	macro, Zong Li

On 9/5/19 9:21 AM, Joseph Myers wrote:
> On Thu, 5 Sep 2019, Jeff Law wrote:
> 
>> BTW, has a bug been filed against GCC for the bogus warning?
> 
> In this case, it looks like the code is
> 
>   if (xargs != NULL)
>     {
>        total_deadline = ...
>     }
> 
>   ...
> 
>   if (xargs != NULL)
>     {
>       use total_deadline
>     }
> 
> (and xargs doesn't get modified in the function and the various gotos in 
> this function are all after that setting of total_deadline).  So that 
> should be a known issue (and we could consider if the existing comment
> 
>   /* Choose the timeout value.  For non-sending usage (xargs == NULL),
>      the total deadline does not matter, only cu->cu_wait is used
>      below.  */
> 
> is sufficient or should be extended to say explicitly the warning is 
> bogus).
Right.  My concern is we should be analyzing this on the GCC side.

I can hazard a guess that there's too much code between the two tests
and as a result jump threading isn't deemed profitable enough.  That's
not terribly unusual.

But even so, the uninit pass has predicate analysis which should see the
use as properly guarded.

So ISTM that something isn't behaving properly on the GCC side so we
should get bug report opened so that we can analyze why GCC isn't doing
the right thing here.

jeff

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

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-09-05 15:02         ` Joseph Myers
  2019-09-05 15:06           ` Jeff Law
  2019-09-05 15:12           ` Zack Weinberg
@ 2019-09-06  0:46           ` Alistair Francis
  2019-09-06  1:31             ` Jeff Law
  2 siblings, 1 reply; 46+ messages in thread
From: Alistair Francis @ 2019-09-06  0:46 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Zack Weinberg, Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On Thu, Sep 5, 2019 at 8:02 AM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 5 Sep 2019, Alistair Francis wrote:
>
> > On Thu, Aug 29, 2019 at 10:34 AM Zack Weinberg <zackw@panix.com> wrote:
> > >
> > > On Thu, Aug 29, 2019 at 1:22 PM Joseph Myers <joseph@codesourcery.com> wrote:
> > > > On Thu, 29 Aug 2019, Alistair Francis wrote:
> > > >The long pole is definitely the ml2014 build environment, unless for some reason we need the new version of pip first? I don't actually know.  I'm assu
> > > > > 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.
> > > >
> > > > It's glibc practice (although missing from
> > > > <https://sourceware.org/glibc/wiki/Style_and_Conventions>) that we *don't*
> > > > add initializations like that to avoid warnings.
> > >
> > > Although this has historically been glibc practice, I think it is
> > > unwisely incautious, and we should change the policy to be that we
> > > *do* add initializations whenever the compiler thinks a variable even
> > > _might_ be used uninitialized.
> >
> > Does that mean this patch is ok?
>
> No.  You can't deduce consensus like that from two different views on a
> patch or a convention.  Even if we were to change the convention regarding
> how to silence such warnings, I see reason to have any less requirement
> for comments explaining why the warning is a false positive and that the
> initializer is only there to silence a warning than there is for the
> DIAG_* macros.

No worries, I'll happily change the patch, I just want to make sure I
change it to the right thing.

I'll:
 - Investigate filing a GCC bug for this false positive
 - Add comments to the init explaining why I am setting it
 - Use the DIAG_* macros

Alistair

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

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

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-09-05 15:21             ` Joseph Myers
  2019-09-05 15:27               ` Jeff Law
@ 2019-09-06  0:47               ` Alistair Francis
  1 sibling, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-09-06  0:47 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Jeff Law, Zack Weinberg, Alistair Francis, GNU C Library,
	Arnd Bergmann, Adhemerval Zanella, Florian Weimer, Palmer Dabbelt,
	macro, Zong Li

On Thu, Sep 5, 2019 at 8:22 AM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 5 Sep 2019, Jeff Law wrote:
>
> > BTW, has a bug been filed against GCC for the bogus warning?
>
> In this case, it looks like the code is
>
>   if (xargs != NULL)
>     {
>        total_deadline = ...
>     }
>
>   ...
>
>   if (xargs != NULL)
>     {
>       use total_deadline
>     }
>
> (and xargs doesn't get modified in the function and the various gotos in
> this function are all after that setting of total_deadline).  So that
> should be a known issue (and we could consider if the existing comment

That is my understanding as well.

>
>   /* Choose the timeout value.  For non-sending usage (xargs == NULL),
>      the total deadline does not matter, only cu->cu_wait is used
>      below.  */
>
> is sufficient or should be extended to say explicitly the warning is
> bogus).

I was planning on adding a comment in the next version, let me know otherwise.

Alistair

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

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

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-09-06  0:46           ` Alistair Francis
@ 2019-09-06  1:31             ` Jeff Law
  2019-09-16 21:36               ` Alistair Francis
  0 siblings, 1 reply; 46+ messages in thread
From: Jeff Law @ 2019-09-06  1:31 UTC (permalink / raw)
  To: Alistair Francis, Joseph Myers
  Cc: Zack Weinberg, Alistair Francis, GNU C Library, Arnd Bergmann,
	Adhemerval Zanella, Florian Weimer, Palmer Dabbelt, macro,
	Zong Li

On 9/5/19 6:46 PM, Alistair Francis wrote:
> On Thu, Sep 5, 2019 at 8:02 AM Joseph Myers <joseph@codesourcery.com> wrote:
>>
>> On Thu, 5 Sep 2019, Alistair Francis wrote:
>>
>>> On Thu, Aug 29, 2019 at 10:34 AM Zack Weinberg <zackw@panix.com> wrote:
>>>>
>>>> On Thu, Aug 29, 2019 at 1:22 PM Joseph Myers <joseph@codesourcery.com> wrote:
>>>>> On Thu, 29 Aug 2019, Alistair Francis wrote:
>>>>> The long pole is definitely the ml2014 build environment, unless for some reason we need the new version of pip first? I don't actually know.  I'm assu
>>>>>> 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.
>>>>>
>>>>> It's glibc practice (although missing from
>>>>> <https://sourceware.org/glibc/wiki/Style_and_Conventions>) that we *don't*
>>>>> add initializations like that to avoid warnings.
>>>>
>>>> Although this has historically been glibc practice, I think it is
>>>> unwisely incautious, and we should change the policy to be that we
>>>> *do* add initializations whenever the compiler thinks a variable even
>>>> _might_ be used uninitialized.
>>>
>>> Does that mean this patch is ok?
>>
>> No.  You can't deduce consensus like that from two different views on a
>> patch or a convention.  Even if we were to change the convention regarding
>> how to silence such warnings, I see reason to have any less requirement
>> for comments explaining why the warning is a false positive and that the
>> initializer is only there to silence a warning than there is for the
>> DIAG_* macros.
> 
> No worries, I'll happily change the patch, I just want to make sure I
> change it to the right thing.
> 
> I'll:
>  - Investigate filing a GCC bug for this false positive
All we need is the .i file (Add -save-temps to the compilation line), a
copy of the full compilation line and the target triplet.  No need to
try and create a minimal testcase or anything like that.

Jeff

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

* Re: [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised
  2019-09-06  1:31             ` Jeff Law
@ 2019-09-16 21:36               ` Alistair Francis
  0 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-09-16 21:36 UTC (permalink / raw)
  To: Jeff Law
  Cc: Joseph Myers, Zack Weinberg, Alistair Francis, GNU C Library,
	Arnd Bergmann, Adhemerval Zanella, Florian Weimer, Palmer Dabbelt,
	macro, Zong Li

On Thu, Sep 5, 2019 at 6:31 PM Jeff Law <law@redhat.com> wrote:
>
> On 9/5/19 6:46 PM, Alistair Francis wrote:
> > On Thu, Sep 5, 2019 at 8:02 AM Joseph Myers <joseph@codesourcery.com> wrote:
> >>
> >> On Thu, 5 Sep 2019, Alistair Francis wrote:
> >>
> >>> On Thu, Aug 29, 2019 at 10:34 AM Zack Weinberg <zackw@panix.com> wrote:
> >>>>
> >>>> On Thu, Aug 29, 2019 at 1:22 PM Joseph Myers <joseph@codesourcery.com> wrote:
> >>>>> On Thu, 29 Aug 2019, Alistair Francis wrote:
> >>>>> The long pole is definitely the ml2014 build environment, unless for some reason we need the new version of pip first? I don't actually know.  I'm assu
> >>>>>> 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.
> >>>>>
> >>>>> It's glibc practice (although missing from
> >>>>> <https://sourceware.org/glibc/wiki/Style_and_Conventions>) that we *don't*
> >>>>> add initializations like that to avoid warnings.
> >>>>
> >>>> Although this has historically been glibc practice, I think it is
> >>>> unwisely incautious, and we should change the policy to be that we
> >>>> *do* add initializations whenever the compiler thinks a variable even
> >>>> _might_ be used uninitialized.
> >>>
> >>> Does that mean this patch is ok?
> >>
> >> No.  You can't deduce consensus like that from two different views on a
> >> patch or a convention.  Even if we were to change the convention regarding
> >> how to silence such warnings, I see reason to have any less requirement
> >> for comments explaining why the warning is a false positive and that the
> >> initializer is only there to silence a warning than there is for the
> >> DIAG_* macros.
> >
> > No worries, I'll happily change the patch, I just want to make sure I
> > change it to the right thing.
> >
> > I'll:
> >  - Investigate filing a GCC bug for this false positive
> All we need is the .i file (Add -save-temps to the compilation line), a
> copy of the full compilation line and the target triplet.  No need to
> try and create a minimal testcase or anything like that.

Thanks for that info. I have filed the bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91691

I'll send this patch out separately and we can go from there.

Alistair

>
> Jeff

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

* Re: [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-08-29 16:50 ` [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable Alistair Francis
  2019-08-29 17:25   ` Joseph Myers
@ 2019-10-14 13:59   ` Lukasz Majewski
  2019-10-15  0:06     ` Alistair Francis
  1 sibling, 1 reply; 46+ messages in thread
From: Lukasz Majewski @ 2019-10-14 13:59 UTC (permalink / raw)
  To: Alistair Francis
  Cc: libc-alpha, arnd, adhemerval.zanella, palmer, macro, zongbox,
	alistair23, Joseph Myers, Adhemerval Zanella, Florian Weimer,
	Zack Weinberg

[-- Attachment #1: Type: text/plain, Size: 13941 bytes --]

Hi Alistair,

> 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()"
> 
> Signed-off-by: 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/clock_nanosleep.c: Likewise.
> 	* sysdeps/unix/sysv/linux/nanosleep_nocancel.c: Likewise.
> ---
>  include/time.h                               |  6 ++
>  nptl/thrd_sleep.c                            | 69 ++++++++++++++++--
>  sysdeps/unix/sysv/linux/clock_nanosleep.c    | 74
> ++++++++++++++++++-- sysdeps/unix/sysv/linux/nanosleep.c          |
> 65 ++++++++++++++++- sysdeps/unix/sysv/linux/nanosleep_nocancel.c |
> 64 ++++++++++++++++- 5 files changed, 264 insertions(+), 14
> deletions(-)
> 
> diff --git a/include/time.h b/include/time.h
> index 95b31429212..6d81f91384b 100644
> --- a/include/time.h
> +++ b/include/time.h
> @@ -172,6 +172,12 @@ libc_hidden_proto (__difftime64)
>  
>  extern double __difftime (time_t time1, time_t time0);
>  
> +#if __TIMESIZE == 64
> +#define __thrd_sleep_time64 thrd_sleep
> +#define __clock_nanosleep_time64 __clock_nanosleep
> +#define __nanosleep_time64 __nanosleep
> +#define __nanosleep_nocancel_time64 __nanosleep_nocancel
> +#endif
>  
>  /* Use in the clock_* functions.  Size of the field representing the
>     actual clock ID.  */
> diff --git a/nptl/thrd_sleep.c b/nptl/thrd_sleep.c
> index 07a51808df2..e85da561c68 100644
> --- a/nptl/thrd_sleep.c
> +++ b/nptl/thrd_sleep.c
> @@ -22,18 +22,79 @@
>  #include "thrd_priv.h"
>  
>  int
> -thrd_sleep (const struct timespec* time_point, struct timespec*
> remaining) +__thrd_sleep_time64 (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
> +# ifndef __NR_clock_nanosleep_time64
> +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> +# endif
> +  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> CLOCK_REALTIME,
> +                                 0, time_point, remaining);
> +#else
> +# ifdef __NR_clock_nanosleep_time64
> +  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;
> +# endif /* __NR_clock_nanosleep_time64 */
> +  if (ret < 0)
> +    {
> +      struct timespec tp32, tr32;
> +
> +      if (! in_time_t_range (time_point->tv_sec))
> +        {
> +          __set_errno (EOVERFLOW);
> +          return -1;
> +        }
> +
> +      valid_timespec64_to_timespec (time_point, &tp32);
> +      ret =  INTERNAL_SYSCALL_CANCEL (nanosleep, err, &tp32, &tr32);
> +
> +      if ((ret == 0 || errno != ENOSYS) && remaining)
> +        valid_timespec_to_timespec64(&tr32, remaining);
> +    }
> +#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;
>  }
> +
> +#if __TIMESIZE != 64
> +int
> +thrd_sleep (const struct timespec* time_point, struct timespec*
> remaining) +{
> +  int ret;
> +  timespec64 tp64, tr64;
> +
> +  valid_timespec_to_timespec64(time_point, &tp64);
> +  ret = __thrd_sleep_time64 (&tp64, &tr64);
> +
> +  if (ret == 0 || errno != ENOSYS)
> +    {
> +      if (! in_time_t_range (tr64->tv_sec))
> +        {
> +          __set_errno (EOVERFLOW);
> +          return -1;
> +        }
> +
> +      if (remaining)
> +        valid_timespec64_to_timespec(&tr32, remaining);
> +    }
> +
> +  return ret;
> +}
> +#endif

This code seems to follow the pattern introduced in clock_settime()
conversion (already in the -master branch).

Do you plan to send this and the following patches:

https://patchwork.ozlabs.org/patch/1155396/    --> clock_gettime
https://patchwork.ozlabs.org/patch/1155398/    --> timespec_get

As a separate patch series so we can all benefit from having them in
the -master glibc branch?
Those patches seems to be orthogonal to ones adding support for RISC-V.


The gettimeofday() syscall handling code seems to being now converted to
clock_gettime() in the glibc (or at least there is some ongoing effort):

https://sourceware.org/git/?p=glibc.git;a=commit;h=b30d257ea8f557bdadca09f5b112538e7b807eb9

Similar situation is with stat and statfs (which are now under the
discussion/review):

https://patchwork.ozlabs.org/patch/1155399/    --> stat
https://patchwork.ozlabs.org/patch/1155401/    --> statfs

> diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c
> b/sysdeps/unix/sysv/linux/clock_nanosleep.c index
> 0cb6614dc92..64302fbcc69 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)
> +__clock_nanosleep_time64 (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,9 +37,70 @@ __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
> +# ifndef __NR_clock_nanosleep_time64
> +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> +# endif
> +  r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, clock_id,
> +                               flags, req, rem);
> +#else
> +# ifdef __NR_clock_nanosleep_time64
> +  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;
> +# endif /* __NR_clock_nanosleep_time64 */
> +  if (r < 0)
> +    {
> +      struct timespec ts32, tr32;
> +
> +      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)
> +        valid_timespec_to_timespec64(&tr32, rem);
> +    }
> +#endif /* __ASSUME_TIME64_SYSCALLS */
> +
>    return (INTERNAL_SYSCALL_ERROR_P (r, err)
> -	  ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
> +          ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
>  }
> +
> +#if __TIMESIZE != 64
> +int
> +__clock_nanosleep (clockid_t clock_id, int flags, const struct
> timespec *req,
> +                   struct timespec *rem)
> +{
> +  int r;
> +  timespec64 treq64, trem64;
> +
> +  valid_timespec_to_timespec64(req, &treq64)
> +  r = __clock_nanosleep_time64 (clock_id, flags, &treq64, &trem64);
> +
> +  if (r == 0 || errno != ENOSYS)
> +    {
> +      if (! in_time_t_range (trem64->tv_sec))
> +        {
> +          __set_errno (EOVERFLOW);
> +          return -1;
> +        }
> +
> +      if (remaining)
> +        valid_timespec64_to_timespec(&tr32, remaining);
> +    }
> +
> +  return r;
> +}
> +#endif
> +
>  weak_alias (__clock_nanosleep, clock_nanosleep)
> diff --git a/sysdeps/unix/sysv/linux/nanosleep.c
> b/sysdeps/unix/sysv/linux/nanosleep.c index f14ae565af5..9a8dd5a4b82
> 100644 --- a/sysdeps/unix/sysv/linux/nanosleep.c
> +++ b/sysdeps/unix/sysv/linux/nanosleep.c
> @@ -22,10 +22,71 @@
>  
>  /* Pause execution for a number of nanoseconds.  */
>  int
> +__nanosleep_time64 (const struct timespec *requested_time,
> +                    struct timespec *remaining)
> +{
> +#if defined(__ASSUME_TIME64_SYSCALLS)
> +# ifndef __NR_clock_nanosleep_time64
> +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> +# endif
> +  return SYSCALL_CANCEL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
> +                         requested_time, remaining);
> +#else
> +# ifdef __NR_clock_nanosleep_time64
> +  long int ret_64;
> +
> +  ret_64 = SYSCALL_CANCEL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
> +                           requested_time, remaining);
> +
> +  if (ret_64 == 0 || errno != ENOSYS)
> +    return ret_64;
> +# endif /* __NR_clock_nanosleep_time64 */
> +  int ret;
> +  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)
> +    valid_timespec_to_timespec64(&tr32, remaining);
> +
> +  return ret;
> +#endif /* __ASSUME_TIME64_SYSCALLS */
> +}
> +
> +#if __TIMESIZE != 64
> +int
>  __nanosleep (const struct timespec *requested_time,
> -	     struct timespec *remaining)
> +             struct timespec *remaining)
>  {
> -  return SYSCALL_CANCEL (nanosleep, requested_time, remaining);
> +  int r;
> +  timespec64 treq64, trem64;
> +
> +
> +  valid_timespec_to_timespec64(req, &treq64);
> +  r = __nanosleep_time64 (&treq64, &trem64);
> +
> +  if (r == 0 || errno != ENOSYS)
> +    {
> +      if (! in_time_t_range (trem64->tv_sec))
> +        {
> +          __set_errno (EOVERFLOW);
> +          return -1;
> +        }
> +
> +      if (remaining)
> +        valid_timespec64_to_timespec(&tr32, remaining);
> +    }
> +
> +  return r;
>  }
> +#endif
> +
>  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..03f5be2ff9e 100644 ---
> a/sysdeps/unix/sysv/linux/nanosleep_nocancel.c +++
> b/sysdeps/unix/sysv/linux/nanosleep_nocancel.c @@ -20,10 +20,70 @@
>  #include <sysdep-cancel.h>
>  #include <not-cancel.h>
>  
> +int
> +__nanosleep_nocancel_time64 (const struct timespec *requested_time,
> +                             struct timespec *remaining)
> +{
> +#ifdef __ASSUME_TIME64_SYSCALLS
> +# ifndef __NR_clock_nanosleep_time64
> +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> +# endif
> +  return INLINE_SYSCALL_CALL (clock_nanosleep_time64,
> CLOCK_REALTIME, 0,
> +                              requested_time, remaining);
> +#else
> +# ifdef __NR_clock_nanosleep_time64
> +  long int ret_64;
> +
> +  ret_64 = INLINE_SYSCALL_CALL (clock_nanosleep_time64,
> CLOCK_REALTIME, 0,
> +                                requested_time, remaining);
> +
> +  if (ret_64 == 0 || errno != ENOSYS)
> +    return ret_64;
> +# endif /* __NR_clock_nanosleep_time64 */
> +  int ret;
> +  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)
> +    valid_timespec_to_timespec64(&tr32, remaining);
> +
> +  return ret;
> +#endif /* __ASSUME_TIME64_SYSCALLS */
> +}
> +
> +#if __TIMESIZE != 64
>  int
>  __nanosleep_nocancel (const struct timespec *requested_time,
> -		      struct timespec *remaining)
> +                      struct timespec *remaining)
>  {
> -  return INLINE_SYSCALL_CALL (nanosleep, requested_time, remaining);
> +  int ret;
> +  timespec64 treq64, trem64;
> +
> +  valid_timespec_to_timespec64(req, &treq64)
> +  ret = __nanosleep_nocancel_time64 (&treq64, &trem64);
> +
> +  if (ret == 0 || errno != ENOSYS)
> +    {
> +      if (! in_time_t_range (trem64->tv_sec))
> +        {
> +          __set_errno (EOVERFLOW);
> +          return -1;
> +        }
> +
> +      if (remaining)
> +        valid_timespec64_to_timespec(&tr32, remaining);
> +    }
> +
> +  return ret;
>  }
> +#endif
> +
>  hidden_def (__nanosleep_nocancel)




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-10-14 13:59   ` Lukasz Majewski
@ 2019-10-15  0:06     ` Alistair Francis
  2019-10-15 15:54       ` Lukasz Majewski
  0 siblings, 1 reply; 46+ messages in thread
From: Alistair Francis @ 2019-10-15  0:06 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann, Palmer Dabbelt,
	Maciej W. Rozycki, Zong Li, Joseph Myers, Adhemerval Zanella,
	Florian Weimer, Zack Weinberg

On Mon, Oct 14, 2019 at 7:00 AM Lukasz Majewski <lukma@denx.de> wrote:
>
> Hi Alistair,
>
> > 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()"
> >
> > Signed-off-by: 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/clock_nanosleep.c: Likewise.
> >       * sysdeps/unix/sysv/linux/nanosleep_nocancel.c: Likewise.
> > ---
> >  include/time.h                               |  6 ++
> >  nptl/thrd_sleep.c                            | 69 ++++++++++++++++--
> >  sysdeps/unix/sysv/linux/clock_nanosleep.c    | 74
> > ++++++++++++++++++-- sysdeps/unix/sysv/linux/nanosleep.c          |
> > 65 ++++++++++++++++- sysdeps/unix/sysv/linux/nanosleep_nocancel.c |
> > 64 ++++++++++++++++- 5 files changed, 264 insertions(+), 14
> > deletions(-)
> >
> > diff --git a/include/time.h b/include/time.h
> > index 95b31429212..6d81f91384b 100644
> > --- a/include/time.h
> > +++ b/include/time.h
> > @@ -172,6 +172,12 @@ libc_hidden_proto (__difftime64)
> >
> >  extern double __difftime (time_t time1, time_t time0);
> >
> > +#if __TIMESIZE == 64
> > +#define __thrd_sleep_time64 thrd_sleep
> > +#define __clock_nanosleep_time64 __clock_nanosleep
> > +#define __nanosleep_time64 __nanosleep
> > +#define __nanosleep_nocancel_time64 __nanosleep_nocancel
> > +#endif
> >
> >  /* Use in the clock_* functions.  Size of the field representing the
> >     actual clock ID.  */
> > diff --git a/nptl/thrd_sleep.c b/nptl/thrd_sleep.c
> > index 07a51808df2..e85da561c68 100644
> > --- a/nptl/thrd_sleep.c
> > +++ b/nptl/thrd_sleep.c
> > @@ -22,18 +22,79 @@
> >  #include "thrd_priv.h"
> >
> >  int
> > -thrd_sleep (const struct timespec* time_point, struct timespec*
> > remaining) +__thrd_sleep_time64 (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
> > +# ifndef __NR_clock_nanosleep_time64
> > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > +# endif
> > +  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> > CLOCK_REALTIME,
> > +                                 0, time_point, remaining);
> > +#else
> > +# ifdef __NR_clock_nanosleep_time64
> > +  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;
> > +# endif /* __NR_clock_nanosleep_time64 */
> > +  if (ret < 0)
> > +    {
> > +      struct timespec tp32, tr32;
> > +
> > +      if (! in_time_t_range (time_point->tv_sec))
> > +        {
> > +          __set_errno (EOVERFLOW);
> > +          return -1;
> > +        }
> > +
> > +      valid_timespec64_to_timespec (time_point, &tp32);
> > +      ret =  INTERNAL_SYSCALL_CANCEL (nanosleep, err, &tp32, &tr32);
> > +
> > +      if ((ret == 0 || errno != ENOSYS) && remaining)
> > +        valid_timespec_to_timespec64(&tr32, remaining);
> > +    }
> > +#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;
> >  }
> > +
> > +#if __TIMESIZE != 64
> > +int
> > +thrd_sleep (const struct timespec* time_point, struct timespec*
> > remaining) +{
> > +  int ret;
> > +  timespec64 tp64, tr64;
> > +
> > +  valid_timespec_to_timespec64(time_point, &tp64);
> > +  ret = __thrd_sleep_time64 (&tp64, &tr64);
> > +
> > +  if (ret == 0 || errno != ENOSYS)
> > +    {
> > +      if (! in_time_t_range (tr64->tv_sec))
> > +        {
> > +          __set_errno (EOVERFLOW);
> > +          return -1;
> > +        }
> > +
> > +      if (remaining)
> > +        valid_timespec64_to_timespec(&tr32, remaining);
> > +    }
> > +
> > +  return ret;
> > +}
> > +#endif
>
> This code seems to follow the pattern introduced in clock_settime()
> conversion (already in the -master branch).

I hope so :)

>
> Do you plan to send this and the following patches:
>
> https://patchwork.ozlabs.org/patch/1155396/    --> clock_gettime
> https://patchwork.ozlabs.org/patch/1155398/    --> timespec_get

Yes

>
> As a separate patch series so we can all benefit from having them in
> the -master glibc branch?
> Those patches seems to be orthogonal to ones adding support for RISC-V.

Yep! My plan is to send them seperatley. I have been working through
the RV32 tree sending patches in small batches to get them merged. I
have a few more batches before I get to these time64_t conversion
patches though. I am unfortunately seeing failures with my time64_t
conversion patches which I haven't had a chance to look into.

>
>
> The gettimeofday() syscall handling code seems to being now converted to
> clock_gettime() in the glibc (or at least there is some ongoing effort):
>
> https://sourceware.org/git/?p=glibc.git;a=commit;h=b30d257ea8f557bdadca09f5b112538e7b807eb9

Yep, I have rebased all of my work on top of this.

>
> Similar situation is with stat and statfs (which are now under the
> discussion/review):
>
> https://patchwork.ozlabs.org/patch/1155399/    --> stat
> https://patchwork.ozlabs.org/patch/1155401/    --> statfs

Yep, I'm working on the next version right now.

If you want you are welcome to split out any patches and get them
upstreaed. Even just fixing failing test cases would speed things up.
My branch is available here:
https://github.com/alistair23/glibc/commits/alistair/rv32.next

Alistair

>
> > diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c
> > b/sysdeps/unix/sysv/linux/clock_nanosleep.c index
> > 0cb6614dc92..64302fbcc69 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)
> > +__clock_nanosleep_time64 (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,9 +37,70 @@ __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
> > +# ifndef __NR_clock_nanosleep_time64
> > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > +# endif
> > +  r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, clock_id,
> > +                               flags, req, rem);
> > +#else
> > +# ifdef __NR_clock_nanosleep_time64
> > +  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;
> > +# endif /* __NR_clock_nanosleep_time64 */
> > +  if (r < 0)
> > +    {
> > +      struct timespec ts32, tr32;
> > +
> > +      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)
> > +        valid_timespec_to_timespec64(&tr32, rem);
> > +    }
> > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > +
> >    return (INTERNAL_SYSCALL_ERROR_P (r, err)
> > -       ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
> > +          ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
> >  }
> > +
> > +#if __TIMESIZE != 64
> > +int
> > +__clock_nanosleep (clockid_t clock_id, int flags, const struct
> > timespec *req,
> > +                   struct timespec *rem)
> > +{
> > +  int r;
> > +  timespec64 treq64, trem64;
> > +
> > +  valid_timespec_to_timespec64(req, &treq64)
> > +  r = __clock_nanosleep_time64 (clock_id, flags, &treq64, &trem64);
> > +
> > +  if (r == 0 || errno != ENOSYS)
> > +    {
> > +      if (! in_time_t_range (trem64->tv_sec))
> > +        {
> > +          __set_errno (EOVERFLOW);
> > +          return -1;
> > +        }
> > +
> > +      if (remaining)
> > +        valid_timespec64_to_timespec(&tr32, remaining);
> > +    }
> > +
> > +  return r;
> > +}
> > +#endif
> > +
> >  weak_alias (__clock_nanosleep, clock_nanosleep)
> > diff --git a/sysdeps/unix/sysv/linux/nanosleep.c
> > b/sysdeps/unix/sysv/linux/nanosleep.c index f14ae565af5..9a8dd5a4b82
> > 100644 --- a/sysdeps/unix/sysv/linux/nanosleep.c
> > +++ b/sysdeps/unix/sysv/linux/nanosleep.c
> > @@ -22,10 +22,71 @@
> >
> >  /* Pause execution for a number of nanoseconds.  */
> >  int
> > +__nanosleep_time64 (const struct timespec *requested_time,
> > +                    struct timespec *remaining)
> > +{
> > +#if defined(__ASSUME_TIME64_SYSCALLS)
> > +# ifndef __NR_clock_nanosleep_time64
> > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > +# endif
> > +  return SYSCALL_CANCEL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
> > +                         requested_time, remaining);
> > +#else
> > +# ifdef __NR_clock_nanosleep_time64
> > +  long int ret_64;
> > +
> > +  ret_64 = SYSCALL_CANCEL (clock_nanosleep_time64, CLOCK_REALTIME, 0,
> > +                           requested_time, remaining);
> > +
> > +  if (ret_64 == 0 || errno != ENOSYS)
> > +    return ret_64;
> > +# endif /* __NR_clock_nanosleep_time64 */
> > +  int ret;
> > +  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)
> > +    valid_timespec_to_timespec64(&tr32, remaining);
> > +
> > +  return ret;
> > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > +}
> > +
> > +#if __TIMESIZE != 64
> > +int
> >  __nanosleep (const struct timespec *requested_time,
> > -          struct timespec *remaining)
> > +             struct timespec *remaining)
> >  {
> > -  return SYSCALL_CANCEL (nanosleep, requested_time, remaining);
> > +  int r;
> > +  timespec64 treq64, trem64;
> > +
> > +
> > +  valid_timespec_to_timespec64(req, &treq64);
> > +  r = __nanosleep_time64 (&treq64, &trem64);
> > +
> > +  if (r == 0 || errno != ENOSYS)
> > +    {
> > +      if (! in_time_t_range (trem64->tv_sec))
> > +        {
> > +          __set_errno (EOVERFLOW);
> > +          return -1;
> > +        }
> > +
> > +      if (remaining)
> > +        valid_timespec64_to_timespec(&tr32, remaining);
> > +    }
> > +
> > +  return r;
> >  }
> > +#endif
> > +
> >  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..03f5be2ff9e 100644 ---
> > a/sysdeps/unix/sysv/linux/nanosleep_nocancel.c +++
> > b/sysdeps/unix/sysv/linux/nanosleep_nocancel.c @@ -20,10 +20,70 @@
> >  #include <sysdep-cancel.h>
> >  #include <not-cancel.h>
> >
> > +int
> > +__nanosleep_nocancel_time64 (const struct timespec *requested_time,
> > +                             struct timespec *remaining)
> > +{
> > +#ifdef __ASSUME_TIME64_SYSCALLS
> > +# ifndef __NR_clock_nanosleep_time64
> > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > +# endif
> > +  return INLINE_SYSCALL_CALL (clock_nanosleep_time64,
> > CLOCK_REALTIME, 0,
> > +                              requested_time, remaining);
> > +#else
> > +# ifdef __NR_clock_nanosleep_time64
> > +  long int ret_64;
> > +
> > +  ret_64 = INLINE_SYSCALL_CALL (clock_nanosleep_time64,
> > CLOCK_REALTIME, 0,
> > +                                requested_time, remaining);
> > +
> > +  if (ret_64 == 0 || errno != ENOSYS)
> > +    return ret_64;
> > +# endif /* __NR_clock_nanosleep_time64 */
> > +  int ret;
> > +  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)
> > +    valid_timespec_to_timespec64(&tr32, remaining);
> > +
> > +  return ret;
> > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > +}
> > +
> > +#if __TIMESIZE != 64
> >  int
> >  __nanosleep_nocancel (const struct timespec *requested_time,
> > -                   struct timespec *remaining)
> > +                      struct timespec *remaining)
> >  {
> > -  return INLINE_SYSCALL_CALL (nanosleep, requested_time, remaining);
> > +  int ret;
> > +  timespec64 treq64, trem64;
> > +
> > +  valid_timespec_to_timespec64(req, &treq64)
> > +  ret = __nanosleep_nocancel_time64 (&treq64, &trem64);
> > +
> > +  if (ret == 0 || errno != ENOSYS)
> > +    {
> > +      if (! in_time_t_range (trem64->tv_sec))
> > +        {
> > +          __set_errno (EOVERFLOW);
> > +          return -1;
> > +        }
> > +
> > +      if (remaining)
> > +        valid_timespec64_to_timespec(&tr32, remaining);
> > +    }
> > +
> > +  return ret;
> >  }
> > +#endif
> > +
> >  hidden_def (__nanosleep_nocancel)
>
>
>
>
> Best regards,
>
> Lukasz Majewski
>
> --
>
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

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

* Re: [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-10-15  0:06     ` Alistair Francis
@ 2019-10-15 15:54       ` Lukasz Majewski
  2019-10-15 22:28         ` Alistair Francis
  0 siblings, 1 reply; 46+ messages in thread
From: Lukasz Majewski @ 2019-10-15 15:54 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann, Palmer Dabbelt,
	Maciej W. Rozycki, Zong Li, Joseph Myers, Adhemerval Zanella,
	Florian Weimer, Zack Weinberg

[-- Attachment #1: Type: text/plain, Size: 18015 bytes --]

Hi Alistair,

> On Mon, Oct 14, 2019 at 7:00 AM Lukasz Majewski <lukma@denx.de> wrote:
> >
> > Hi Alistair,
> >  
> > > 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()"
> > >
> > > Signed-off-by: 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/clock_nanosleep.c: Likewise.
> > >       * sysdeps/unix/sysv/linux/nanosleep_nocancel.c: Likewise.
> > > ---
> > >  include/time.h                               |  6 ++
> > >  nptl/thrd_sleep.c                            | 69
> > > ++++++++++++++++-- sysdeps/unix/sysv/linux/clock_nanosleep.c    |
> > > 74 ++++++++++++++++++-- sysdeps/unix/sysv/linux/nanosleep.c
> > >    | 65 ++++++++++++++++-
> > > sysdeps/unix/sysv/linux/nanosleep_nocancel.c | 64
> > > ++++++++++++++++- 5 files changed, 264 insertions(+), 14
> > > deletions(-)
> > >
> > > diff --git a/include/time.h b/include/time.h
> > > index 95b31429212..6d81f91384b 100644
> > > --- a/include/time.h
> > > +++ b/include/time.h
> > > @@ -172,6 +172,12 @@ libc_hidden_proto (__difftime64)
> > >
> > >  extern double __difftime (time_t time1, time_t time0);
> > >
> > > +#if __TIMESIZE == 64
> > > +#define __thrd_sleep_time64 thrd_sleep
> > > +#define __clock_nanosleep_time64 __clock_nanosleep
> > > +#define __nanosleep_time64 __nanosleep
> > > +#define __nanosleep_nocancel_time64 __nanosleep_nocancel
> > > +#endif
> > >
> > >  /* Use in the clock_* functions.  Size of the field representing
> > > the actual clock ID.  */
> > > diff --git a/nptl/thrd_sleep.c b/nptl/thrd_sleep.c
> > > index 07a51808df2..e85da561c68 100644
> > > --- a/nptl/thrd_sleep.c
> > > +++ b/nptl/thrd_sleep.c
> > > @@ -22,18 +22,79 @@
> > >  #include "thrd_priv.h"
> > >
> > >  int
> > > -thrd_sleep (const struct timespec* time_point, struct timespec*
> > > remaining) +__thrd_sleep_time64 (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
> > > +# ifndef __NR_clock_nanosleep_time64
> > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > +# endif
> > > +  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> > > CLOCK_REALTIME,
> > > +                                 0, time_point, remaining);
> > > +#else
> > > +# ifdef __NR_clock_nanosleep_time64
> > > +  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;
> > > +# endif /* __NR_clock_nanosleep_time64 */
> > > +  if (ret < 0)
> > > +    {
> > > +      struct timespec tp32, tr32;
> > > +
> > > +      if (! in_time_t_range (time_point->tv_sec))
> > > +        {
> > > +          __set_errno (EOVERFLOW);
> > > +          return -1;
> > > +        }
> > > +
> > > +      valid_timespec64_to_timespec (time_point, &tp32);
> > > +      ret =  INTERNAL_SYSCALL_CANCEL (nanosleep, err, &tp32,
> > > &tr32); +
> > > +      if ((ret == 0 || errno != ENOSYS) && remaining)
> > > +        valid_timespec_to_timespec64(&tr32, remaining);
> > > +    }
> > > +#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;
> > >  }
> > > +
> > > +#if __TIMESIZE != 64
> > > +int
> > > +thrd_sleep (const struct timespec* time_point, struct timespec*
> > > remaining) +{
> > > +  int ret;
> > > +  timespec64 tp64, tr64;
> > > +
> > > +  valid_timespec_to_timespec64(time_point, &tp64);
> > > +  ret = __thrd_sleep_time64 (&tp64, &tr64);
> > > +
> > > +  if (ret == 0 || errno != ENOSYS)
> > > +    {
> > > +      if (! in_time_t_range (tr64->tv_sec))
> > > +        {
> > > +          __set_errno (EOVERFLOW);
> > > +          return -1;
> > > +        }
> > > +
> > > +      if (remaining)
> > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > +    }
> > > +
> > > +  return ret;
> > > +}
> > > +#endif  
> >
> > This code seems to follow the pattern introduced in clock_settime()
> > conversion (already in the -master branch).  
> 
> I hope so :)
> 
> >
> > Do you plan to send this and the following patches:
> >
> > https://patchwork.ozlabs.org/patch/1155396/    --> clock_gettime
> > https://patchwork.ozlabs.org/patch/1155398/    --> timespec_get  
> 
> Yes
> 
> >
> > As a separate patch series so we can all benefit from having them in
> > the -master glibc branch?
> > Those patches seems to be orthogonal to ones adding support for
> > RISC-V.  
> 
> Yep! My plan is to send them seperatley. I have been working through
> the RV32 tree sending patches in small batches to get them merged. I
> have a few more batches before I get to these time64_t conversion
> patches though. I am unfortunately seeing failures with my time64_t
> conversion patches which I haven't had a chance to look into.
> 
> >
> >
> > The gettimeofday() syscall handling code seems to being now
> > converted to clock_gettime() in the glibc (or at least there is
> > some ongoing effort):
> >
> > https://sourceware.org/git/?p=glibc.git;a=commit;h=b30d257ea8f557bdadca09f5b112538e7b807eb9
> >  
> 
> Yep, I have rebased all of my work on top of this.
> 
> >
> > Similar situation is with stat and statfs (which are now under the
> > discussion/review):
> >
> > https://patchwork.ozlabs.org/patch/1155399/    --> stat
> > https://patchwork.ozlabs.org/patch/1155401/    --> statfs  
> 
> Yep, I'm working on the next version right now.
> 
> If you want you are welcome to split out any patches and get them
> upstreaed. Even just fixing failing test cases would speed things up.
> My branch is available here:
> https://github.com/alistair23/glibc/commits/alistair/rv32.next
> 

Please find some comments and my future work plan:

1. The "sysdeps/clock_getres: Use inline syscall if required" :
https://github.com/alistair23/glibc/commit/830707a4a3f662b1a97860afe658f6bbd9731d13
commit does not convert this syscall.

However, I can convert and post to the glibc alpha the __clock_getres64
(as I already have some older code available). I'm now working on
preparing proper patch.


2. Potential compilation error for SoCs with TIMESIZE != 64:
https://github.com/alistair23/glibc/commit/4309573e10479516fcdf75c353309497f8017c90#diff-85643011757f36e12ca60b37c3e8ec0dR75


3. Would you be so kind and post (to glibc alpha) the already converted
(in your -next tree) __clock_nanosleep64:
https://github.com/alistair23/glibc/commit/9e3d95ad1f70909a787dd11fbc735bcafa02050e#diff-5b9f1c6457e0e10079f657f283c19861R177

Just one remark - please in include/time.h use the following paradigm:
https://github.com/lmajewski/y2038_glibc/commit/7ff615859f9e111c0c4cf8a6c085201c7ed82813#diff-5b9f1c6457e0e10079f657f283c19861R128

for redirection.


> Alistair
> 
> >  
> > > diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c
> > > b/sysdeps/unix/sysv/linux/clock_nanosleep.c index
> > > 0cb6614dc92..64302fbcc69 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)
> > > +__clock_nanosleep_time64 (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,9 +37,70 @@ __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
> > > +# ifndef __NR_clock_nanosleep_time64
> > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > +# endif
> > > +  r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> > > clock_id,
> > > +                               flags, req, rem);
> > > +#else
> > > +# ifdef __NR_clock_nanosleep_time64
> > > +  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;
> > > +# endif /* __NR_clock_nanosleep_time64 */
> > > +  if (r < 0)
> > > +    {
> > > +      struct timespec ts32, tr32;
> > > +
> > > +      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)
> > > +        valid_timespec_to_timespec64(&tr32, rem);
> > > +    }
> > > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > > +
> > >    return (INTERNAL_SYSCALL_ERROR_P (r, err)
> > > -       ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
> > > +          ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
> > >  }
> > > +
> > > +#if __TIMESIZE != 64
> > > +int
> > > +__clock_nanosleep (clockid_t clock_id, int flags, const struct
> > > timespec *req,
> > > +                   struct timespec *rem)
> > > +{
> > > +  int r;
> > > +  timespec64 treq64, trem64;
> > > +
> > > +  valid_timespec_to_timespec64(req, &treq64)
> > > +  r = __clock_nanosleep_time64 (clock_id, flags, &treq64,
> > > &trem64); +
> > > +  if (r == 0 || errno != ENOSYS)
> > > +    {
> > > +      if (! in_time_t_range (trem64->tv_sec))
> > > +        {
> > > +          __set_errno (EOVERFLOW);
> > > +          return -1;
> > > +        }
> > > +
> > > +      if (remaining)
> > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > +    }
> > > +
> > > +  return r;
> > > +}
> > > +#endif
> > > +
> > >  weak_alias (__clock_nanosleep, clock_nanosleep)
> > > diff --git a/sysdeps/unix/sysv/linux/nanosleep.c
> > > b/sysdeps/unix/sysv/linux/nanosleep.c index
> > > f14ae565af5..9a8dd5a4b82 100644 ---
> > > a/sysdeps/unix/sysv/linux/nanosleep.c +++
> > > b/sysdeps/unix/sysv/linux/nanosleep.c @@ -22,10 +22,71 @@
> > >
> > >  /* Pause execution for a number of nanoseconds.  */
> > >  int
> > > +__nanosleep_time64 (const struct timespec *requested_time,
> > > +                    struct timespec *remaining)
> > > +{
> > > +#if defined(__ASSUME_TIME64_SYSCALLS)
> > > +# ifndef __NR_clock_nanosleep_time64
> > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > +# endif
> > > +  return SYSCALL_CANCEL (clock_nanosleep_time64, CLOCK_REALTIME,
> > > 0,
> > > +                         requested_time, remaining);
> > > +#else
> > > +# ifdef __NR_clock_nanosleep_time64
> > > +  long int ret_64;
> > > +
> > > +  ret_64 = SYSCALL_CANCEL (clock_nanosleep_time64,
> > > CLOCK_REALTIME, 0,
> > > +                           requested_time, remaining);
> > > +
> > > +  if (ret_64 == 0 || errno != ENOSYS)
> > > +    return ret_64;
> > > +# endif /* __NR_clock_nanosleep_time64 */
> > > +  int ret;
> > > +  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)
> > > +    valid_timespec_to_timespec64(&tr32, remaining);
> > > +
> > > +  return ret;
> > > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > > +}
> > > +
> > > +#if __TIMESIZE != 64
> > > +int
> > >  __nanosleep (const struct timespec *requested_time,
> > > -          struct timespec *remaining)
> > > +             struct timespec *remaining)
> > >  {
> > > -  return SYSCALL_CANCEL (nanosleep, requested_time, remaining);
> > > +  int r;
> > > +  timespec64 treq64, trem64;
> > > +
> > > +
> > > +  valid_timespec_to_timespec64(req, &treq64);
> > > +  r = __nanosleep_time64 (&treq64, &trem64);
> > > +
> > > +  if (r == 0 || errno != ENOSYS)
> > > +    {
> > > +      if (! in_time_t_range (trem64->tv_sec))
> > > +        {
> > > +          __set_errno (EOVERFLOW);
> > > +          return -1;
> > > +        }
> > > +
> > > +      if (remaining)
> > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > +    }
> > > +
> > > +  return r;
> > >  }
> > > +#endif
> > > +
> > >  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..03f5be2ff9e 100644 ---
> > > a/sysdeps/unix/sysv/linux/nanosleep_nocancel.c +++
> > > b/sysdeps/unix/sysv/linux/nanosleep_nocancel.c @@ -20,10 +20,70 @@
> > >  #include <sysdep-cancel.h>
> > >  #include <not-cancel.h>
> > >
> > > +int
> > > +__nanosleep_nocancel_time64 (const struct timespec
> > > *requested_time,
> > > +                             struct timespec *remaining)
> > > +{
> > > +#ifdef __ASSUME_TIME64_SYSCALLS
> > > +# ifndef __NR_clock_nanosleep_time64
> > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > +# endif
> > > +  return INLINE_SYSCALL_CALL (clock_nanosleep_time64,
> > > CLOCK_REALTIME, 0,
> > > +                              requested_time, remaining);
> > > +#else
> > > +# ifdef __NR_clock_nanosleep_time64
> > > +  long int ret_64;
> > > +
> > > +  ret_64 = INLINE_SYSCALL_CALL (clock_nanosleep_time64,
> > > CLOCK_REALTIME, 0,
> > > +                                requested_time, remaining);
> > > +
> > > +  if (ret_64 == 0 || errno != ENOSYS)
> > > +    return ret_64;
> > > +# endif /* __NR_clock_nanosleep_time64 */
> > > +  int ret;
> > > +  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)
> > > +    valid_timespec_to_timespec64(&tr32, remaining);
> > > +
> > > +  return ret;
> > > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > > +}
> > > +
> > > +#if __TIMESIZE != 64
> > >  int
> > >  __nanosleep_nocancel (const struct timespec *requested_time,
> > > -                   struct timespec *remaining)
> > > +                      struct timespec *remaining)
> > >  {
> > > -  return INLINE_SYSCALL_CALL (nanosleep, requested_time,
> > > remaining);
> > > +  int ret;
> > > +  timespec64 treq64, trem64;
> > > +
> > > +  valid_timespec_to_timespec64(req, &treq64)
> > > +  ret = __nanosleep_nocancel_time64 (&treq64, &trem64);
> > > +
> > > +  if (ret == 0 || errno != ENOSYS)
> > > +    {
> > > +      if (! in_time_t_range (trem64->tv_sec))
> > > +        {
> > > +          __set_errno (EOVERFLOW);
> > > +          return -1;
> > > +        }
> > > +
> > > +      if (remaining)
> > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > +    }
> > > +
> > > +  return ret;
> > >  }
> > > +#endif
> > > +
> > >  hidden_def (__nanosleep_nocancel)  
> >
> >
> >
> >
> > Best regards,
> >
> > Lukasz Majewski
> >
> > --
> >
> > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > lukma@denx.de  




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-10-15 15:54       ` Lukasz Majewski
@ 2019-10-15 22:28         ` Alistair Francis
  2019-10-16 23:42           ` Alistair Francis
  0 siblings, 1 reply; 46+ messages in thread
From: Alistair Francis @ 2019-10-15 22:28 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann, Palmer Dabbelt,
	Maciej W. Rozycki, Zong Li, Joseph Myers, Adhemerval Zanella,
	Florian Weimer, Zack Weinberg

On Tue, Oct 15, 2019 at 8:55 AM Lukasz Majewski <lukma@denx.de> wrote:
>
> Hi Alistair,
>
> > On Mon, Oct 14, 2019 at 7:00 AM Lukasz Majewski <lukma@denx.de> wrote:
> > >
> > > Hi Alistair,
> > >
> > > > 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()"
> > > >
> > > > Signed-off-by: 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/clock_nanosleep.c: Likewise.
> > > >       * sysdeps/unix/sysv/linux/nanosleep_nocancel.c: Likewise.
> > > > ---
> > > >  include/time.h                               |  6 ++
> > > >  nptl/thrd_sleep.c                            | 69
> > > > ++++++++++++++++-- sysdeps/unix/sysv/linux/clock_nanosleep.c    |
> > > > 74 ++++++++++++++++++-- sysdeps/unix/sysv/linux/nanosleep.c
> > > >    | 65 ++++++++++++++++-
> > > > sysdeps/unix/sysv/linux/nanosleep_nocancel.c | 64
> > > > ++++++++++++++++- 5 files changed, 264 insertions(+), 14
> > > > deletions(-)
> > > >
> > > > diff --git a/include/time.h b/include/time.h
> > > > index 95b31429212..6d81f91384b 100644
> > > > --- a/include/time.h
> > > > +++ b/include/time.h
> > > > @@ -172,6 +172,12 @@ libc_hidden_proto (__difftime64)
> > > >
> > > >  extern double __difftime (time_t time1, time_t time0);
> > > >
> > > > +#if __TIMESIZE == 64
> > > > +#define __thrd_sleep_time64 thrd_sleep
> > > > +#define __clock_nanosleep_time64 __clock_nanosleep
> > > > +#define __nanosleep_time64 __nanosleep
> > > > +#define __nanosleep_nocancel_time64 __nanosleep_nocancel
> > > > +#endif
> > > >
> > > >  /* Use in the clock_* functions.  Size of the field representing
> > > > the actual clock ID.  */
> > > > diff --git a/nptl/thrd_sleep.c b/nptl/thrd_sleep.c
> > > > index 07a51808df2..e85da561c68 100644
> > > > --- a/nptl/thrd_sleep.c
> > > > +++ b/nptl/thrd_sleep.c
> > > > @@ -22,18 +22,79 @@
> > > >  #include "thrd_priv.h"
> > > >
> > > >  int
> > > > -thrd_sleep (const struct timespec* time_point, struct timespec*
> > > > remaining) +__thrd_sleep_time64 (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
> > > > +# ifndef __NR_clock_nanosleep_time64
> > > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > > +# endif
> > > > +  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> > > > CLOCK_REALTIME,
> > > > +                                 0, time_point, remaining);
> > > > +#else
> > > > +# ifdef __NR_clock_nanosleep_time64
> > > > +  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;
> > > > +# endif /* __NR_clock_nanosleep_time64 */
> > > > +  if (ret < 0)
> > > > +    {
> > > > +      struct timespec tp32, tr32;
> > > > +
> > > > +      if (! in_time_t_range (time_point->tv_sec))
> > > > +        {
> > > > +          __set_errno (EOVERFLOW);
> > > > +          return -1;
> > > > +        }
> > > > +
> > > > +      valid_timespec64_to_timespec (time_point, &tp32);
> > > > +      ret =  INTERNAL_SYSCALL_CANCEL (nanosleep, err, &tp32,
> > > > &tr32); +
> > > > +      if ((ret == 0 || errno != ENOSYS) && remaining)
> > > > +        valid_timespec_to_timespec64(&tr32, remaining);
> > > > +    }
> > > > +#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;
> > > >  }
> > > > +
> > > > +#if __TIMESIZE != 64
> > > > +int
> > > > +thrd_sleep (const struct timespec* time_point, struct timespec*
> > > > remaining) +{
> > > > +  int ret;
> > > > +  timespec64 tp64, tr64;
> > > > +
> > > > +  valid_timespec_to_timespec64(time_point, &tp64);
> > > > +  ret = __thrd_sleep_time64 (&tp64, &tr64);
> > > > +
> > > > +  if (ret == 0 || errno != ENOSYS)
> > > > +    {
> > > > +      if (! in_time_t_range (tr64->tv_sec))
> > > > +        {
> > > > +          __set_errno (EOVERFLOW);
> > > > +          return -1;
> > > > +        }
> > > > +
> > > > +      if (remaining)
> > > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > > +    }
> > > > +
> > > > +  return ret;
> > > > +}
> > > > +#endif
> > >
> > > This code seems to follow the pattern introduced in clock_settime()
> > > conversion (already in the -master branch).
> >
> > I hope so :)
> >
> > >
> > > Do you plan to send this and the following patches:
> > >
> > > https://patchwork.ozlabs.org/patch/1155396/    --> clock_gettime
> > > https://patchwork.ozlabs.org/patch/1155398/    --> timespec_get
> >
> > Yes
> >
> > >
> > > As a separate patch series so we can all benefit from having them in
> > > the -master glibc branch?
> > > Those patches seems to be orthogonal to ones adding support for
> > > RISC-V.
> >
> > Yep! My plan is to send them seperatley. I have been working through
> > the RV32 tree sending patches in small batches to get them merged. I
> > have a few more batches before I get to these time64_t conversion
> > patches though. I am unfortunately seeing failures with my time64_t
> > conversion patches which I haven't had a chance to look into.
> >
> > >
> > >
> > > The gettimeofday() syscall handling code seems to being now
> > > converted to clock_gettime() in the glibc (or at least there is
> > > some ongoing effort):
> > >
> > > https://sourceware.org/git/?p=glibc.git;a=commit;h=b30d257ea8f557bdadca09f5b112538e7b807eb9
> > >
> >
> > Yep, I have rebased all of my work on top of this.
> >
> > >
> > > Similar situation is with stat and statfs (which are now under the
> > > discussion/review):
> > >
> > > https://patchwork.ozlabs.org/patch/1155399/    --> stat
> > > https://patchwork.ozlabs.org/patch/1155401/    --> statfs
> >
> > Yep, I'm working on the next version right now.
> >
> > If you want you are welcome to split out any patches and get them
> > upstreaed. Even just fixing failing test cases would speed things up.
> > My branch is available here:
> > https://github.com/alistair23/glibc/commits/alistair/rv32.next
> >
>
> Please find some comments and my future work plan:
>
> 1. The "sysdeps/clock_getres: Use inline syscall if required" :
> https://github.com/alistair23/glibc/commit/830707a4a3f662b1a97860afe658f6bbd9731d13
> commit does not convert this syscall.
>
> However, I can convert and post to the glibc alpha the __clock_getres64
> (as I already have some older code available). I'm now working on
> preparing proper patch.

Go for it! :)

>
>
> 2. Potential compilation error for SoCs with TIMESIZE != 64:
> https://github.com/alistair23/glibc/commit/4309573e10479516fcdf75c353309497f8017c90#diff-85643011757f36e12ca60b37c3e8ec0dR75

What is the error?

>
>
> 3. Would you be so kind and post (to glibc alpha) the already converted
> (in your -next tree) __clock_nanosleep64:
> https://github.com/alistair23/glibc/commit/9e3d95ad1f70909a787dd11fbc735bcafa02050e#diff-5b9f1c6457e0e10079f657f283c19861R177

This patch is causing build failures, so I need to investigate that.

>
> Just one remark - please in include/time.h use the following paradigm:
> https://github.com/lmajewski/y2038_glibc/commit/7ff615859f9e111c0c4cf8a6c085201c7ed82813#diff-5b9f1c6457e0e10079f657f283c19861R128

Ok, I'll add this.

Alistair

>
> for redirection.
>
>
> > Alistair
> >
> > >
> > > > diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c
> > > > b/sysdeps/unix/sysv/linux/clock_nanosleep.c index
> > > > 0cb6614dc92..64302fbcc69 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)
> > > > +__clock_nanosleep_time64 (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,9 +37,70 @@ __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
> > > > +# ifndef __NR_clock_nanosleep_time64
> > > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > > +# endif
> > > > +  r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> > > > clock_id,
> > > > +                               flags, req, rem);
> > > > +#else
> > > > +# ifdef __NR_clock_nanosleep_time64
> > > > +  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;
> > > > +# endif /* __NR_clock_nanosleep_time64 */
> > > > +  if (r < 0)
> > > > +    {
> > > > +      struct timespec ts32, tr32;
> > > > +
> > > > +      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)
> > > > +        valid_timespec_to_timespec64(&tr32, rem);
> > > > +    }
> > > > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > > > +
> > > >    return (INTERNAL_SYSCALL_ERROR_P (r, err)
> > > > -       ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
> > > > +          ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
> > > >  }
> > > > +
> > > > +#if __TIMESIZE != 64
> > > > +int
> > > > +__clock_nanosleep (clockid_t clock_id, int flags, const struct
> > > > timespec *req,
> > > > +                   struct timespec *rem)
> > > > +{
> > > > +  int r;
> > > > +  timespec64 treq64, trem64;
> > > > +
> > > > +  valid_timespec_to_timespec64(req, &treq64)
> > > > +  r = __clock_nanosleep_time64 (clock_id, flags, &treq64,
> > > > &trem64); +
> > > > +  if (r == 0 || errno != ENOSYS)
> > > > +    {
> > > > +      if (! in_time_t_range (trem64->tv_sec))
> > > > +        {
> > > > +          __set_errno (EOVERFLOW);
> > > > +          return -1;
> > > > +        }
> > > > +
> > > > +      if (remaining)
> > > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > > +    }
> > > > +
> > > > +  return r;
> > > > +}
> > > > +#endif
> > > > +
> > > >  weak_alias (__clock_nanosleep, clock_nanosleep)
> > > > diff --git a/sysdeps/unix/sysv/linux/nanosleep.c
> > > > b/sysdeps/unix/sysv/linux/nanosleep.c index
> > > > f14ae565af5..9a8dd5a4b82 100644 ---
> > > > a/sysdeps/unix/sysv/linux/nanosleep.c +++
> > > > b/sysdeps/unix/sysv/linux/nanosleep.c @@ -22,10 +22,71 @@
> > > >
> > > >  /* Pause execution for a number of nanoseconds.  */
> > > >  int
> > > > +__nanosleep_time64 (const struct timespec *requested_time,
> > > > +                    struct timespec *remaining)
> > > > +{
> > > > +#if defined(__ASSUME_TIME64_SYSCALLS)
> > > > +# ifndef __NR_clock_nanosleep_time64
> > > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > > +# endif
> > > > +  return SYSCALL_CANCEL (clock_nanosleep_time64, CLOCK_REALTIME,
> > > > 0,
> > > > +                         requested_time, remaining);
> > > > +#else
> > > > +# ifdef __NR_clock_nanosleep_time64
> > > > +  long int ret_64;
> > > > +
> > > > +  ret_64 = SYSCALL_CANCEL (clock_nanosleep_time64,
> > > > CLOCK_REALTIME, 0,
> > > > +                           requested_time, remaining);
> > > > +
> > > > +  if (ret_64 == 0 || errno != ENOSYS)
> > > > +    return ret_64;
> > > > +# endif /* __NR_clock_nanosleep_time64 */
> > > > +  int ret;
> > > > +  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)
> > > > +    valid_timespec_to_timespec64(&tr32, remaining);
> > > > +
> > > > +  return ret;
> > > > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > > > +}
> > > > +
> > > > +#if __TIMESIZE != 64
> > > > +int
> > > >  __nanosleep (const struct timespec *requested_time,
> > > > -          struct timespec *remaining)
> > > > +             struct timespec *remaining)
> > > >  {
> > > > -  return SYSCALL_CANCEL (nanosleep, requested_time, remaining);
> > > > +  int r;
> > > > +  timespec64 treq64, trem64;
> > > > +
> > > > +
> > > > +  valid_timespec_to_timespec64(req, &treq64);
> > > > +  r = __nanosleep_time64 (&treq64, &trem64);
> > > > +
> > > > +  if (r == 0 || errno != ENOSYS)
> > > > +    {
> > > > +      if (! in_time_t_range (trem64->tv_sec))
> > > > +        {
> > > > +          __set_errno (EOVERFLOW);
> > > > +          return -1;
> > > > +        }
> > > > +
> > > > +      if (remaining)
> > > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > > +    }
> > > > +
> > > > +  return r;
> > > >  }
> > > > +#endif
> > > > +
> > > >  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..03f5be2ff9e 100644 ---
> > > > a/sysdeps/unix/sysv/linux/nanosleep_nocancel.c +++
> > > > b/sysdeps/unix/sysv/linux/nanosleep_nocancel.c @@ -20,10 +20,70 @@
> > > >  #include <sysdep-cancel.h>
> > > >  #include <not-cancel.h>
> > > >
> > > > +int
> > > > +__nanosleep_nocancel_time64 (const struct timespec
> > > > *requested_time,
> > > > +                             struct timespec *remaining)
> > > > +{
> > > > +#ifdef __ASSUME_TIME64_SYSCALLS
> > > > +# ifndef __NR_clock_nanosleep_time64
> > > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > > +# endif
> > > > +  return INLINE_SYSCALL_CALL (clock_nanosleep_time64,
> > > > CLOCK_REALTIME, 0,
> > > > +                              requested_time, remaining);
> > > > +#else
> > > > +# ifdef __NR_clock_nanosleep_time64
> > > > +  long int ret_64;
> > > > +
> > > > +  ret_64 = INLINE_SYSCALL_CALL (clock_nanosleep_time64,
> > > > CLOCK_REALTIME, 0,
> > > > +                                requested_time, remaining);
> > > > +
> > > > +  if (ret_64 == 0 || errno != ENOSYS)
> > > > +    return ret_64;
> > > > +# endif /* __NR_clock_nanosleep_time64 */
> > > > +  int ret;
> > > > +  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)
> > > > +    valid_timespec_to_timespec64(&tr32, remaining);
> > > > +
> > > > +  return ret;
> > > > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > > > +}
> > > > +
> > > > +#if __TIMESIZE != 64
> > > >  int
> > > >  __nanosleep_nocancel (const struct timespec *requested_time,
> > > > -                   struct timespec *remaining)
> > > > +                      struct timespec *remaining)
> > > >  {
> > > > -  return INLINE_SYSCALL_CALL (nanosleep, requested_time,
> > > > remaining);
> > > > +  int ret;
> > > > +  timespec64 treq64, trem64;
> > > > +
> > > > +  valid_timespec_to_timespec64(req, &treq64)
> > > > +  ret = __nanosleep_nocancel_time64 (&treq64, &trem64);
> > > > +
> > > > +  if (ret == 0 || errno != ENOSYS)
> > > > +    {
> > > > +      if (! in_time_t_range (trem64->tv_sec))
> > > > +        {
> > > > +          __set_errno (EOVERFLOW);
> > > > +          return -1;
> > > > +        }
> > > > +
> > > > +      if (remaining)
> > > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > > +    }
> > > > +
> > > > +  return ret;
> > > >  }
> > > > +#endif
> > > > +
> > > >  hidden_def (__nanosleep_nocancel)
> > >
> > >
> > >
> > >
> > > Best regards,
> > >
> > > Lukasz Majewski
> > >
> > > --
> > >
> > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > > lukma@denx.de
>
>
>
>
> Best regards,
>
> Lukasz Majewski
>
> --
>
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

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

* Re: [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-10-15 22:28         ` Alistair Francis
@ 2019-10-16 23:42           ` Alistair Francis
  2019-10-17  0:08             ` Alistair Francis
  0 siblings, 1 reply; 46+ messages in thread
From: Alistair Francis @ 2019-10-16 23:42 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann, Palmer Dabbelt,
	Maciej W. Rozycki, Zong Li, Joseph Myers, Adhemerval Zanella,
	Florian Weimer, Zack Weinberg

On Tue, Oct 15, 2019 at 3:28 PM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Tue, Oct 15, 2019 at 8:55 AM Lukasz Majewski <lukma@denx.de> wrote:
> >
> > Hi Alistair,
> >
> > > On Mon, Oct 14, 2019 at 7:00 AM Lukasz Majewski <lukma@denx.de> wrote:
> > > >
> > > > Hi Alistair,
> > > >
> > > > > 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()"
> > > > >
> > > > > Signed-off-by: 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/clock_nanosleep.c: Likewise.
> > > > >       * sysdeps/unix/sysv/linux/nanosleep_nocancel.c: Likewise.
> > > > > ---
> > > > >  include/time.h                               |  6 ++
> > > > >  nptl/thrd_sleep.c                            | 69
> > > > > ++++++++++++++++-- sysdeps/unix/sysv/linux/clock_nanosleep.c    |
> > > > > 74 ++++++++++++++++++-- sysdeps/unix/sysv/linux/nanosleep.c
> > > > >    | 65 ++++++++++++++++-
> > > > > sysdeps/unix/sysv/linux/nanosleep_nocancel.c | 64
> > > > > ++++++++++++++++- 5 files changed, 264 insertions(+), 14
> > > > > deletions(-)
> > > > >
> > > > > diff --git a/include/time.h b/include/time.h
> > > > > index 95b31429212..6d81f91384b 100644
> > > > > --- a/include/time.h
> > > > > +++ b/include/time.h
> > > > > @@ -172,6 +172,12 @@ libc_hidden_proto (__difftime64)
> > > > >
> > > > >  extern double __difftime (time_t time1, time_t time0);
> > > > >
> > > > > +#if __TIMESIZE == 64
> > > > > +#define __thrd_sleep_time64 thrd_sleep
> > > > > +#define __clock_nanosleep_time64 __clock_nanosleep
> > > > > +#define __nanosleep_time64 __nanosleep
> > > > > +#define __nanosleep_nocancel_time64 __nanosleep_nocancel
> > > > > +#endif
> > > > >
> > > > >  /* Use in the clock_* functions.  Size of the field representing
> > > > > the actual clock ID.  */
> > > > > diff --git a/nptl/thrd_sleep.c b/nptl/thrd_sleep.c
> > > > > index 07a51808df2..e85da561c68 100644
> > > > > --- a/nptl/thrd_sleep.c
> > > > > +++ b/nptl/thrd_sleep.c
> > > > > @@ -22,18 +22,79 @@
> > > > >  #include "thrd_priv.h"
> > > > >
> > > > >  int
> > > > > -thrd_sleep (const struct timespec* time_point, struct timespec*
> > > > > remaining) +__thrd_sleep_time64 (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
> > > > > +# ifndef __NR_clock_nanosleep_time64
> > > > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > > > +# endif
> > > > > +  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> > > > > CLOCK_REALTIME,
> > > > > +                                 0, time_point, remaining);
> > > > > +#else
> > > > > +# ifdef __NR_clock_nanosleep_time64
> > > > > +  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;
> > > > > +# endif /* __NR_clock_nanosleep_time64 */
> > > > > +  if (ret < 0)
> > > > > +    {
> > > > > +      struct timespec tp32, tr32;
> > > > > +
> > > > > +      if (! in_time_t_range (time_point->tv_sec))
> > > > > +        {
> > > > > +          __set_errno (EOVERFLOW);
> > > > > +          return -1;
> > > > > +        }
> > > > > +
> > > > > +      valid_timespec64_to_timespec (time_point, &tp32);
> > > > > +      ret =  INTERNAL_SYSCALL_CANCEL (nanosleep, err, &tp32,
> > > > > &tr32); +
> > > > > +      if ((ret == 0 || errno != ENOSYS) && remaining)
> > > > > +        valid_timespec_to_timespec64(&tr32, remaining);
> > > > > +    }
> > > > > +#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;
> > > > >  }
> > > > > +
> > > > > +#if __TIMESIZE != 64
> > > > > +int
> > > > > +thrd_sleep (const struct timespec* time_point, struct timespec*
> > > > > remaining) +{
> > > > > +  int ret;
> > > > > +  timespec64 tp64, tr64;
> > > > > +
> > > > > +  valid_timespec_to_timespec64(time_point, &tp64);
> > > > > +  ret = __thrd_sleep_time64 (&tp64, &tr64);
> > > > > +
> > > > > +  if (ret == 0 || errno != ENOSYS)
> > > > > +    {
> > > > > +      if (! in_time_t_range (tr64->tv_sec))
> > > > > +        {
> > > > > +          __set_errno (EOVERFLOW);
> > > > > +          return -1;
> > > > > +        }
> > > > > +
> > > > > +      if (remaining)
> > > > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > > > +    }
> > > > > +
> > > > > +  return ret;
> > > > > +}
> > > > > +#endif
> > > >
> > > > This code seems to follow the pattern introduced in clock_settime()
> > > > conversion (already in the -master branch).
> > >
> > > I hope so :)
> > >
> > > >
> > > > Do you plan to send this and the following patches:
> > > >
> > > > https://patchwork.ozlabs.org/patch/1155396/    --> clock_gettime
> > > > https://patchwork.ozlabs.org/patch/1155398/    --> timespec_get
> > >
> > > Yes
> > >
> > > >
> > > > As a separate patch series so we can all benefit from having them in
> > > > the -master glibc branch?
> > > > Those patches seems to be orthogonal to ones adding support for
> > > > RISC-V.
> > >
> > > Yep! My plan is to send them seperatley. I have been working through
> > > the RV32 tree sending patches in small batches to get them merged. I
> > > have a few more batches before I get to these time64_t conversion
> > > patches though. I am unfortunately seeing failures with my time64_t
> > > conversion patches which I haven't had a chance to look into.
> > >
> > > >
> > > >
> > > > The gettimeofday() syscall handling code seems to being now
> > > > converted to clock_gettime() in the glibc (or at least there is
> > > > some ongoing effort):
> > > >
> > > > https://sourceware.org/git/?p=glibc.git;a=commit;h=b30d257ea8f557bdadca09f5b112538e7b807eb9
> > > >
> > >
> > > Yep, I have rebased all of my work on top of this.
> > >
> > > >
> > > > Similar situation is with stat and statfs (which are now under the
> > > > discussion/review):
> > > >
> > > > https://patchwork.ozlabs.org/patch/1155399/    --> stat
> > > > https://patchwork.ozlabs.org/patch/1155401/    --> statfs
> > >
> > > Yep, I'm working on the next version right now.
> > >
> > > If you want you are welcome to split out any patches and get them
> > > upstreaed. Even just fixing failing test cases would speed things up.
> > > My branch is available here:
> > > https://github.com/alistair23/glibc/commits/alistair/rv32.next
> > >
> >
> > Please find some comments and my future work plan:
> >
> > 1. The "sysdeps/clock_getres: Use inline syscall if required" :
> > https://github.com/alistair23/glibc/commit/830707a4a3f662b1a97860afe658f6bbd9731d13
> > commit does not convert this syscall.
> >
> > However, I can convert and post to the glibc alpha the __clock_getres64
> > (as I already have some older code available). I'm now working on
> > preparing proper patch.
>
> Go for it! :)
>
> >
> >
> > 2. Potential compilation error for SoCs with TIMESIZE != 64:
> > https://github.com/alistair23/glibc/commit/4309573e10479516fcdf75c353309497f8017c90#diff-85643011757f36e12ca60b37c3e8ec0dR75
>
> What is the error?
>
> >
> >
> > 3. Would you be so kind and post (to glibc alpha) the already converted
> > (in your -next tree) __clock_nanosleep64:
> > https://github.com/alistair23/glibc/commit/9e3d95ad1f70909a787dd11fbc735bcafa02050e#diff-5b9f1c6457e0e10079f657f283c19861R177
>
> This patch is causing build failures, so I need to investigate that.

Ah, there are typos from the rebases. I am updating these and I am
sending patches out.

Alistair

>
> >
> > Just one remark - please in include/time.h use the following paradigm:
> > https://github.com/lmajewski/y2038_glibc/commit/7ff615859f9e111c0c4cf8a6c085201c7ed82813#diff-5b9f1c6457e0e10079f657f283c19861R128
>
> Ok, I'll add this.
>
> Alistair
>
> >
> > for redirection.
> >
> >
> > > Alistair
> > >
> > > >
> > > > > diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c
> > > > > b/sysdeps/unix/sysv/linux/clock_nanosleep.c index
> > > > > 0cb6614dc92..64302fbcc69 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)
> > > > > +__clock_nanosleep_time64 (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,9 +37,70 @@ __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
> > > > > +# ifndef __NR_clock_nanosleep_time64
> > > > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > > > +# endif
> > > > > +  r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> > > > > clock_id,
> > > > > +                               flags, req, rem);
> > > > > +#else
> > > > > +# ifdef __NR_clock_nanosleep_time64
> > > > > +  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;
> > > > > +# endif /* __NR_clock_nanosleep_time64 */
> > > > > +  if (r < 0)
> > > > > +    {
> > > > > +      struct timespec ts32, tr32;
> > > > > +
> > > > > +      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)
> > > > > +        valid_timespec_to_timespec64(&tr32, rem);
> > > > > +    }
> > > > > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > > > > +
> > > > >    return (INTERNAL_SYSCALL_ERROR_P (r, err)
> > > > > -       ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
> > > > > +          ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
> > > > >  }
> > > > > +
> > > > > +#if __TIMESIZE != 64
> > > > > +int
> > > > > +__clock_nanosleep (clockid_t clock_id, int flags, const struct
> > > > > timespec *req,
> > > > > +                   struct timespec *rem)
> > > > > +{
> > > > > +  int r;
> > > > > +  timespec64 treq64, trem64;
> > > > > +
> > > > > +  valid_timespec_to_timespec64(req, &treq64)
> > > > > +  r = __clock_nanosleep_time64 (clock_id, flags, &treq64,
> > > > > &trem64); +
> > > > > +  if (r == 0 || errno != ENOSYS)
> > > > > +    {
> > > > > +      if (! in_time_t_range (trem64->tv_sec))
> > > > > +        {
> > > > > +          __set_errno (EOVERFLOW);
> > > > > +          return -1;
> > > > > +        }
> > > > > +
> > > > > +      if (remaining)
> > > > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > > > +    }
> > > > > +
> > > > > +  return r;
> > > > > +}
> > > > > +#endif
> > > > > +
> > > > >  weak_alias (__clock_nanosleep, clock_nanosleep)
> > > > > diff --git a/sysdeps/unix/sysv/linux/nanosleep.c
> > > > > b/sysdeps/unix/sysv/linux/nanosleep.c index
> > > > > f14ae565af5..9a8dd5a4b82 100644 ---
> > > > > a/sysdeps/unix/sysv/linux/nanosleep.c +++
> > > > > b/sysdeps/unix/sysv/linux/nanosleep.c @@ -22,10 +22,71 @@
> > > > >
> > > > >  /* Pause execution for a number of nanoseconds.  */
> > > > >  int
> > > > > +__nanosleep_time64 (const struct timespec *requested_time,
> > > > > +                    struct timespec *remaining)
> > > > > +{
> > > > > +#if defined(__ASSUME_TIME64_SYSCALLS)
> > > > > +# ifndef __NR_clock_nanosleep_time64
> > > > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > > > +# endif
> > > > > +  return SYSCALL_CANCEL (clock_nanosleep_time64, CLOCK_REALTIME,
> > > > > 0,
> > > > > +                         requested_time, remaining);
> > > > > +#else
> > > > > +# ifdef __NR_clock_nanosleep_time64
> > > > > +  long int ret_64;
> > > > > +
> > > > > +  ret_64 = SYSCALL_CANCEL (clock_nanosleep_time64,
> > > > > CLOCK_REALTIME, 0,
> > > > > +                           requested_time, remaining);
> > > > > +
> > > > > +  if (ret_64 == 0 || errno != ENOSYS)
> > > > > +    return ret_64;
> > > > > +# endif /* __NR_clock_nanosleep_time64 */
> > > > > +  int ret;
> > > > > +  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)
> > > > > +    valid_timespec_to_timespec64(&tr32, remaining);
> > > > > +
> > > > > +  return ret;
> > > > > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > > > > +}
> > > > > +
> > > > > +#if __TIMESIZE != 64
> > > > > +int
> > > > >  __nanosleep (const struct timespec *requested_time,
> > > > > -          struct timespec *remaining)
> > > > > +             struct timespec *remaining)
> > > > >  {
> > > > > -  return SYSCALL_CANCEL (nanosleep, requested_time, remaining);
> > > > > +  int r;
> > > > > +  timespec64 treq64, trem64;
> > > > > +
> > > > > +
> > > > > +  valid_timespec_to_timespec64(req, &treq64);
> > > > > +  r = __nanosleep_time64 (&treq64, &trem64);
> > > > > +
> > > > > +  if (r == 0 || errno != ENOSYS)
> > > > > +    {
> > > > > +      if (! in_time_t_range (trem64->tv_sec))
> > > > > +        {
> > > > > +          __set_errno (EOVERFLOW);
> > > > > +          return -1;
> > > > > +        }
> > > > > +
> > > > > +      if (remaining)
> > > > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > > > +    }
> > > > > +
> > > > > +  return r;
> > > > >  }
> > > > > +#endif
> > > > > +
> > > > >  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..03f5be2ff9e 100644 ---
> > > > > a/sysdeps/unix/sysv/linux/nanosleep_nocancel.c +++
> > > > > b/sysdeps/unix/sysv/linux/nanosleep_nocancel.c @@ -20,10 +20,70 @@
> > > > >  #include <sysdep-cancel.h>
> > > > >  #include <not-cancel.h>
> > > > >
> > > > > +int
> > > > > +__nanosleep_nocancel_time64 (const struct timespec
> > > > > *requested_time,
> > > > > +                             struct timespec *remaining)
> > > > > +{
> > > > > +#ifdef __ASSUME_TIME64_SYSCALLS
> > > > > +# ifndef __NR_clock_nanosleep_time64
> > > > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > > > +# endif
> > > > > +  return INLINE_SYSCALL_CALL (clock_nanosleep_time64,
> > > > > CLOCK_REALTIME, 0,
> > > > > +                              requested_time, remaining);
> > > > > +#else
> > > > > +# ifdef __NR_clock_nanosleep_time64
> > > > > +  long int ret_64;
> > > > > +
> > > > > +  ret_64 = INLINE_SYSCALL_CALL (clock_nanosleep_time64,
> > > > > CLOCK_REALTIME, 0,
> > > > > +                                requested_time, remaining);
> > > > > +
> > > > > +  if (ret_64 == 0 || errno != ENOSYS)
> > > > > +    return ret_64;
> > > > > +# endif /* __NR_clock_nanosleep_time64 */
> > > > > +  int ret;
> > > > > +  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)
> > > > > +    valid_timespec_to_timespec64(&tr32, remaining);
> > > > > +
> > > > > +  return ret;
> > > > > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > > > > +}
> > > > > +
> > > > > +#if __TIMESIZE != 64
> > > > >  int
> > > > >  __nanosleep_nocancel (const struct timespec *requested_time,
> > > > > -                   struct timespec *remaining)
> > > > > +                      struct timespec *remaining)
> > > > >  {
> > > > > -  return INLINE_SYSCALL_CALL (nanosleep, requested_time,
> > > > > remaining);
> > > > > +  int ret;
> > > > > +  timespec64 treq64, trem64;
> > > > > +
> > > > > +  valid_timespec_to_timespec64(req, &treq64)
> > > > > +  ret = __nanosleep_nocancel_time64 (&treq64, &trem64);
> > > > > +
> > > > > +  if (ret == 0 || errno != ENOSYS)
> > > > > +    {
> > > > > +      if (! in_time_t_range (trem64->tv_sec))
> > > > > +        {
> > > > > +          __set_errno (EOVERFLOW);
> > > > > +          return -1;
> > > > > +        }
> > > > > +
> > > > > +      if (remaining)
> > > > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > > > +    }
> > > > > +
> > > > > +  return ret;
> > > > >  }
> > > > > +#endif
> > > > > +
> > > > >  hidden_def (__nanosleep_nocancel)
> > > >
> > > >
> > > >
> > > >
> > > > Best regards,
> > > >
> > > > Lukasz Majewski
> > > >
> > > > --
> > > >
> > > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > > > lukma@denx.de
> >
> >
> >
> >
> > Best regards,
> >
> > Lukasz Majewski
> >
> > --
> >
> > DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> > Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

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

* Re: [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
  2019-10-16 23:42           ` Alistair Francis
@ 2019-10-17  0:08             ` Alistair Francis
  0 siblings, 0 replies; 46+ messages in thread
From: Alistair Francis @ 2019-10-17  0:08 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alistair Francis, GNU C Library, Arnd Bergmann, Palmer Dabbelt,
	Maciej W. Rozycki, Zong Li, Joseph Myers, Adhemerval Zanella,
	Florian Weimer, Zack Weinberg

On Wed, Oct 16, 2019 at 4:42 PM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Tue, Oct 15, 2019 at 3:28 PM Alistair Francis <alistair23@gmail.com> wrote:
> >
> > On Tue, Oct 15, 2019 at 8:55 AM Lukasz Majewski <lukma@denx.de> wrote:
> > >
> > > Hi Alistair,
> > >
> > > > On Mon, Oct 14, 2019 at 7:00 AM Lukasz Majewski <lukma@denx.de> wrote:
> > > > >
> > > > > Hi Alistair,
> > > > >
> > > > > > 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()"
> > > > > >
> > > > > > Signed-off-by: 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/clock_nanosleep.c: Likewise.
> > > > > >       * sysdeps/unix/sysv/linux/nanosleep_nocancel.c: Likewise.
> > > > > > ---
> > > > > >  include/time.h                               |  6 ++
> > > > > >  nptl/thrd_sleep.c                            | 69
> > > > > > ++++++++++++++++-- sysdeps/unix/sysv/linux/clock_nanosleep.c    |
> > > > > > 74 ++++++++++++++++++-- sysdeps/unix/sysv/linux/nanosleep.c
> > > > > >    | 65 ++++++++++++++++-
> > > > > > sysdeps/unix/sysv/linux/nanosleep_nocancel.c | 64
> > > > > > ++++++++++++++++- 5 files changed, 264 insertions(+), 14
> > > > > > deletions(-)
> > > > > >
> > > > > > diff --git a/include/time.h b/include/time.h
> > > > > > index 95b31429212..6d81f91384b 100644
> > > > > > --- a/include/time.h
> > > > > > +++ b/include/time.h
> > > > > > @@ -172,6 +172,12 @@ libc_hidden_proto (__difftime64)
> > > > > >
> > > > > >  extern double __difftime (time_t time1, time_t time0);
> > > > > >
> > > > > > +#if __TIMESIZE == 64
> > > > > > +#define __thrd_sleep_time64 thrd_sleep
> > > > > > +#define __clock_nanosleep_time64 __clock_nanosleep
> > > > > > +#define __nanosleep_time64 __nanosleep
> > > > > > +#define __nanosleep_nocancel_time64 __nanosleep_nocancel
> > > > > > +#endif
> > > > > >
> > > > > >  /* Use in the clock_* functions.  Size of the field representing
> > > > > > the actual clock ID.  */
> > > > > > diff --git a/nptl/thrd_sleep.c b/nptl/thrd_sleep.c
> > > > > > index 07a51808df2..e85da561c68 100644
> > > > > > --- a/nptl/thrd_sleep.c
> > > > > > +++ b/nptl/thrd_sleep.c
> > > > > > @@ -22,18 +22,79 @@
> > > > > >  #include "thrd_priv.h"
> > > > > >
> > > > > >  int
> > > > > > -thrd_sleep (const struct timespec* time_point, struct timespec*
> > > > > > remaining) +__thrd_sleep_time64 (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
> > > > > > +# ifndef __NR_clock_nanosleep_time64
> > > > > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > > > > +# endif
> > > > > > +  ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> > > > > > CLOCK_REALTIME,
> > > > > > +                                 0, time_point, remaining);
> > > > > > +#else
> > > > > > +# ifdef __NR_clock_nanosleep_time64
> > > > > > +  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;
> > > > > > +# endif /* __NR_clock_nanosleep_time64 */
> > > > > > +  if (ret < 0)
> > > > > > +    {
> > > > > > +      struct timespec tp32, tr32;
> > > > > > +
> > > > > > +      if (! in_time_t_range (time_point->tv_sec))
> > > > > > +        {
> > > > > > +          __set_errno (EOVERFLOW);
> > > > > > +          return -1;
> > > > > > +        }
> > > > > > +
> > > > > > +      valid_timespec64_to_timespec (time_point, &tp32);
> > > > > > +      ret =  INTERNAL_SYSCALL_CANCEL (nanosleep, err, &tp32,
> > > > > > &tr32); +
> > > > > > +      if ((ret == 0 || errno != ENOSYS) && remaining)
> > > > > > +        valid_timespec_to_timespec64(&tr32, remaining);
> > > > > > +    }
> > > > > > +#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;
> > > > > >  }
> > > > > > +
> > > > > > +#if __TIMESIZE != 64
> > > > > > +int
> > > > > > +thrd_sleep (const struct timespec* time_point, struct timespec*
> > > > > > remaining) +{
> > > > > > +  int ret;
> > > > > > +  timespec64 tp64, tr64;
> > > > > > +
> > > > > > +  valid_timespec_to_timespec64(time_point, &tp64);
> > > > > > +  ret = __thrd_sleep_time64 (&tp64, &tr64);
> > > > > > +
> > > > > > +  if (ret == 0 || errno != ENOSYS)
> > > > > > +    {
> > > > > > +      if (! in_time_t_range (tr64->tv_sec))
> > > > > > +        {
> > > > > > +          __set_errno (EOVERFLOW);
> > > > > > +          return -1;
> > > > > > +        }
> > > > > > +
> > > > > > +      if (remaining)
> > > > > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > > > > +    }
> > > > > > +
> > > > > > +  return ret;
> > > > > > +}
> > > > > > +#endif
> > > > >
> > > > > This code seems to follow the pattern introduced in clock_settime()
> > > > > conversion (already in the -master branch).
> > > >
> > > > I hope so :)
> > > >
> > > > >
> > > > > Do you plan to send this and the following patches:
> > > > >
> > > > > https://patchwork.ozlabs.org/patch/1155396/    --> clock_gettime
> > > > > https://patchwork.ozlabs.org/patch/1155398/    --> timespec_get
> > > >
> > > > Yes
> > > >
> > > > >
> > > > > As a separate patch series so we can all benefit from having them in
> > > > > the -master glibc branch?
> > > > > Those patches seems to be orthogonal to ones adding support for
> > > > > RISC-V.
> > > >
> > > > Yep! My plan is to send them seperatley. I have been working through
> > > > the RV32 tree sending patches in small batches to get them merged. I
> > > > have a few more batches before I get to these time64_t conversion
> > > > patches though. I am unfortunately seeing failures with my time64_t
> > > > conversion patches which I haven't had a chance to look into.
> > > >
> > > > >
> > > > >
> > > > > The gettimeofday() syscall handling code seems to being now
> > > > > converted to clock_gettime() in the glibc (or at least there is
> > > > > some ongoing effort):
> > > > >
> > > > > https://sourceware.org/git/?p=glibc.git;a=commit;h=b30d257ea8f557bdadca09f5b112538e7b807eb9
> > > > >
> > > >
> > > > Yep, I have rebased all of my work on top of this.
> > > >
> > > > >
> > > > > Similar situation is with stat and statfs (which are now under the
> > > > > discussion/review):
> > > > >
> > > > > https://patchwork.ozlabs.org/patch/1155399/    --> stat
> > > > > https://patchwork.ozlabs.org/patch/1155401/    --> statfs
> > > >
> > > > Yep, I'm working on the next version right now.
> > > >
> > > > If you want you are welcome to split out any patches and get them
> > > > upstreaed. Even just fixing failing test cases would speed things up.
> > > > My branch is available here:
> > > > https://github.com/alistair23/glibc/commits/alistair/rv32.next
> > > >
> > >
> > > Please find some comments and my future work plan:
> > >
> > > 1. The "sysdeps/clock_getres: Use inline syscall if required" :
> > > https://github.com/alistair23/glibc/commit/830707a4a3f662b1a97860afe658f6bbd9731d13
> > > commit does not convert this syscall.
> > >
> > > However, I can convert and post to the glibc alpha the __clock_getres64
> > > (as I already have some older code available). I'm now working on
> > > preparing proper patch.
> >
> > Go for it! :)
> >
> > >
> > >
> > > 2. Potential compilation error for SoCs with TIMESIZE != 64:
> > > https://github.com/alistair23/glibc/commit/4309573e10479516fcdf75c353309497f8017c90#diff-85643011757f36e12ca60b37c3e8ec0dR75
> >
> > What is the error?
> >
> > >
> > >
> > > 3. Would you be so kind and post (to glibc alpha) the already converted
> > > (in your -next tree) __clock_nanosleep64:
> > > https://github.com/alistair23/glibc/commit/9e3d95ad1f70909a787dd11fbc735bcafa02050e#diff-5b9f1c6457e0e10079f657f283c19861R177
> >
> > This patch is causing build failures, so I need to investigate that.
>
> Ah, there are typos from the rebases. I am updating these and I am
> sending patches out.

Do you have plans on adding a __timevalue64 struct?

Alistair

>
> Alistair
>
> >
> > >
> > > Just one remark - please in include/time.h use the following paradigm:
> > > https://github.com/lmajewski/y2038_glibc/commit/7ff615859f9e111c0c4cf8a6c085201c7ed82813#diff-5b9f1c6457e0e10079f657f283c19861R128
> >
> > Ok, I'll add this.
> >
> > Alistair
> >
> > >
> > > for redirection.
> > >
> > >
> > > > Alistair
> > > >
> > > > >
> > > > > > diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c
> > > > > > b/sysdeps/unix/sysv/linux/clock_nanosleep.c index
> > > > > > 0cb6614dc92..64302fbcc69 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)
> > > > > > +__clock_nanosleep_time64 (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,9 +37,70 @@ __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
> > > > > > +# ifndef __NR_clock_nanosleep_time64
> > > > > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > > > > +# endif
> > > > > > +  r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err,
> > > > > > clock_id,
> > > > > > +                               flags, req, rem);
> > > > > > +#else
> > > > > > +# ifdef __NR_clock_nanosleep_time64
> > > > > > +  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;
> > > > > > +# endif /* __NR_clock_nanosleep_time64 */
> > > > > > +  if (r < 0)
> > > > > > +    {
> > > > > > +      struct timespec ts32, tr32;
> > > > > > +
> > > > > > +      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)
> > > > > > +        valid_timespec_to_timespec64(&tr32, rem);
> > > > > > +    }
> > > > > > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > > > > > +
> > > > > >    return (INTERNAL_SYSCALL_ERROR_P (r, err)
> > > > > > -       ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
> > > > > > +          ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
> > > > > >  }
> > > > > > +
> > > > > > +#if __TIMESIZE != 64
> > > > > > +int
> > > > > > +__clock_nanosleep (clockid_t clock_id, int flags, const struct
> > > > > > timespec *req,
> > > > > > +                   struct timespec *rem)
> > > > > > +{
> > > > > > +  int r;
> > > > > > +  timespec64 treq64, trem64;
> > > > > > +
> > > > > > +  valid_timespec_to_timespec64(req, &treq64)
> > > > > > +  r = __clock_nanosleep_time64 (clock_id, flags, &treq64,
> > > > > > &trem64); +
> > > > > > +  if (r == 0 || errno != ENOSYS)
> > > > > > +    {
> > > > > > +      if (! in_time_t_range (trem64->tv_sec))
> > > > > > +        {
> > > > > > +          __set_errno (EOVERFLOW);
> > > > > > +          return -1;
> > > > > > +        }
> > > > > > +
> > > > > > +      if (remaining)
> > > > > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > > > > +    }
> > > > > > +
> > > > > > +  return r;
> > > > > > +}
> > > > > > +#endif
> > > > > > +
> > > > > >  weak_alias (__clock_nanosleep, clock_nanosleep)
> > > > > > diff --git a/sysdeps/unix/sysv/linux/nanosleep.c
> > > > > > b/sysdeps/unix/sysv/linux/nanosleep.c index
> > > > > > f14ae565af5..9a8dd5a4b82 100644 ---
> > > > > > a/sysdeps/unix/sysv/linux/nanosleep.c +++
> > > > > > b/sysdeps/unix/sysv/linux/nanosleep.c @@ -22,10 +22,71 @@
> > > > > >
> > > > > >  /* Pause execution for a number of nanoseconds.  */
> > > > > >  int
> > > > > > +__nanosleep_time64 (const struct timespec *requested_time,
> > > > > > +                    struct timespec *remaining)
> > > > > > +{
> > > > > > +#if defined(__ASSUME_TIME64_SYSCALLS)
> > > > > > +# ifndef __NR_clock_nanosleep_time64
> > > > > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > > > > +# endif
> > > > > > +  return SYSCALL_CANCEL (clock_nanosleep_time64, CLOCK_REALTIME,
> > > > > > 0,
> > > > > > +                         requested_time, remaining);
> > > > > > +#else
> > > > > > +# ifdef __NR_clock_nanosleep_time64
> > > > > > +  long int ret_64;
> > > > > > +
> > > > > > +  ret_64 = SYSCALL_CANCEL (clock_nanosleep_time64,
> > > > > > CLOCK_REALTIME, 0,
> > > > > > +                           requested_time, remaining);
> > > > > > +
> > > > > > +  if (ret_64 == 0 || errno != ENOSYS)
> > > > > > +    return ret_64;
> > > > > > +# endif /* __NR_clock_nanosleep_time64 */
> > > > > > +  int ret;
> > > > > > +  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)
> > > > > > +    valid_timespec_to_timespec64(&tr32, remaining);
> > > > > > +
> > > > > > +  return ret;
> > > > > > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > > > > > +}
> > > > > > +
> > > > > > +#if __TIMESIZE != 64
> > > > > > +int
> > > > > >  __nanosleep (const struct timespec *requested_time,
> > > > > > -          struct timespec *remaining)
> > > > > > +             struct timespec *remaining)
> > > > > >  {
> > > > > > -  return SYSCALL_CANCEL (nanosleep, requested_time, remaining);
> > > > > > +  int r;
> > > > > > +  timespec64 treq64, trem64;
> > > > > > +
> > > > > > +
> > > > > > +  valid_timespec_to_timespec64(req, &treq64);
> > > > > > +  r = __nanosleep_time64 (&treq64, &trem64);
> > > > > > +
> > > > > > +  if (r == 0 || errno != ENOSYS)
> > > > > > +    {
> > > > > > +      if (! in_time_t_range (trem64->tv_sec))
> > > > > > +        {
> > > > > > +          __set_errno (EOVERFLOW);
> > > > > > +          return -1;
> > > > > > +        }
> > > > > > +
> > > > > > +      if (remaining)
> > > > > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > > > > +    }
> > > > > > +
> > > > > > +  return r;
> > > > > >  }
> > > > > > +#endif
> > > > > > +
> > > > > >  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..03f5be2ff9e 100644 ---
> > > > > > a/sysdeps/unix/sysv/linux/nanosleep_nocancel.c +++
> > > > > > b/sysdeps/unix/sysv/linux/nanosleep_nocancel.c @@ -20,10 +20,70 @@
> > > > > >  #include <sysdep-cancel.h>
> > > > > >  #include <not-cancel.h>
> > > > > >
> > > > > > +int
> > > > > > +__nanosleep_nocancel_time64 (const struct timespec
> > > > > > *requested_time,
> > > > > > +                             struct timespec *remaining)
> > > > > > +{
> > > > > > +#ifdef __ASSUME_TIME64_SYSCALLS
> > > > > > +# ifndef __NR_clock_nanosleep_time64
> > > > > > +#  define __NR_clock_nanosleep_time64 __NR_clock_nanosleep
> > > > > > +# endif
> > > > > > +  return INLINE_SYSCALL_CALL (clock_nanosleep_time64,
> > > > > > CLOCK_REALTIME, 0,
> > > > > > +                              requested_time, remaining);
> > > > > > +#else
> > > > > > +# ifdef __NR_clock_nanosleep_time64
> > > > > > +  long int ret_64;
> > > > > > +
> > > > > > +  ret_64 = INLINE_SYSCALL_CALL (clock_nanosleep_time64,
> > > > > > CLOCK_REALTIME, 0,
> > > > > > +                                requested_time, remaining);
> > > > > > +
> > > > > > +  if (ret_64 == 0 || errno != ENOSYS)
> > > > > > +    return ret_64;
> > > > > > +# endif /* __NR_clock_nanosleep_time64 */
> > > > > > +  int ret;
> > > > > > +  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)
> > > > > > +    valid_timespec_to_timespec64(&tr32, remaining);
> > > > > > +
> > > > > > +  return ret;
> > > > > > +#endif /* __ASSUME_TIME64_SYSCALLS */
> > > > > > +}
> > > > > > +
> > > > > > +#if __TIMESIZE != 64
> > > > > >  int
> > > > > >  __nanosleep_nocancel (const struct timespec *requested_time,
> > > > > > -                   struct timespec *remaining)
> > > > > > +                      struct timespec *remaining)
> > > > > >  {
> > > > > > -  return INLINE_SYSCALL_CALL (nanosleep, requested_time,
> > > > > > remaining);
> > > > > > +  int ret;
> > > > > > +  timespec64 treq64, trem64;
> > > > > > +
> > > > > > +  valid_timespec_to_timespec64(req, &treq64)
> > > > > > +  ret = __nanosleep_nocancel_time64 (&treq64, &trem64);
> > > > > > +
> > > > > > +  if (ret == 0 || errno != ENOSYS)
> > > > > > +    {
> > > > > > +      if (! in_time_t_range (trem64->tv_sec))
> > > > > > +        {
> > > > > > +          __set_errno (EOVERFLOW);
> > > > > > +          return -1;
> > > > > > +        }
> > > > > > +
> > > > > > +      if (remaining)
> > > > > > +        valid_timespec64_to_timespec(&tr32, remaining);
> > > > > > +    }
> > > > > > +
> > > > > > +  return ret;
> > > > > >  }
> > > > > > +#endif
> > > > > > +
> > > > > >  hidden_def (__nanosleep_nocancel)
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Best regards,
> > > > >
> > > > > Lukasz Majewski
> > > > >
> > > > > --
> > > > >
> > > > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > > > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > > > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > > > > lukma@denx.de
> > >
> > >
> > >
> > >
> > > Best regards,
> > >
> > > Lukasz Majewski
> > >
> > > --
> > >
> > > DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> > > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> > > Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

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

* Re: [RFC v5 05/21] sysdeps/clock_gettime: Use clock_gettime64 if avaliable
  2019-08-29 16:50 ` [RFC v5 05/21] sysdeps/clock_gettime: Use clock_gettime64 " Alistair Francis
@ 2019-10-29 12:00   ` Lukasz Majewski
  0 siblings, 0 replies; 46+ messages in thread
From: Lukasz Majewski @ 2019-10-29 12:00 UTC (permalink / raw)
  To: Alistair Francis, alistair23
  Cc: libc-alpha, arnd, adhemerval.zanella, fweimer, palmer, macro,
	zongbox, Zack Weinberg, Joseph Myers

[-- Attachment #1: Type: text/plain, Size: 4765 bytes --]

Hi Alistair,

> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> 
> 	* sysdeps/unix/sysv/linux/clock_gettime.c: Use
> clock_gettime64 if avaliable. ---
>  include/time.h                          |  1 +
>  sysdeps/unix/sysv/linux/clock_gettime.c | 48
> ++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 1
> deletion(-)
> 
> diff --git a/include/time.h b/include/time.h
> index 6d81f91384b..1e33f34e1f6 100644
> --- a/include/time.h
> +++ b/include/time.h
> @@ -177,6 +177,7 @@ extern double __difftime (time_t time1, time_t
> time0); #define __clock_nanosleep_time64 __clock_nanosleep
>  #define __nanosleep_time64 __nanosleep
>  #define __nanosleep_nocancel_time64 __nanosleep_nocancel
> +#define __clock_gettime64 __clock_gettime
>  #endif
>  
>  /* Use in the clock_* functions.  Size of the field representing the
> diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c
> b/sysdeps/unix/sysv/linux/clock_gettime.c index
> 5fc47fb7dc7..ea98af9bf1a 100644 ---
> a/sysdeps/unix/sysv/linux/clock_gettime.c +++
> b/sysdeps/unix/sysv/linux/clock_gettime.c @@ -28,9 +28,55 @@
>  
>  /* Get current value of CLOCK and store it in TP.  */
>  int
> +__clock_gettime64 (clockid_t clock_id, struct timespec *tp)
> +{
> +#ifdef __ASSUME_TIME64_SYSCALLS
> +# ifndef __NR_clock_gettime64
> +#  define __NR_clock_gettime64 __NR_clock_gettime
> +# endif
> +   return INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp);
> +#else
> +   int ret;
> +# ifdef __NR_clock_gettime64
> +  ret = INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp);
> +
> +  if (ret == 0 || errno != ENOSYS)
> +    return ret;
> +# endif /* __NR_clock_gettime64 */
> +  struct timespec tp32;
> +
> +  ret = INLINE_VSYSCALL (clock_gettime, 2, clock_id, &tp32);
> +
> +  if (ret == 0 || errno != ENOSYS)
> +    valid_timespec_to_timespec64(tp32, tp);
> +
> +  return ret;
> +#endif /* __ASSUME_TIME64_SYSCALLS */
> +}
> +
> +#if __TIMESIZE != 64
> +int
>  __clock_gettime (clockid_t clock_id, struct timespec *tp)
>  {
> -  return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp);
> +  int ret;
> +  struct __timespec64 tp64;
> +
> +  ret = __clock_gettime64 (clock_id, &tp64);
> +
> +  if (ret == 0 || errno != ENOSYS)
> +    {
> +      if (! in_time_t_range (tp64.tv_sec))
> +        {
> +          __set_errno (EOVERFLOW);
> +          return -1;
> +        }
> +
> +      valid_timespec64_to_timespec(&tp64, tp);
> +
> +      return ret;
> +    }
>  }
> +#endif
> +
>  weak_alias (__clock_gettime, clock_gettime)
>  libc_hidden_def (__clock_gettime)

In your github repository - I've noticed the updated version of patch
providing __clock_gettime64 [1] conversion.

Do you plan to re-send this patch soon?


Please find some comments regarding this particular patch:

1. Please add following code instead the line 182 [2] (@include/time.h):

+#if __TIMESIZE == 64
+# define __clock_gettime64 __clock_gettime
+#else
+extern int __clock_gettime64 (clockid_t clock_id,
+                              struct __timespec64 *tp);
+libc_hidden_proto (__clock_gettime64);
+#endif


2. The line 44 (@sysv/linux/clock_gettime.c) is a bit tricky

I've grepped the recent kernel (-master branch) tag: v5.4-rc5 with
git grep -n "vdso_clock_gettime64"

And the __vdso_clock_gettime64 is available for mips, aarch64 and x86
(plain ARM 32 bits is missing though).

Considering the above - the vDSO may be a bit tricky for some archs as
the 'clock_gettime64' "name" argument to INLINE_VSYSCALL () macro is
then extended to __vdso_##name (@ sysdeps/unix/sysv/linux/sysdep-vdso.h)
It seems like one would need a global (i.e. at clock_gettime.c file)
__vdso_clock_gettime64 fallback.


IMHO the condition '&& defined HAVE_CLOCK_GETTIME64_VSYSCALL' in Line
44 [3] could be removed.


3. Line 50 - replace tp32 with ts32 (as we define structure, not
pointer).

4. Line 54 - IMHO the 'if (ret == 0 || errno != ENOSYS)' shall be
replaced with 'if (! ret && tp)' 
(as we reference *tp, which may be NULL). The same situation is in Line
70.


Links:
[1] -
https://github.com/alistair23/glibc/commit/b7682ca51f6d7ea702eeb9066c7710f5a40f6590

[2] -
https://github.com/alistair23/glibc/commit/b7682ca51f6d7ea702eeb9066c7710f5a40f6590#diff-5b9f1c6457e0e10079f657f283c19861R182

[3] -
https://github.com/alistair23/glibc/commit/b7682ca51f6d7ea702eeb9066c7710f5a40f6590#diff-cb7e59ab5b305ba007394bee79cdd6d6R44



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2019-10-29 12:01 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 16:50 [RFC v5 00/21] RISC-V glibc port for the 32-bit Alistair Francis
2019-08-29 16:50 ` [RFC v5 01/21] sunrpc/clnt_udp: Ensure total_deadline is initalised Alistair Francis
2019-08-29 17:22   ` Joseph Myers
2019-08-29 17:34     ` Zack Weinberg
2019-09-05 14:53       ` Alistair Francis
2019-09-05 15:02         ` Joseph Myers
2019-09-05 15:06           ` Jeff Law
2019-09-05 15:21             ` Joseph Myers
2019-09-05 15:27               ` Jeff Law
2019-09-06  0:47               ` Alistair Francis
2019-09-05 15:12           ` Zack Weinberg
2019-09-06  0:46           ` Alistair Francis
2019-09-06  1:31             ` Jeff Law
2019-09-16 21:36               ` Alistair Francis
2019-09-05 15:07         ` Zack Weinberg
2019-08-29 16:50 ` [RFC v5 02/21] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable Alistair Francis
2019-08-29 17:25   ` Joseph Myers
2019-08-30 17:40     ` Alistair Francis
2019-10-14 13:59   ` Lukasz Majewski
2019-10-15  0:06     ` Alistair Francis
2019-10-15 15:54       ` Lukasz Majewski
2019-10-15 22:28         ` Alistair Francis
2019-10-16 23:42           ` Alistair Francis
2019-10-17  0:08             ` Alistair Francis
2019-08-29 16:50 ` [RFC v5 03/21] sysdeps/gettimeofday: Use clock_gettime64 " Alistair Francis
2019-08-29 16:50 ` [RFC v5 04/21] sysdeps/wait: Use waitid " Alistair Francis
2019-08-29 16:50 ` [RFC v5 05/21] sysdeps/clock_gettime: Use clock_gettime64 " Alistair Francis
2019-10-29 12:00   ` Lukasz Majewski
2019-08-29 16:50 ` [RFC v5 06/21] sysdeps/timespec_get: " Alistair Francis
2019-08-29 16:50 ` [RFC v5 07/21] sysdeps/stat: Handle 64-bit ino_t types on 32-bit hosts Alistair Francis
2019-08-29 16:50 ` [RFC v5 08/21] sysdeps/statfs: " Alistair Francis
2019-08-29 16:50 ` [RFC v5 09/21] Documentation for the RISC-V 32-bit port Alistair Francis
2019-08-29 16:50 ` [RFC v5 10/21] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64 Alistair Francis
2019-08-29 16:50 ` [RFC v5 11/21] RISC-V: Define __NR_* as __NR_*_time64/64 for 32-bit Alistair Francis
2019-08-29 16:50 ` [RFC v5 12/21] RISC-V: Use 64-bit timespec in clock_gettime vdso calls Alistair Francis
2019-08-29 16:50 ` [RFC v5 13/21] RISC-V: Support dynamic loader for the 32-bit Alistair Francis
2019-08-29 16:50 ` [RFC v5 14/21] RISC-V: Add path of library directories for RV32 Alistair Francis
2019-08-29 16:50 ` [RFC v5 15/21] RISC-V: The ABI implementation for the 32-bit Alistair Francis
2019-08-29 16:50 ` [RFC v5 16/21] RISC-V: Hard float support for the 32 bit Alistair Francis
2019-08-29 16:50 ` [RFC v5 17/21] RISC-V: Add ABI lists Alistair Francis
2019-08-29 16:50 ` [RFC v5 18/21] RISC-V: Build Infastructure for the 32-bit Alistair Francis
2019-08-29 16:50 ` [RFC v5 19/21] RISC-V: Fix llrint and llround missing exceptions on RV32 Alistair Francis
2019-08-29 16:50 ` [RFC v5 20/21] RISC-V: Use 64-bit vdso syscalls for RV32 Alistair Francis
2019-08-29 16:50 ` [RFC v5 21/21] Add RISC-V 32-bit target to build-many-glibcs.py Alistair Francis
2019-08-29 17:28 ` [RFC v5 00/21] RISC-V glibc port for the 32-bit Joseph Myers
2019-08-29 17:42   ` 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).