public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3 02/19] Allow make-link-multidir to make subdirectories
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
@ 2017-12-27  6:05 ` Palmer Dabbelt
  2018-01-01  1:59   ` Joseph Myers
  2018-01-01  9:35   ` Andreas Schwab
  2017-12-27  6:06 ` [PATCH v3 19/19] Add RISC-V to build-many-glibcs.py Palmer Dabbelt
                   ` (19 subsequent siblings)
  20 siblings, 2 replies; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:05 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

The RISC-V Linux ABI doesn't define any libraries that go directly in
lib, instead they go into lib/ilp32 or lib/lp64.  This casuse
make-link-multidir to fail when attempting to make library directories
when building a static libc on multilib RISC-V systems.

This patch adds '-p' to mkdir so it will make subdirectories.  I've
added "." as an argument so mkdir won't error out if no directories are
provided -- I think "mkdir -p ." should always do nothing.
---
 Makerules | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makerules b/Makerules
index 522de25cfddb..ec0f93e0b493 100644
--- a/Makerules
+++ b/Makerules
@@ -1081,6 +1081,7 @@ mv -f $@.new $@
 endef
 define make-link-multidir
 $(patsubst %/,cd %,$(objpfx)); \
+  mkdir -p -- . $(dir $(multidir)); \
   $(LN_S) . $(multidir) 2> /dev/null; \
   test -L $(multidir)
 endef
-- 
2.13.6

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

* RISC-V glibc Port v3
@ 2017-12-27  6:05 Palmer Dabbelt
  2017-12-27  6:05 ` [PATCH v3 02/19] Allow make-link-multidir to make subdirectories Palmer Dabbelt
                   ` (20 more replies)
  0 siblings, 21 replies; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:05 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches

It's been about a week since the last patch set, and while there's a bit more
work to do I wanted to get something out so everyone is one the same page.  The
major milestone here is that we now pass build-many-glibcs.py -- or at least we
did a few hours ago, but I've rebased recently so some trouble may have snuck
in (I'm running another build now, but it'll take hours).  We still need to get
things running natively to see the test suite results, but I think I've
responded to all the feedback from v2 patch set aside from the what's listed
below.  Sorry if I've missed anything, feel free to just poke the v2 email so
it ends up back in my inbox.

Thanks to everyone for all the help!

There are a few things I still need to do:

* I need to go through and sanitize the floating-point routines, which I had to
  refactor as a result of the new FP aliasing mechanism.
* Our test suite results are very bad, but I believe this is because we're
  running on QEMU's user-mode emulation which is known to be both buggy and
  incomplete.  I'm bringing up userspace again to produce a more reasonable
  test suite run, which will hopefully have a much cleaner run.
* I need to generate the ulps files, what exist are just placeholders.
* I need to add a soft-fp directory, which should be very quick to do but all
  my build machines are tied up running build-many-glibcs.py 
* I don't yet understand the API we should have for __riscv_flush_icache,
  there's an email thread about this on the v2 patch set.
* We only have 4 of our 6 supported configurations in build-many-glibcs.py,
  I'll add the remaining two as build time permits.

Here's a summary of the changes since the previous patch set:

* We now have 4 ABI/ISA pairs in build-many-glibcs.py, which is clean (with the
  newest linux headers, see the patch for details).
* Support for ilp32f and lp64f have been removed.
* Support for systems without the A extension has been removed.
* There are now ABI lists.
* Many whitespace fixes to meet glibc's standards.
* Included C and ASM files from other ports have been copied into ours.
* with_fp_cond is now set, but I don't have a soft-fp directory yet.
* We no longer maintain a -mno-plt list in our port, that existed to work
  around a linker bug and is now defunct.
* A handful of header files (mostly ucontext.h) have been cleaned up to be
  namespace clean.

And here's a log of all the other summaries:

[v1] A (very brief, as it's been 6 months) summary of the changes since the v1
patch set includes:

* Many copyright cleanups.
* We're using the generic versions of a handful of functions and headers,
  including ieee754.h, mathdef.h mathinline.h, fabs{,f}, and
  fe{disable,enable,get}except.
* Removal of lots of head code, including pthread_lock, atomic_fast.
* A handful of ABI fixes to match our upstreamed Linux port, including
  sigcontext, instruction-cache flushing, and some syscall sanitization.
* We've changed to use libm_alias_{float,double}, like upstream
* Compiler builtins are used for atomics where possible.
* We now mandate the A extension in Linux, support for non-A systems has been
  removed from glibc.

[PATCH v3 01/19] Avoid race conditions when rebuilding librt.so
[PATCH v3 02/19] Allow make-link-multidir to make subdirectories
[PATCH v3 03/19] Add linux-4.15 VDSO hash for RISC-V
[PATCH v3 04/19] Skeleton documentation for the RISC-V port
[PATCH v3 05/19] Add RISC-V dynamic relocations to elf.h
[PATCH v3 06/19] Add RISC-V entries to config.h.in
[PATCH v3 07/19] RISC-V: Build Infastructure
[PATCH v3 08/19] RISC-V: ABI Implementation
[PATCH v3 09/19] RISC-V: Startup and Dynamic Loading Code
[PATCH v3 10/19] RISC-V: Thread-Local Storage Support
[PATCH v3 11/19] RISC-V: Generic <math.h> and soft-fp Routines
[PATCH v3 12/19] RISC-V: RV32F Support
[PATCH v3 13/19] RISC-V: RV32D, RV64F, and RV64D Support
[PATCH v3 14/19] RISC-V: Atomic and Locking Routines
[PATCH v3 15/19] RISC-V: Linux Syscall Interface
[PATCH v3 16/19] RISC-V: Linux ABI
[PATCH v3 17/19] RISC-V: Linux Startup and Dynamic Loading Code
[PATCH v3 18/19] RISC-V: Add ABI Lists
[PATCH v3 19/19] Add RISC-V to build-many-glibcs.py

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

* [PATCH v3 18/19] RISC-V: Add ABI Lists
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (17 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 14/19] RISC-V: Atomic and Locking Routines Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01 17:37   ` Joseph Myers
  2018-01-01  1:48 ` RISC-V glibc Port v3 Joseph Myers
  2018-01-02 13:01 ` Florian Weimer
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

The libm-test-ulps* are just placeholders, so they're almost certainly
nonsense.  Aside from those, I started with the aarch64 ABI lists and
manually went through each difference, ensuring that the missing entries
had been deprecated along the line.
---
 sysdeps/riscv/libm-test-ulps                       | 2252 ++++++++++++++++++++
 sysdeps/riscv/libm-test-ulps-name                  |    1 +
 .../unix/sysv/linux/riscv/libBrokenLocale.abilist  |    2 +
 sysdeps/unix/sysv/linux/riscv/libanl.abilist       |    5 +
 sysdeps/unix/sysv/linux/riscv/libcrypt.abilist     |    8 +
 sysdeps/unix/sysv/linux/riscv/libdl.abilist        |   10 +
 sysdeps/unix/sysv/linux/riscv/libm.abilist         |  970 +++++++++
 sysdeps/unix/sysv/linux/riscv/libnsl.abilist       |  121 ++
 sysdeps/unix/sysv/linux/riscv/libpthread.abilist   |  218 ++
 sysdeps/unix/sysv/linux/riscv/librt.abilist        |   36 +
 sysdeps/unix/sysv/linux/riscv/libthread_db.abilist |   41 +
 sysdeps/unix/sysv/linux/riscv/libutil.abilist      |    7 +
 sysdeps/unix/sysv/linux/riscv/localplt.data        |   19 +
 sysdeps/unix/sysv/linux/riscv/rv32/c++-types.data  |   67 +
 sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist      |   10 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist    | 2095 ++++++++++++++++++
 .../unix/sysv/linux/riscv/rv32/libresolv.abilist   |   80 +
 sysdeps/unix/sysv/linux/riscv/rv64/c++-types.data  |   67 +
 sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist      |   10 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist    | 2095 ++++++++++++++++++
 .../unix/sysv/linux/riscv/rv64/libresolv.abilist   |   80 +
 21 files changed, 8194 insertions(+)
 create mode 100644 sysdeps/riscv/libm-test-ulps
 create mode 100644 sysdeps/riscv/libm-test-ulps-name
 create mode 100644 sysdeps/unix/sysv/linux/riscv/libBrokenLocale.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/libcrypt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/libdl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/libm.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/libnsl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/libpthread.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/libthread_db.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/libutil.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/localplt.data
 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/libc.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libresolv.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv64/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv64/libresolv.abilist

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

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

* [PATCH v3 11/19] RISC-V: Generic <math.h> and soft-fp Routines
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (4 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 01/19] Avoid race conditions when rebuilding librt.so Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01 15:02   ` Joseph Myers
  2017-12-27  6:06 ` [PATCH v3 03/19] Add linux-4.15 VDSO hash for RISC-V Palmer Dabbelt
                   ` (14 subsequent siblings)
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

This patch contains the miscellaneous math routines and headers we have
implemented for RISC-V.  This includes things from <math.h> that aren't
completely ISA-generic, floating-point bit manipulation, and soft-fp
hooks.

FIXME: add ieee745/soft-fp via a riscv/soft-fp directory.
---
 sysdeps/riscv/bits/fenv.h   |  74 +++++++++++++++++++++++++++++
 sysdeps/riscv/fpu_control.h |  74 +++++++++++++++++++++++++++++
 sysdeps/riscv/sfp-machine.h | 112 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 260 insertions(+)
 create mode 100644 sysdeps/riscv/bits/fenv.h
 create mode 100644 sysdeps/riscv/fpu_control.h
 create mode 100644 sysdeps/riscv/sfp-machine.h

diff --git a/sysdeps/riscv/bits/fenv.h b/sysdeps/riscv/bits/fenv.h
new file mode 100644
index 000000000000..13569f6d2ca6
--- /dev/null
+++ b/sysdeps/riscv/bits/fenv.h
@@ -0,0 +1,74 @@
+/* Floating point environment, RISC-V version.
+   Copyright (C) 1998-2017 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 _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+enum
+  {
+    FE_INEXACT   =
+#define FE_INEXACT	(0x01)
+      FE_INEXACT,
+    FE_UNDERFLOW =
+#define FE_UNDERFLOW	(0x02)
+      FE_UNDERFLOW,
+    FE_OVERFLOW  =
+#define FE_OVERFLOW	(0x04)
+      FE_OVERFLOW,
+    FE_DIVBYZERO =
+#define FE_DIVBYZERO	(0x08)
+      FE_DIVBYZERO,
+    FE_INVALID   =
+#define FE_INVALID	(0x10)
+      FE_INVALID,
+  };
+
+#define FE_ALL_EXCEPT \
+	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+enum
+  {
+    FE_TONEAREST  =
+#define FE_TONEAREST	(0x0)
+      FE_TONEAREST,
+    FE_TOWARDZERO =
+#define FE_TOWARDZERO	(0x1)
+      FE_TOWARDZERO,
+    FE_DOWNWARD   =
+#define FE_DOWNWARD	(0x2)
+      FE_DOWNWARD,
+    FE_UPWARD     =
+#define FE_UPWARD	(0x3)
+      FE_UPWARD,
+  };
+
+
+typedef unsigned int fexcept_t;
+typedef unsigned int fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((__const fenv_t *) -1)
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes.  */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes.  */
+# define FE_DFL_MODE	((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/riscv/fpu_control.h b/sysdeps/riscv/fpu_control.h
new file mode 100644
index 000000000000..d873766a3f54
--- /dev/null
+++ b/sysdeps/riscv/fpu_control.h
@@ -0,0 +1,74 @@
+/* FPU control word bits.  RISC-V version.
+   Copyright (C) 1996-2017 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 _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+#include <features.h>
+
+#ifndef __riscv_flen
+
+# define _FPU_RESERVED 0xffffffff
+# define _FPU_DEFAULT  0x00000000
+typedef unsigned int fpu_control_t;
+# define _FPU_GETCW(cw) (cw) = 0
+# define _FPU_SETCW(cw) do { } while (0)
+extern fpu_control_t __fpu_control;
+
+#else /* __riscv_flen */
+
+# define _FPU_RESERVED 0
+# define _FPU_DEFAULT  0
+# define _FPU_IEEE     _FPU_DEFAULT
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__SI__)));
+
+/* Macros for accessing the hardware control word.  */
+# define _FPU_GETCW(cw) __asm__ volatile ("frsr %0" : "=r" (cw))
+# define _FPU_SETCW(cw) __asm__ volatile ("fssr %z0" : : "rJ" (cw))
+
+/* Default control word set at startup.  */
+extern fpu_control_t __fpu_control;
+
+# define _FCLASS(x) ({ int res; \
+  if (sizeof (x) * 8 > __riscv_flen) __builtin_trap (); \
+  if (sizeof (x) == 4) asm ("fclass.s %0, %1" : "=r" (res) : "f" (x)); \
+  else if (sizeof (x) == 8) asm ("fclass.d %0, %1" : "=r" (res) : "f" (x)); \
+  else __builtin_trap (); \
+  res; })
+
+# define _FCLASS_MINF     (1 << 0)
+# define _FCLASS_MNORM    (1 << 1)
+# define _FCLASS_MSUBNORM (1 << 2)
+# define _FCLASS_MZERO    (1 << 3)
+# define _FCLASS_PZERO    (1 << 4)
+# define _FCLASS_PSUBNORM (1 << 5)
+# define _FCLASS_PNORM    (1 << 6)
+# define _FCLASS_PINF     (1 << 7)
+# define _FCLASS_SNAN     (1 << 8)
+# define _FCLASS_QNAN     (1 << 9)
+# define _FCLASS_ZERO     (_FCLASS_MZERO | _FCLASS_PZERO)
+# define _FCLASS_SUBNORM  (_FCLASS_MSUBNORM | _FCLASS_PSUBNORM)
+# define _FCLASS_NORM     (_FCLASS_MNORM | _FCLASS_PNORM)
+# define _FCLASS_INF      (_FCLASS_MINF | _FCLASS_PINF)
+# define _FCLASS_NAN      (_FCLASS_SNAN | _FCLASS_QNAN)
+
+#endif /* __riscv_flen */
+
+#endif	/* fpu_control.h */
diff --git a/sysdeps/riscv/sfp-machine.h b/sysdeps/riscv/sfp-machine.h
new file mode 100644
index 000000000000..702ecf7b33ca
--- /dev/null
+++ b/sysdeps/riscv/sfp-machine.h
@@ -0,0 +1,112 @@
+/* RISC-V softfloat definitions
+   Copyright (C) 2017 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 <fenv.h>
+#include <fpu_control.h>
+
+#if __riscv_xlen == 32
+
+# 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_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
+
+# define _FP_W_TYPE_SIZE		64
+# define _FP_W_TYPE		unsigned long long
+# define _FP_WS_TYPE		signed long long
+# define _FP_I_TYPE		long long
+
+# define _FP_MUL_MEAT_S(R, X, Y)					\
+  _FP_MUL_MEAT_1_imm (_FP_WFRACBITS_S, R, X, Y)
+# define _FP_MUL_MEAT_D(R, X, Y)					\
+  _FP_MUL_MEAT_1_wide (_FP_WFRACBITS_D, R, X, Y, umul_ppmm)
+# define _FP_MUL_MEAT_Q(R, X, Y)					\
+  _FP_MUL_MEAT_2_wide_3mul (_FP_WFRACBITS_Q, R, X, Y, umul_ppmm)
+
+# define _FP_DIV_MEAT_S(R, X, Y)	_FP_DIV_MEAT_1_imm(S, R, X, Y, _FP_DIV_HELP_imm)
+# define _FP_DIV_MEAT_D(R, X, Y)	_FP_DIV_MEAT_1_udiv_norm(D, R, X, Y)
+# define _FP_DIV_MEAT_Q(R, X, Y)	_FP_DIV_MEAT_2_udiv(Q, R, X, Y)
+
+# define _FP_NANFRAC_S		_FP_QNANBIT_S
+# define _FP_NANFRAC_D		_FP_QNANBIT_D
+# define _FP_NANFRAC_Q		_FP_QNANBIT_Q, 0
+
+#endif
+
+#define _FP_NANSIGN_S		0
+#define _FP_NANSIGN_D		0
+#define _FP_NANSIGN_Q		0
+
+#define _FP_KEEPNANFRACP 0
+#define _FP_QNANNEGATEDP 0
+
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)	\
+  do {						\
+    R##_s = _FP_NANSIGN_##fs;			\
+    _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);	\
+    R##_c = FP_CLS_NAN;				\
+  } while (0)
+
+#define _FP_DECL_EX		int _frm __attribute__ ((unused));
+#define FP_ROUNDMODE		_frm
+
+#define FP_RND_NEAREST		FE_TONEAREST
+#define FP_RND_ZERO		FE_TOWARDZERO
+#define FP_RND_PINF		FE_UPWARD
+#define FP_RND_MINF		FE_DOWNWARD
+
+#define FP_EX_INVALID		FE_INVALID
+#define FP_EX_OVERFLOW		FE_OVERFLOW
+#define FP_EX_UNDERFLOW		FE_UNDERFLOW
+#define FP_EX_DIVZERO		FE_DIVBYZERO
+#define FP_EX_INEXACT		FE_INEXACT
+
+#define _FP_TININESS_AFTER_ROUNDING 1
+
+#ifdef __riscv_flen
+# define FP_INIT_ROUNDMODE			\
+do {						\
+  __asm__ volatile ("frrm %0" : "=r" (_frm));	\
+} while (0)
+
+# define FP_HANDLE_EXCEPTIONS					\
+do {								\
+  if (__builtin_expect (_fex, 0))				\
+    __asm__ volatile ("csrs fflags, %0" : : "rK" (_fex));	\
+} while (0)
+#else
+# define FP_INIT_ROUNDMODE	_frm = FP_RND_NEAREST
+#endif
-- 
2.13.6

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

* [PATCH v3 19/19] Add RISC-V to build-many-glibcs.py
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
  2017-12-27  6:05 ` [PATCH v3 02/19] Allow make-link-multidir to make subdirectories Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01  1:55   ` Joseph Myers
  2017-12-27  6:06 ` [PATCH v3 15/19] RISC-V: Linux Syscall Interface Palmer Dabbelt
                   ` (18 subsequent siblings)
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

For full disclosure, I've only run build-many-glibcs.py with the
additional diff below.

    diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
    index 1c7b85050b57..22cc7b427041 100755
    --- a/scripts/build-many-glibcs.py
    +++ b/scripts/build-many-glibcs.py
    @@ -706,7 +706,7 @@ class Context(object):
                                 'gcc': 'vcs-7',
                                 'glibc': 'vcs-mainline',
                                 'gmp': '6.1.2',
    -                            'linux': '4.14',
    +                            'linux': '4.15-rc4',
                                 'mpc': '1.0.3',
                                 'mpfr': '3.1.6'}
             use_versions = {}
    @@ -841,7 +841,7 @@ class Context(object):
             url_map = {'binutils':
    'https://ftp.gnu.org/gnu/binutils/binutils-%(version)s.tar.bz2',
                        'gcc':
    'https://ftp.gnu.org/gnu/gcc/gcc-%(version)s/gcc-%(version)s.tar.bz2',
                        'gmp':
    'https://ftp.gnu.org/gnu/gmp/gmp-%(version)s.tar.xz',
    -                   'linux':
                        'https://www.kernel.org/pub/linux/kernel/v4.x/linux-%(version)s.tar.xz',
    +                   'linux':
    'https://git.kernel.org/torvalds/t/linux-%(version)s.tar.gz',
                        'mpc':
    'https://ftp.gnu.org/gnu/mpc/mpc-%(version)s.tar.gz',
                        'mpfr':
    'https://ftp.gnu.org/gnu/mpfr/mpfr-%(version)s.tar.xz'}
             if component not in url_map:
---
 scripts/build-many-glibcs.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 5df42e634a17..73f4d47dba54 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -322,6 +322,25 @@ class Context(object):
                         os_name='linux-gnuspe',
                         variant='e500v1',
                         gcc_cfg=['--disable-multilib', '--enable-secureplt'])
+        self.add_config(arch='riscv64',
+                        os_name='linux-gnu',
+                        glibcs=[{'variant': 'rv64imafdc-lp64d',
+                                 'ccopts': '-march=rv64imafdc -mabi=lp64d',
+                                 'cfg': ['--libdir=/usr/lib64/lp64d',
+                                         'libc_cv_slibdir=/lib64/lp64d',
+                                         'libc_cv_rtlddir=/lib']},
+                                {'variant': 'rv64imac-lp64',
+                                 'ccopts': '-march=rv64imac -mabi=lp64',
+                                 'cfg': ['--libdir=/usr/lib64/lp64',
+                                         'libc_cv_slibdir=/lib64/lp64',
+                                         'libc_cv_rtlddir=/lib']},
+                                {'variant': 'rv32imafdc-ilp32d',
+                                 'ccopts': '-march=rv32imafdc -mabi=ilp32d',
+                                 'cfg': ['--libdir=/usr/lib32/ilp32d',
+                                         'libc_cv_slibdir=/lib32/ilp32d',
+                                         'libc_cv_rtlddir=/lib']},
+                                {'variant': 'rv32imac-ilp32',
+                                 'ccopts': '-march=rv32imac -mabi=ilp32'}])
         self.add_config(arch='s390x',
                         os_name='linux-gnu',
                         glibcs=[{},
@@ -1207,6 +1226,8 @@ class Config(object):
                     'nios2': 'nios2',
                     'powerpc': 'powerpc',
                     's390': 's390',
+                    'riscv32': 'riscv',
+                    'riscv64': 'riscv',
                     'sh': 'sh',
                     'sparc': 'sparc',
                     'tile': 'tile',
-- 
2.13.6

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

* [PATCH v3 12/19] RISC-V: RV32F Support
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (2 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 15/19] RISC-V: Linux Syscall Interface Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01 16:51   ` Joseph Myers
  2017-12-27  6:06 ` [PATCH v3 01/19] Avoid race conditions when rebuilding librt.so Palmer Dabbelt
                   ` (16 subsequent siblings)
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

This contains the base floating-point support for RISC-V, which is
defined by the F extension.  The code in this patch sufficies to
implement RV32F systems only, additional routines are necessary to add
support for RV32D, RV64F, and RV64D.  These additional routines have
been split out to avoid having too large of a patch.
---
 sysdeps/riscv/e_sqrtl.c               |  39 ++++++++
 sysdeps/riscv/rvf/e_sqrtf.c           |  27 ++++++
 sysdeps/riscv/rvf/fclrexcpt.c         |  28 ++++++
 sysdeps/riscv/rvf/fegetenv.c          |  32 +++++++
 sysdeps/riscv/rvf/fegetmode.c         |  27 ++++++
 sysdeps/riscv/rvf/fegetround.c        |  29 ++++++
 sysdeps/riscv/rvf/feholdexcpt.c       |  30 +++++++
 sysdeps/riscv/rvf/fesetenv.c          |  30 +++++++
 sysdeps/riscv/rvf/fesetexcept.c       |  26 ++++++
 sysdeps/riscv/rvf/fesetmode.c         |  31 +++++++
 sysdeps/riscv/rvf/fesetround.c        |  39 ++++++++
 sysdeps/riscv/rvf/feupdateenv.c       |  30 +++++++
 sysdeps/riscv/rvf/fgetexcptflg.c      |  30 +++++++
 sysdeps/riscv/rvf/fraiseexcpt.c       |  30 +++++++
 sysdeps/riscv/rvf/fsetexcptflg.c      |  30 +++++++
 sysdeps/riscv/rvf/ftestexcept.c       |  27 ++++++
 sysdeps/riscv/rvf/get-rounding-mode.h |  32 +++++++
 sysdeps/riscv/rvf/math_private.h      | 161 ++++++++++++++++++++++++++++++++++
 sysdeps/riscv/rvf/s_ceilf.c           |  51 +++++++++++
 sysdeps/riscv/rvf/s_copysignf.c       |  28 ++++++
 sysdeps/riscv/rvf/s_finitef.c         |  28 ++++++
 sysdeps/riscv/rvf/s_floorf.c          |  51 +++++++++++
 sysdeps/riscv/rvf/s_fmaf.c            |  30 +++++++
 sysdeps/riscv/rvf/s_fmaxf.c           |  28 ++++++
 sysdeps/riscv/rvf/s_fminf.c           |  28 ++++++
 sysdeps/riscv/rvf/s_fpclassifyf.c     |  36 ++++++++
 sysdeps/riscv/rvf/s_isinff.c          |  29 ++++++
 sysdeps/riscv/rvf/s_isnanf.c          |  28 ++++++
 sysdeps/riscv/rvf/s_issignalingf.c    |  27 ++++++
 sysdeps/riscv/rvf/s_lroundf.c         |  30 +++++++
 sysdeps/riscv/rvf/s_nearbyintf.c      |  51 +++++++++++
 sysdeps/riscv/rvf/s_rintf.c           |  51 +++++++++++
 sysdeps/riscv/rvf/s_roundevenf.c      |  51 +++++++++++
 sysdeps/riscv/rvf/s_roundf.c          |  51 +++++++++++
 sysdeps/riscv/rvf/s_truncf.c          |  51 +++++++++++
 35 files changed, 1327 insertions(+)
 create mode 100644 sysdeps/riscv/e_sqrtl.c
 create mode 100644 sysdeps/riscv/rvf/e_sqrtf.c
 create mode 100644 sysdeps/riscv/rvf/fclrexcpt.c
 create mode 100644 sysdeps/riscv/rvf/fegetenv.c
 create mode 100644 sysdeps/riscv/rvf/fegetmode.c
 create mode 100644 sysdeps/riscv/rvf/fegetround.c
 create mode 100644 sysdeps/riscv/rvf/feholdexcpt.c
 create mode 100644 sysdeps/riscv/rvf/fesetenv.c
 create mode 100644 sysdeps/riscv/rvf/fesetexcept.c
 create mode 100644 sysdeps/riscv/rvf/fesetmode.c
 create mode 100644 sysdeps/riscv/rvf/fesetround.c
 create mode 100644 sysdeps/riscv/rvf/feupdateenv.c
 create mode 100644 sysdeps/riscv/rvf/fgetexcptflg.c
 create mode 100644 sysdeps/riscv/rvf/fraiseexcpt.c
 create mode 100644 sysdeps/riscv/rvf/fsetexcptflg.c
 create mode 100644 sysdeps/riscv/rvf/ftestexcept.c
 create mode 100644 sysdeps/riscv/rvf/get-rounding-mode.h
 create mode 100644 sysdeps/riscv/rvf/math_private.h
 create mode 100644 sysdeps/riscv/rvf/s_ceilf.c
 create mode 100644 sysdeps/riscv/rvf/s_copysignf.c
 create mode 100644 sysdeps/riscv/rvf/s_finitef.c
 create mode 100644 sysdeps/riscv/rvf/s_floorf.c
 create mode 100644 sysdeps/riscv/rvf/s_fmaf.c
 create mode 100644 sysdeps/riscv/rvf/s_fmaxf.c
 create mode 100644 sysdeps/riscv/rvf/s_fminf.c
 create mode 100644 sysdeps/riscv/rvf/s_fpclassifyf.c
 create mode 100644 sysdeps/riscv/rvf/s_isinff.c
 create mode 100644 sysdeps/riscv/rvf/s_isnanf.c
 create mode 100644 sysdeps/riscv/rvf/s_issignalingf.c
 create mode 100644 sysdeps/riscv/rvf/s_lroundf.c
 create mode 100644 sysdeps/riscv/rvf/s_nearbyintf.c
 create mode 100644 sysdeps/riscv/rvf/s_rintf.c
 create mode 100644 sysdeps/riscv/rvf/s_roundevenf.c
 create mode 100644 sysdeps/riscv/rvf/s_roundf.c
 create mode 100644 sysdeps/riscv/rvf/s_truncf.c

diff --git a/sysdeps/riscv/e_sqrtl.c b/sysdeps/riscv/e_sqrtl.c
new file mode 100644
index 000000000000..e80a5b0d5b7e
--- /dev/null
+++ b/sysdeps/riscv/e_sqrtl.c
@@ -0,0 +1,39 @@
+/* long double square root in software floating-point emulation.
+   Copyright (C) 1997-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com) and
+		  Jakub Jelinek (jj@ultra.linux.cz).
+
+   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 <stdlib.h>
+#include <soft-fp.h>
+#include <quad.h>
+
+long double
+__ieee754_sqrtl (const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(C);
+  long double c;
+
+  FP_INIT_ROUNDMODE;
+  FP_UNPACK_Q(A, a);
+  FP_SQRT_Q(C, A);
+  FP_PACK_Q(c, C);
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}
+strong_alias (__ieee754_sqrtl, __sqrtl_finite)
diff --git a/sysdeps/riscv/rvf/e_sqrtf.c b/sysdeps/riscv/rvf/e_sqrtf.c
new file mode 100644
index 000000000000..b4e440d61556
--- /dev/null
+++ b/sysdeps/riscv/rvf/e_sqrtf.c
@@ -0,0 +1,27 @@
+/* Single precision floating point square root.  RISC-V version.
+   Copyright (C) 2017 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>
+
+float
+__ieee754_sqrtf (float x)
+{
+  asm ("fsqrt.s %0, %1" : "=f" (x) : "f" (x));
+  return x;
+}
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/sysdeps/riscv/rvf/fclrexcpt.c b/sysdeps/riscv/rvf/fclrexcpt.c
new file mode 100644
index 000000000000..5d395b673a21
--- /dev/null
+++ b/sysdeps/riscv/rvf/fclrexcpt.c
@@ -0,0 +1,28 @@
+/* Clear given exceptions in current floating-point environment.
+   Copyright (C) 1998-2017 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 <fenv.h>
+#include <fpu_control.h>
+
+int
+feclearexcept (int excepts)
+{
+  asm volatile ("csrc fflags, %0" : : "r" (excepts));
+  return 0;
+}
+libm_hidden_def (feclearexcept)
diff --git a/sysdeps/riscv/rvf/fegetenv.c b/sysdeps/riscv/rvf/fegetenv.c
new file mode 100644
index 000000000000..100d56268800
--- /dev/null
+++ b/sysdeps/riscv/rvf/fegetenv.c
@@ -0,0 +1,32 @@
+/* Store current floating-point environment.
+   Copyright (C) 1998-2017 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 <fenv.h>
+#include <fpu_control.h>
+
+int
+__fegetenv (fenv_t *envp)
+{
+  _FPU_GETCW (*envp);
+
+  /* Success.  */
+  return 0;
+}
+libm_hidden_def (__fegetenv)
+weak_alias (__fegetenv, fegetenv)
+libm_hidden_weak (fegetenv)
diff --git a/sysdeps/riscv/rvf/fegetmode.c b/sysdeps/riscv/rvf/fegetmode.c
new file mode 100644
index 000000000000..40a9c2aa5ca3
--- /dev/null
+++ b/sysdeps/riscv/rvf/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes.  RISC-V version.
+   Copyright (C) 2017 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 <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetmode (femode_t *modep)
+{
+  _FPU_GETCW (*modep);
+  return 0;
+}
diff --git a/sysdeps/riscv/rvf/fegetround.c b/sysdeps/riscv/rvf/fegetround.c
new file mode 100644
index 000000000000..2c6338d432fd
--- /dev/null
+++ b/sysdeps/riscv/rvf/fegetround.c
@@ -0,0 +1,29 @@
+/* Return current rounding direction.
+   Copyright (C) 1998-2017 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 <fenv.h>
+#include <math_private.h>
+
+int
+__fegetround (void)
+{
+  return riscv_getround ();
+}
+libm_hidden_def (__fegetround)
+weak_alias (__fegetround, fegetround)
+libm_hidden_weak (fegetround)
diff --git a/sysdeps/riscv/rvf/feholdexcpt.c b/sysdeps/riscv/rvf/feholdexcpt.c
new file mode 100644
index 000000000000..2fe0168c6d6d
--- /dev/null
+++ b/sysdeps/riscv/rvf/feholdexcpt.c
@@ -0,0 +1,30 @@
+/* Store current floating-point environment and clear exceptions.
+   Copyright (C) 2000-2017 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 <fenv.h>
+#include <math_private.h>
+
+int
+__feholdexcept (fenv_t *envp)
+{
+  libc_feholdexcept_riscv (envp);
+  return 0;
+}
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/riscv/rvf/fesetenv.c b/sysdeps/riscv/rvf/fesetenv.c
new file mode 100644
index 000000000000..22cebbedf65d
--- /dev/null
+++ b/sysdeps/riscv/rvf/fesetenv.c
@@ -0,0 +1,30 @@
+/* Install given floating-point environment.
+   Copyright (C) 1998-2017 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 <fenv.h>
+#include <math_private.h>
+
+int
+__fesetenv (const fenv_t *envp)
+{
+  libc_fesetenv_riscv (envp);
+  return 0;
+}
+libm_hidden_def (__fesetenv)
+weak_alias (__fesetenv, fesetenv)
+libm_hidden_weak (fesetenv)
diff --git a/sysdeps/riscv/rvf/fesetexcept.c b/sysdeps/riscv/rvf/fesetexcept.c
new file mode 100644
index 000000000000..0e1d33b392ff
--- /dev/null
+++ b/sysdeps/riscv/rvf/fesetexcept.c
@@ -0,0 +1,26 @@
+/* Set given exception flags.  RISC-V version.
+   Copyright (C) 2017 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 <fenv.h>
+
+int
+fesetexcept (int excepts)
+{
+  asm volatile ("csrs fflags, %0" : : "r" (excepts));
+  return 0;
+}
diff --git a/sysdeps/riscv/rvf/fesetmode.c b/sysdeps/riscv/rvf/fesetmode.c
new file mode 100644
index 000000000000..9855cbd7b614
--- /dev/null
+++ b/sysdeps/riscv/rvf/fesetmode.c
@@ -0,0 +1,31 @@
+/* Install given floating-point control modes.  RISC-V version.
+   Copyright (C) 2017 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 <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetmode (const femode_t *modep)
+{
+  asm volatile ("csrc fcsr, %0" : : "r" (~FE_ALL_EXCEPT));
+
+  if (modep != FE_DFL_MODE)
+    asm volatile ("csrs fcsr, %0" : : "r" (*modep & ~FE_ALL_EXCEPT));
+
+  return 0;
+}
diff --git a/sysdeps/riscv/rvf/fesetround.c b/sysdeps/riscv/rvf/fesetround.c
new file mode 100644
index 000000000000..b95e7c08d8c0
--- /dev/null
+++ b/sysdeps/riscv/rvf/fesetround.c
@@ -0,0 +1,39 @@
+/* Set current rounding direction.
+   Copyright (C) 1998-2017 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 <fenv.h>
+#include <math_private.h>
+
+int
+__fesetround (int round)
+{
+  switch (round)
+    {
+    case FE_TONEAREST:
+    case FE_TOWARDZERO:
+    case FE_DOWNWARD:
+    case FE_UPWARD:
+      riscv_setround (round);
+      return 0;
+    default:
+      return round; /* a nonzero value */
+    }
+}
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
diff --git a/sysdeps/riscv/rvf/feupdateenv.c b/sysdeps/riscv/rvf/feupdateenv.c
new file mode 100644
index 000000000000..bf3292aaed70
--- /dev/null
+++ b/sysdeps/riscv/rvf/feupdateenv.c
@@ -0,0 +1,30 @@
+/* Install given floating-point environment and raise exceptions.
+   Copyright (C) 1998-2017 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 <fenv.h>
+#include <math_private.h>
+
+int
+__feupdateenv (const fenv_t *envp)
+{
+  libc_feupdateenv_riscv (envp);
+  return 0;
+}
+libm_hidden_def (__feupdateenv)
+weak_alias (__feupdateenv, feupdateenv)
+libm_hidden_weak (feupdateenv)
diff --git a/sysdeps/riscv/rvf/fgetexcptflg.c b/sysdeps/riscv/rvf/fgetexcptflg.c
new file mode 100644
index 000000000000..8b78fbb0c282
--- /dev/null
+++ b/sysdeps/riscv/rvf/fgetexcptflg.c
@@ -0,0 +1,30 @@
+/* Store current representation for exceptions.
+   Copyright (C) 1998-2017 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 <fenv.h>
+#include <math_private.h>
+
+int
+fegetexceptflag (fexcept_t *flagp, int excepts)
+{
+  /* Get the current exceptions.  */
+  *flagp = riscv_getflags () & excepts;
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/riscv/rvf/fraiseexcpt.c b/sysdeps/riscv/rvf/fraiseexcpt.c
new file mode 100644
index 000000000000..2cdc76213e7f
--- /dev/null
+++ b/sysdeps/riscv/rvf/fraiseexcpt.c
@@ -0,0 +1,30 @@
+/* Raise given exceptions.
+   Copyright (C) 2000-2017 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 <fenv.h>
+#include <fpu_control.h>
+
+int
+__feraiseexcept (int excepts)
+{
+  asm volatile ("csrs fflags, %0" : : "r" (excepts));
+  return 0;
+}
+libm_hidden_def (__feraiseexcept)
+weak_alias (__feraiseexcept, feraiseexcept)
+libm_hidden_weak (feraiseexcept)
diff --git a/sysdeps/riscv/rvf/fsetexcptflg.c b/sysdeps/riscv/rvf/fsetexcptflg.c
new file mode 100644
index 000000000000..e1399d7d610a
--- /dev/null
+++ b/sysdeps/riscv/rvf/fsetexcptflg.c
@@ -0,0 +1,30 @@
+/* Set floating-point environment exception handling.
+   Copyright (C) 1998-2017 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 <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetexceptflag (const fexcept_t *flagp, int excepts)
+{
+  fexcept_t flags = *flagp;
+  asm volatile ("csrc fflags, %0" : : "r" (excepts));
+  asm volatile ("csrs fflags, %0" : : "r" (flags & excepts));
+
+  return 0;
+}
diff --git a/sysdeps/riscv/rvf/ftestexcept.c b/sysdeps/riscv/rvf/ftestexcept.c
new file mode 100644
index 000000000000..c65f26ca412f
--- /dev/null
+++ b/sysdeps/riscv/rvf/ftestexcept.c
@@ -0,0 +1,27 @@
+/* Test exception in current environment.
+   Copyright (C) 1998-2017 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 <fenv.h>
+#include <math_private.h>
+
+int
+fetestexcept (int excepts)
+{
+  return libc_fetestexcept_riscv (excepts);
+}
+libm_hidden_def (fetestexcept)
diff --git a/sysdeps/riscv/rvf/get-rounding-mode.h b/sysdeps/riscv/rvf/get-rounding-mode.h
new file mode 100644
index 000000000000..dd380fa5b1b8
--- /dev/null
+++ b/sysdeps/riscv/rvf/get-rounding-mode.h
@@ -0,0 +1,32 @@
+/* Determine floating-point rounding mode within libc.  RISC-V version.
+   Copyright (C) 2015-2017 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 _RISCV_GET_ROUNDING_MODE_H
+#define _RISCV_GET_ROUNDING_MODE_H
+
+/* Return the floating-point rounding mode.  */
+
+static inline int
+get_rounding_mode (void)
+{
+  int rm;
+  asm volatile ("frrm %0" : "=r" (rm));
+  return rm;
+}
+
+#endif /* get-rounding-mode.h */
diff --git a/sysdeps/riscv/rvf/math_private.h b/sysdeps/riscv/rvf/math_private.h
new file mode 100644
index 000000000000..cbb9a41e4c51
--- /dev/null
+++ b/sysdeps/riscv/rvf/math_private.h
@@ -0,0 +1,161 @@
+/* Private floating point rounding and exceptions handling.  RISC-V version.
+   Copyright (C) 2014-2017 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 RISCV_MATH_PRIVATE_H
+#define RISCV_MATH_PRIVATE_H 1
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <get-rounding-mode.h>
+
+static __always_inline int
+riscv_getround (void)
+{
+  return get_rounding_mode ();
+}
+
+static __always_inline void
+riscv_setround (int rm)
+{
+  asm volatile ("fsrm %z0" : : "rJ" (rm));
+}
+
+static __always_inline int
+riscv_getflags (void)
+{
+  int flags;
+  asm volatile ("frflags %0" : "=r" (flags));
+  return flags;
+}
+
+static __always_inline void
+riscv_setflags (int flags)
+{
+  asm volatile ("fsflags %z0" : : "rJ" (flags));
+}
+
+static __always_inline void
+libc_feholdexcept_riscv (fenv_t *envp)
+{
+  asm volatile ("csrrc %0, fcsr, %1" : "=r" (*envp) : "i" (FE_ALL_EXCEPT));
+}
+
+#define libc_feholdexcept  libc_feholdexcept_riscv
+#define libc_feholdexceptf libc_feholdexcept_riscv
+#define libc_feholdexceptl libc_feholdexcept_riscv
+
+static __always_inline void
+libc_fesetround_riscv (int round)
+{
+  riscv_setround (round);
+}
+
+#define libc_fesetround  libc_fesetround_riscv
+#define libc_fesetroundf libc_fesetround_riscv
+#define libc_fesetroundl libc_fesetround_riscv
+
+static __always_inline void
+libc_feholdexcept_setround_riscv (fenv_t *envp, int round)
+{
+  libc_fesetround_riscv (round);
+  libc_feholdexcept_riscv (envp);
+}
+
+#define libc_feholdexcept_setround  libc_feholdexcept_setround_riscv
+#define libc_feholdexcept_setroundf libc_feholdexcept_setround_riscv
+#define libc_feholdexcept_setroundl libc_feholdexcept_setround_riscv
+
+static __always_inline int
+libc_fetestexcept_riscv (int ex)
+{
+  return riscv_getflags () & ex;
+}
+
+#define libc_fetestexcept  libc_fetestexcept_riscv
+#define libc_fetestexceptf libc_fetestexcept_riscv
+#define libc_fetestexceptl libc_fetestexcept_riscv
+
+static __always_inline void
+libc_fesetenv_riscv (const fenv_t *envp)
+{
+  long env = (long) envp - (long) FE_DFL_ENV;
+  if (env != 0)
+    env = *envp;
+
+  _FPU_SETCW (env);
+}
+
+#define libc_fesetenv  libc_fesetenv_riscv
+#define libc_fesetenvf libc_fesetenv_riscv
+#define libc_fesetenvl libc_fesetenv_riscv
+#define libc_feresetround_noex  libc_fesetenv_riscv
+#define libc_feresetround_noexf libc_fesetenv_riscv
+#define libc_feresetround_noexl libc_fesetenv_riscv
+
+static __always_inline int
+libc_feupdateenv_test_riscv (const fenv_t *envp, int ex)
+{
+  fenv_t env = *envp;
+  int flags = riscv_getflags ();
+  asm volatile ("csrw fcsr, %z0" : : "rJ" (env | flags));
+  return flags & ex;
+}
+
+#define libc_feupdateenv_test  libc_feupdateenv_test_riscv
+#define libc_feupdateenv_testf libc_feupdateenv_test_riscv
+#define libc_feupdateenv_testl libc_feupdateenv_test_riscv
+
+static __always_inline void
+libc_feupdateenv_riscv (const fenv_t *envp)
+{
+  _FPU_SETCW (*envp | riscv_getflags ());
+}
+
+#define libc_feupdateenv  libc_feupdateenv_riscv
+#define libc_feupdateenvf libc_feupdateenv_riscv
+#define libc_feupdateenvl libc_feupdateenv_riscv
+
+static __always_inline void
+libc_feholdsetround_riscv (fenv_t *envp, int round)
+{
+  /* Note this implementation makes an improperly-formatted fenv_t and
+     so should only be used in conjunction with libc_feresetround.  */
+  int old_round;
+  asm volatile ("csrrw %0, frm, %z1" : "=r" (old_round) : "rJ" (round));
+  *envp = old_round;
+}
+
+#define libc_feholdsetround  libc_feholdsetround_riscv
+#define libc_feholdsetroundf libc_feholdsetround_riscv
+#define libc_feholdsetroundl libc_feholdsetround_riscv
+
+static __always_inline void
+libc_feresetround_riscv (fenv_t *envp)
+{
+  /* Note this implementation takes an improperly-formatted fenv_t and
+     so should only be used in conjunction with libc_feholdsetround.  */
+  riscv_setround (*envp);
+}
+
+#define libc_feresetround  libc_feresetround_riscv
+#define libc_feresetroundf libc_feresetround_riscv
+#define libc_feresetroundl libc_feresetround_riscv
+
+#include_next <math_private.h>
+
+#endif
diff --git a/sysdeps/riscv/rvf/s_ceilf.c b/sysdeps/riscv/rvf/s_ceilf.c
new file mode 100644
index 000000000000..031308b78e62
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_ceilf.c
@@ -0,0 +1,51 @@
+/* ceilf().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-float.h>
+
+float
+__ceilf (float x)
+{
+  int flags = riscv_getflags ();
+  bool nan = isnan (x);
+  float mag = fabsf (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1 << __FLT_MANT_DIG__))
+    {
+      int i;
+      float new_x;
+
+      asm volatile ("fcvt.w.s %0, %1, rup" : "=r" (i) : "f" (x));
+      asm volatile ("fcvt.s.w %0, %1, rup" : "=f" (new_x) : "r" (i));
+
+      /* ceil(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysignf (new_x, x);
+
+      riscv_setflags (flags);
+    }
+
+  return x;
+}
+
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/riscv/rvf/s_copysignf.c b/sysdeps/riscv/rvf/s_copysignf.c
new file mode 100644
index 000000000000..7628701b9f04
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_copysignf.c
@@ -0,0 +1,28 @@
+/* copysignf().  RISC-V version.
+   Copyright (C) 2017 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>
+
+float
+__copysignf (float x, float y)
+{
+  asm ("fsgnj.s %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
+  return x;
+}
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/riscv/rvf/s_finitef.c b/sysdeps/riscv/rvf/s_finitef.c
new file mode 100644
index 000000000000..16e7de18838e
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_finitef.c
@@ -0,0 +1,28 @@
+/* finitef().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+
+int
+__finitef (float x)
+{
+  return _FCLASS (x) & ~(_FCLASS_INF | _FCLASS_NAN);
+}
+hidden_def (__finitef)
+weak_alias (__finitef, finitef)
diff --git a/sysdeps/riscv/rvf/s_floorf.c b/sysdeps/riscv/rvf/s_floorf.c
new file mode 100644
index 000000000000..a99e594974c0
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_floorf.c
@@ -0,0 +1,51 @@
+/* floorf().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-float.h>
+
+float
+__floorf (float x)
+{
+  int flags = riscv_getflags ();
+  bool nan = isnan (x);
+  float mag = fabsf (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1 << __FLT_MANT_DIG__))
+    {
+      int i;
+      float new_x;
+
+      asm volatile ("fcvt.w.s %0, %1, rdn" : "=r" (i) : "f" (x));
+      asm volatile ("fcvt.s.w %0, %1, rdn" : "=f" (new_x) : "r" (i));
+
+      /* floor(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysignf (new_x, x);
+
+      riscv_setflags (flags);
+    }
+
+  return x;
+}
+
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/riscv/rvf/s_fmaf.c b/sysdeps/riscv/rvf/s_fmaf.c
new file mode 100644
index 000000000000..13cb4488dcef
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_fmaf.c
@@ -0,0 +1,30 @@
+/* fmaf().  RISC-V version.
+   Copyright (C) 2017 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 <fenv.h>
+#include <ieee754.h>
+#include <libm-alias-float.h>
+
+float
+__fmaf (float x, float y, float z)
+{
+  asm ("fmadd.s %0, %1, %2, %3" : "=f" (x) : "f" (x), "f" (y), "f" (z));
+  return x;
+}
+libm_alias_float (__fma, fma)
diff --git a/sysdeps/riscv/rvf/s_fmaxf.c b/sysdeps/riscv/rvf/s_fmaxf.c
new file mode 100644
index 000000000000..f97ecd87ccaa
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_fmaxf.c
@@ -0,0 +1,28 @@
+/* fmaxf().  RISC-V version.
+   Copyright (C) 2017 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>
+
+float
+__fmaxf (float x, float y)
+{
+  asm ("fmax.s %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
+  return x;
+}
+libm_alias_float (__fmax, fmax)
diff --git a/sysdeps/riscv/rvf/s_fminf.c b/sysdeps/riscv/rvf/s_fminf.c
new file mode 100644
index 000000000000..eb1197fb20fb
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_fminf.c
@@ -0,0 +1,28 @@
+/* fminf().  RISC-V version.
+   Copyright (C) 2017 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>
+
+float
+__fminf (float x, float y)
+{
+  asm ("fmin.s %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
+  return x;
+}
+libm_alias_float (__fmin, fmin)
diff --git a/sysdeps/riscv/rvf/s_fpclassifyf.c b/sysdeps/riscv/rvf/s_fpclassifyf.c
new file mode 100644
index 000000000000..015b9de48b4f
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_fpclassifyf.c
@@ -0,0 +1,36 @@
+/* fpclassifyf().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+
+int
+__fpclassifyf (float x)
+{
+  int cls = _FCLASS (x);
+  if (__builtin_expect (cls & _FCLASS_NORM, _FCLASS_NORM))
+    return FP_NORMAL;
+  if (__builtin_expect (cls & _FCLASS_ZERO, _FCLASS_ZERO))
+    return FP_ZERO;
+  if (__builtin_expect (cls & _FCLASS_SUBNORM, _FCLASS_SUBNORM))
+    return FP_SUBNORMAL;
+  if (__builtin_expect (cls & _FCLASS_INF, _FCLASS_INF))
+    return FP_INFINITE;
+  return FP_NAN;
+}
+libm_hidden_def (__fpclassifyf)
diff --git a/sysdeps/riscv/rvf/s_isinff.c b/sysdeps/riscv/rvf/s_isinff.c
new file mode 100644
index 000000000000..ecfb15121330
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_isinff.c
@@ -0,0 +1,29 @@
+/* isinff().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+
+int
+__isinff (float x)
+{
+  int cls = _FCLASS (x);
+  return -((cls & _FCLASS_MINF) ? 1 : 0) | ((cls & _FCLASS_PINF) ? 1 : 0);
+}
+hidden_def (__isinff)
+weak_alias (__isinff, isinff)
diff --git a/sysdeps/riscv/rvf/s_isnanf.c b/sysdeps/riscv/rvf/s_isnanf.c
new file mode 100644
index 000000000000..51a9cf3ff3a7
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_isnanf.c
@@ -0,0 +1,28 @@
+/* isnanf().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+
+int
+__isnanf (float x)
+{
+  return _FCLASS (x) & _FCLASS_NAN;
+}
+hidden_def (__isnanf)
+weak_alias (__isnanf, isnanf)
diff --git a/sysdeps/riscv/rvf/s_issignalingf.c b/sysdeps/riscv/rvf/s_issignalingf.c
new file mode 100644
index 000000000000..a611aa92fa86
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_issignalingf.c
@@ -0,0 +1,27 @@
+/* issignalingf().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+
+int
+__issignalingf (float x)
+{
+  return _FCLASS (x) & _FCLASS_SNAN;
+}
+libm_hidden_def (__issignalingf)
diff --git a/sysdeps/riscv/rvf/s_lroundf.c b/sysdeps/riscv/rvf/s_lroundf.c
new file mode 100644
index 000000000000..eeed23c14c95
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_lroundf.c
@@ -0,0 +1,30 @@
+/* lroundf().  RISC-V version.
+   Copyright (C) 2017 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>
+
+long
+__lroundf (float x)
+{
+  long res;
+  asm ("fcvt.w.s %0, %1, rmm" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/riscv/rvf/s_nearbyintf.c b/sysdeps/riscv/rvf/s_nearbyintf.c
new file mode 100644
index 000000000000..08f318be2d98
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_nearbyintf.c
@@ -0,0 +1,51 @@
+/* Round to int floating-point values.  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-float.h>
+
+float
+__nearbyintf (float x)
+{
+  int flags = riscv_getflags ();
+  bool nan = isnan (x);
+  float mag = fabsf (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1 << __FLT_MANT_DIG__))
+    {
+      int i;
+      float new_x;
+
+      asm volatile ("fcvt.w.s %0, %1" : "=r" (i) : "f" (x));
+      asm volatile ("fcvt.s.w %0, %1" : "=f" (new_x) : "r" (i));
+
+      /* nearbyint(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysignf (new_x, x);
+
+      riscv_setflags (flags);
+    }
+
+  return x;
+}
+
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/riscv/rvf/s_rintf.c b/sysdeps/riscv/rvf/s_rintf.c
new file mode 100644
index 000000000000..ff5f9ddafb10
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_rintf.c
@@ -0,0 +1,51 @@
+/* rintf().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-float.h>
+
+float
+__rintf (float x)
+{
+  bool nan;
+  float mag;
+
+  nan = isnan (x);
+  mag = fabsf (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1 << __FLT_MANT_DIG__))
+    {
+      int i;
+      float new_x;
+
+      asm ("fcvt.w.s %0, %1" : "=r" (i) : "f" (x));
+      asm ("fcvt.s.w %0, %1" : "=f" (new_x) : "r" (i));
+
+      /* rint(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysignf (new_x, x);
+    }
+
+  return x;
+}
+
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/riscv/rvf/s_roundevenf.c b/sysdeps/riscv/rvf/s_roundevenf.c
new file mode 100644
index 000000000000..e539112d8993
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_roundevenf.c
@@ -0,0 +1,51 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-float.h>
+
+float
+__roundevenf (float x)
+{
+  int flags = riscv_getflags ();
+  bool nan = isnan (x);
+  float mag = fabsf (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1 << __FLT_MANT_DIG__))
+    {
+      int i;
+      float new_x;
+
+      asm volatile ("fcvt.w.s %0, %1, rne" : "=r" (i) : "f" (x));
+      asm volatile ("fcvt.s.w %0, %1, rne" : "=f" (new_x) : "r" (i));
+
+      /* roundeven(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysignf (new_x, x);
+
+      riscv_setflags (flags);
+    }
+
+  return x;
+}
+
+libm_alias_float (__roundeven, roundeven)
diff --git a/sysdeps/riscv/rvf/s_roundf.c b/sysdeps/riscv/rvf/s_roundf.c
new file mode 100644
index 000000000000..bd48710b329d
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_roundf.c
@@ -0,0 +1,51 @@
+/* roundf().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-float.h>
+
+float
+__roundf (float x)
+{
+  int flags = riscv_getflags ();
+  bool nan = isnan (x);
+  float mag = fabsf (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1 << __FLT_MANT_DIG__))
+    {
+      int i;
+      float new_x;
+
+      asm volatile ("fcvt.w.s %0, %1, rmm" : "=r" (i) : "f" (x));
+      asm volatile ("fcvt.s.w %0, %1, rmm" : "=f" (new_x) : "r" (i));
+
+      /* round(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysignf (new_x, x);
+
+      riscv_setflags (flags);
+    }
+
+  return x;
+}
+
+libm_alias_float (__round, round)
diff --git a/sysdeps/riscv/rvf/s_truncf.c b/sysdeps/riscv/rvf/s_truncf.c
new file mode 100644
index 000000000000..882365d311b0
--- /dev/null
+++ b/sysdeps/riscv/rvf/s_truncf.c
@@ -0,0 +1,51 @@
+/* truncf().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-float.h>
+
+float
+__truncf (float x)
+{
+  int flags = riscv_getflags ();
+  bool nan = isnan (x);
+  float mag = fabsf (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1 << __FLT_MANT_DIG__))
+    {
+      int i;
+      float new_x;
+
+      asm volatile ("fcvt.w.s %0, %1, rtz" : "=r" (i) : "f" (x));
+      asm volatile ("fcvt.s.w %0, %1, rtz" : "=f" (new_x) : "r" (i));
+
+      /* trunc(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysignf (new_x, x);
+
+      riscv_setflags (flags);
+    }
+
+  return x;
+}
+
+libm_alias_float (__trunc, trunc)
-- 
2.13.6

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

* [PATCH v3 14/19] RISC-V: Atomic and Locking Routines
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (16 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 04/19] Skeleton documentation for the RISC-V port Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01 17:12   ` Joseph Myers
  2017-12-27  6:06 ` [PATCH v3 18/19] RISC-V: Add ABI Lists Palmer Dabbelt
                   ` (2 subsequent siblings)
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

This patch implements various atomic and locking routines on RISC-V.  We
mandate the A extension on Linux-capable RISC-V systems, so this can
rely on always having the various atomic instructions availiable.
---
 sysdeps/riscv/nptl/bits/pthreadtypes-arch.h    |  76 ++++++++++
 sysdeps/riscv/nptl/bits/semaphore.h            |  33 +++++
 sysdeps/riscv/nptl/libc-lowlevellock.c         |   8 +
 sysdeps/unix/sysv/linux/riscv/atomic-machine.h | 194 +++++++++++++++++++++++++
 4 files changed, 311 insertions(+)
 create mode 100644 sysdeps/riscv/nptl/bits/pthreadtypes-arch.h
 create mode 100644 sysdeps/riscv/nptl/bits/semaphore.h
 create mode 100644 sysdeps/riscv/nptl/libc-lowlevellock.c
 create mode 100644 sysdeps/unix/sysv/linux/riscv/atomic-machine.h

diff --git a/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h b/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 000000000000..4fabc4a2cde2
--- /dev/null
+++ b/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,76 @@
+/* Machine-specific pthread type layouts.  RISC-V version.
+   Copyright (C) 2011-2017 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_PTHREADTYPES_ARCH_H
+#define _BITS_PTHREADTYPES_ARCH_H	1
+
+#include <endian.h>
+
+#if __riscv_xlen == 64
+# define __SIZEOF_PTHREAD_ATTR_T 		56
+# define __SIZEOF_PTHREAD_MUTEX_T 		40
+# define __SIZEOF_PTHREAD_MUTEXATTR_T 		 4
+# define __SIZEOF_PTHREAD_COND_T 		48
+# define __SIZEOF_PTHREAD_CONDATTR_T 		 4
+# define __SIZEOF_PTHREAD_RWLOCK_T 		56
+# define __SIZEOF_PTHREAD_RWLOCKATTR_T 		 8
+# define __SIZEOF_PTHREAD_BARRIER_T 		32
+# define __SIZEOF_PTHREAD_BARRIERATTR_T 	 4
+#else
+# 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
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_LOCK_ELISION		0
+#define __PTHREAD_MUTEX_USE_UNION	 	0
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND	0
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+/* There is a lot of padding in this structure.  While it's not strictly
+   necessary on RISC-V, we're going to leave it in to be on the safe side in
+   case it's needed in the future.  Most other architectures have the padding,
+   so this gives us the same extensibility as everyone else has.  */
+struct __pthread_rwlock_arch_t
+{
+  unsigned int __readers;
+  unsigned int __writers;
+  unsigned int __wrphase_futex;
+  unsigned int __writers_futex;
+  unsigned int __pad3;
+  unsigned int __pad4;
+  int __cur_writer;
+  int __shared;
+  unsigned long int __pad1;
+  unsigned long int __pad2;
+  unsigned int __flags;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 		0
+
+#endif	/* bits/pthreadtypes.h */
diff --git a/sysdeps/riscv/nptl/bits/semaphore.h b/sysdeps/riscv/nptl/bits/semaphore.h
new file mode 100644
index 000000000000..db6bfba34324
--- /dev/null
+++ b/sysdeps/riscv/nptl/bits/semaphore.h
@@ -0,0 +1,33 @@
+/* Machine-specific POSIX semaphore type layouts.  RISC-V version.
+   Copyright (C) 2002-2017 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 _SEMAPHORE_H
+# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
+#endif
+
+#define __SIZEOF_SEM_T	(4 * __SIZEOF_POINTER__)
+
+/* Value returned if `sem_open' failed.  */
+#define SEM_FAILED      ((sem_t *) 0)
+
+
+typedef union
+{
+  char __size[__SIZEOF_SEM_T];
+  long int __align;
+} sem_t;
diff --git a/sysdeps/riscv/nptl/libc-lowlevellock.c b/sysdeps/riscv/nptl/libc-lowlevellock.c
new file mode 100644
index 000000000000..0ecd41e630f3
--- /dev/null
+++ b/sysdeps/riscv/nptl/libc-lowlevellock.c
@@ -0,0 +1,8 @@
+/* This kludge works around a libpthread static linking problem:
+   https://sourceware.org/bugzilla/show_bug.cgi?id=15648 */
+
+#ifndef SHARED
+# define __lll_lock_wait_private weak_function __lll_lock_wait_private
+#endif
+
+#include <lowlevellock.c>
diff --git a/sysdeps/unix/sysv/linux/riscv/atomic-machine.h b/sysdeps/unix/sysv/linux/riscv/atomic-machine.h
new file mode 100644
index 000000000000..73be0298ca6f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/atomic-machine.h
@@ -0,0 +1,194 @@
+/* Low-level functions for atomic operations. RISC-V version.
+   Copyright (C) 2014-2017 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 _LINUX_RISCV_BITS_ATOMIC_H
+#define _LINUX_RISCV_BITS_ATOMIC_H 1
+
+#include <inttypes.h>
+
+typedef int32_t atomic32_t;
+typedef uint32_t uatomic32_t;
+
+typedef int64_t atomic64_t;
+typedef uint64_t uatomic64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+#define atomic_full_barrier() __sync_synchronize()
+
+#ifdef __riscv_atomic
+
+# define __HAVE_64B_ATOMICS (__riscv_xlen >= 64)
+# define USE_ATOMIC_COMPILER_BUILTINS 1
+# define ATOMIC_EXCHANGE_USES_CAS 0
+
+/* Compare and exchange.
+   For all "bool" routines, we return FALSE if exchange succesful.  */
+
+# define __arch_compare_and_exchange_bool_8_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    !__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				  model, __ATOMIC_RELAXED);		\
+  })
+
+# define __arch_compare_and_exchange_bool_16_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    !__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				  model, __ATOMIC_RELAXED);		\
+  })
+
+# define __arch_compare_and_exchange_bool_32_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    !__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				  model, __ATOMIC_RELAXED);		\
+  })
+
+#  define __arch_compare_and_exchange_bool_64_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    !__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				  model, __ATOMIC_RELAXED);		\
+  })
+
+# define __arch_compare_and_exchange_val_8_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				 model, __ATOMIC_RELAXED);		\
+    __oldval;								\
+  })
+
+# define __arch_compare_and_exchange_val_16_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				 model, __ATOMIC_RELAXED);		\
+    __oldval;								\
+  })
+
+# define __arch_compare_and_exchange_val_32_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				 model, __ATOMIC_RELAXED);		\
+    __oldval;								\
+  })
+
+# define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				 model, __ATOMIC_RELAXED);		\
+    __oldval;								\
+  })
+
+/* Atomic compare and exchange. */
+
+# define atomic_compare_and_exchange_bool_acq(mem, new, old)	\
+  __atomic_bool_bysize (__arch_compare_and_exchange_bool, int,	\
+			mem, new, old, __ATOMIC_ACQUIRE)
+
+# define atomic_compare_and_exchange_val_acq(mem, new, old)	\
+  __atomic_val_bysize (__arch_compare_and_exchange_val, int,	\
+		       mem, new, old, __ATOMIC_ACQUIRE)
+
+# define atomic_compare_and_exchange_val_rel(mem, new, old)	 \
+  __atomic_val_bysize (__arch_compare_and_exchange_val, int,    \
+                       mem, new, old, __ATOMIC_RELEASE)
+
+/* Atomic exchange (without compare).  */
+
+# define __arch_exchange_8_int(mem, newval, model)	\
+  __atomic_exchange_n (mem, newval, model)
+
+# define __arch_exchange_16_int(mem, newval, model)	\
+  __atomic_exchange_n (mem, newval, model)
+
+# define __arch_exchange_32_int(mem, newval, model)	\
+  __atomic_exchange_n (mem, newval, model)
+
+#  define __arch_exchange_64_int(mem, newval, model)	\
+  __atomic_exchange_n (mem, newval, model)
+
+# define atomic_exchange_acq(mem, value)				\
+  __atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_ACQUIRE)
+
+# define atomic_exchange_rel(mem, value)				\
+  __atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_RELEASE)
+
+/* Atomically add value and return the previous (unincremented) value.  */
+
+# define __arch_exchange_and_add_8_int(mem, value, model)	\
+  __atomic_fetch_add (mem, value, model)
+
+# define __arch_exchange_and_add_16_int(mem, value, model)	\
+  __atomic_fetch_add (mem, value, model)
+
+# define __arch_exchange_and_add_32_int(mem, value, model)	\
+  __atomic_fetch_add (mem, value, model)
+
+#  define __arch_exchange_and_add_64_int(mem, value, model)	\
+  __atomic_fetch_add (mem, value, model)
+
+# define atomic_exchange_and_add_acq(mem, value)			\
+  __atomic_val_bysize (__arch_exchange_and_add, int, mem, value,	\
+		       __ATOMIC_ACQUIRE)
+
+# define atomic_exchange_and_add_rel(mem, value)			\
+  __atomic_val_bysize (__arch_exchange_and_add, int, mem, value,	\
+		       __ATOMIC_RELEASE)
+
+/* Miscellaneous. */
+
+# define asm_amo(which, ordering, mem, value) ({ 		\
+  __atomic_check_size(mem);					\
+  typeof(*mem) __tmp; 						\
+  if (sizeof(__tmp) == 4)					\
+    asm volatile (which ".w" ordering "\t%0, %z2, %1"		\
+		  : "=r"(__tmp), "+A"(*(mem))			\
+		  : "rJ"(value));				\
+  else if (sizeof(__tmp) == 8)					\
+    asm volatile (which ".d" ordering "\t%0, %z2, %1"		\
+		  : "=r"(__tmp), "+A"(*(mem))			\
+		  : "rJ"(value));				\
+  else								\
+    abort();							\
+  __tmp; })
+
+# define atomic_max(mem, value) asm_amo("amomaxu", ".aq", mem, value)
+# define atomic_min(mem, value) asm_amo("amominu", ".aq", mem, value)
+
+# define atomic_bit_test_set(mem, bit)                   \
+  ({ typeof(*mem) __mask = (typeof(*mem))1 << (bit);    \
+     asm_amo("amoor", ".aq", mem, __mask) & __mask; })
+
+# define catomic_exchange_and_add(mem, value)		\
+  atomic_exchange_and_add(mem, value)
+# define catomic_max(mem, value) atomic_max(mem, value)
+
+#else /* __riscv_atomic */
+# error "ISAs that do not subsume the A extension are not supported"
+#endif /* !__riscv_atomic */
+
+#endif /* bits/atomic.h */
-- 
2.13.6

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

* [PATCH v3 17/19] RISC-V: Linux Startup and Dynamic Loading Code
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (6 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 03/19] Add linux-4.15 VDSO hash for RISC-V Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01 17:35   ` Joseph Myers
  2017-12-27  6:06 ` [PATCH v3 08/19] RISC-V: ABI Implementation Palmer Dabbelt
                   ` (12 subsequent siblings)
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

This contains the Linux-specific code for loading programs on RISC-V.
---
 sysdeps/unix/sysv/linux/riscv/dl-static.c | 84 +++++++++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/riscv/ldconfig.h  | 37 ++++++++++++++
 sysdeps/unix/sysv/linux/riscv/ldsodefs.h  | 32 ++++++++++++
 3 files changed, 153 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/riscv/dl-static.c
 create mode 100644 sysdeps/unix/sysv/linux/riscv/ldconfig.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/ldsodefs.h

diff --git a/sysdeps/unix/sysv/linux/riscv/dl-static.c b/sysdeps/unix/sysv/linux/riscv/dl-static.c
new file mode 100644
index 000000000000..e5572d1fffe2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/dl-static.c
@@ -0,0 +1,84 @@
+/* Variable initialization.  RISC-V version
+   Copyright (C) 2001-2017 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 <ldsodefs.h>
+
+#ifdef SHARED
+
+void
+_dl_var_init (void *array[])
+{
+  /* It has to match "variables" below. */
+  enum
+    {
+      DL_PAGESIZE = 0
+    };
+
+  GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
+}
+
+#else
+
+static void *variables[] =
+{
+  &GLRO(dl_pagesize)
+};
+
+static void
+_dl_unprotect_relro (struct link_map *l)
+{
+  ElfW(Addr) start = ((l->l_addr + l->l_relro_addr)
+		      & ~(GLRO(dl_pagesize) - 1));
+  ElfW(Addr) end = ((l->l_addr + l->l_relro_addr + l->l_relro_size)
+		    & ~(GLRO(dl_pagesize) - 1));
+
+  if (start != end)
+    __mprotect ((void *) start, end - start, PROT_READ | PROT_WRITE);
+}
+
+void
+_dl_static_init (struct link_map *l)
+{
+  struct link_map *rtld_map = l;
+  struct r_scope_elem **scope;
+  const ElfW(Sym) *ref = NULL;
+  lookup_t loadbase;
+  void (*f) (void *[]);
+  size_t i;
+
+  loadbase = _dl_lookup_symbol_x ("_dl_var_init", l, &ref, l->l_local_scope,
+				  NULL, 0, 1, NULL);
+
+  for (scope = l->l_local_scope; *scope != NULL; scope++)
+    for (i = 0; i < (*scope)->r_nlist; i++)
+      if ((*scope)->r_list[i] == loadbase)
+	{
+	  rtld_map = (*scope)->r_list[i];
+	  break;
+	}
+
+  if (ref != NULL)
+    {
+      f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
+      _dl_unprotect_relro (rtld_map);
+      f (variables);
+      _dl_protect_relro (rtld_map);
+    }
+}
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/riscv/ldconfig.h b/sysdeps/unix/sysv/linux/riscv/ldconfig.h
new file mode 100644
index 000000000000..de1f2a8ad811
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/ldconfig.h
@@ -0,0 +1,37 @@
+/* ldconfig default paths and libraries.  Linux/RISC-V version.
+   Copyright (C) 2001-2017 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 <sysdeps/generic/ldconfig.h>
+
+#define LD_SO_PREFIX "/lib/ld-linux-"
+#define LD_SO_SUFFIX ".so.1"
+
+#if __riscv_xlen == 64
+# define LD_SO_ABI "riscv64-lp64"
+#else
+# define LD_SO_ABI "riscv32-ilp32"
+#endif
+
+#define SYSDEP_KNOWN_INTERPRETER_NAMES				\
+  { LD_SO_PREFIX LD_SO_ABI "d" LD_SO_SUFFIX, FLAG_ELF_LIBC6 },	\
+  { LD_SO_PREFIX LD_SO_ABI "f" LD_SO_SUFFIX, FLAG_ELF_LIBC6 },	\
+  { LD_SO_PREFIX LD_SO_ABI     LD_SO_SUFFIX, FLAG_ELF_LIBC6 },
+
+#define SYSDEP_KNOWN_LIBRARY_NAMES	\
+  { "libc.so.6", FLAG_ELF_LIBC6 },	\
+  { "libm.so.6", FLAG_ELF_LIBC6 },
diff --git a/sysdeps/unix/sysv/linux/riscv/ldsodefs.h b/sysdeps/unix/sysv/linux/riscv/ldsodefs.h
new file mode 100644
index 000000000000..314de0b201d5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/ldsodefs.h
@@ -0,0 +1,32 @@
+/* RISC-V dynamic linker data structures for loaded ELF shared objects.
+   Copyright (C) 2001-2017 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	_LDSODEFS_H
+
+/* Get the real definitions.  */
+#include_next <ldsodefs.h>
+
+/* Now define our stuff.  */
+
+/* We need special support to initialize DSO loaded for statically linked
+   binaries.  */
+extern void _dl_static_init (struct link_map *map);
+#undef DL_STATIC_INIT
+#define DL_STATIC_INIT(map) _dl_static_init (map)
+
+#endif /* ldsodefs.h */
-- 
2.13.6

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

* [PATCH v3 15/19] RISC-V: Linux Syscall Interface
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
  2017-12-27  6:05 ` [PATCH v3 02/19] Allow make-link-multidir to make subdirectories Palmer Dabbelt
  2017-12-27  6:06 ` [PATCH v3 19/19] Add RISC-V to build-many-glibcs.py Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01 17:18   ` Joseph Myers
  2018-01-05 14:04   ` Adhemerval Zanella
  2017-12-27  6:06 ` [PATCH v3 12/19] RISC-V: RV32F Support Palmer Dabbelt
                   ` (17 subsequent siblings)
  20 siblings, 2 replies; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

Contains the Linux system call interface, as well as the definitions of
a handful of system calls.
---
 sysdeps/riscv/nptl/nptl-sysdep.S               |   2 +
 sysdeps/unix/sysv/linux/riscv/arch-fork.h      |  27 +++
 sysdeps/unix/sysv/linux/riscv/clone.S          |  85 +++++++
 sysdeps/unix/sysv/linux/riscv/profil-counter.h |  31 +++
 sysdeps/unix/sysv/linux/riscv/pt-vfork.S       |  43 ++++
 sysdeps/unix/sysv/linux/riscv/rv32/lockf64.c   |  70 ++++++
 sysdeps/unix/sysv/linux/riscv/syscall.c        |  38 +++
 sysdeps/unix/sysv/linux/riscv/sysdep.S         |  51 ++++
 sysdeps/unix/sysv/linux/riscv/sysdep.h         | 316 +++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/riscv/vfork.S          |  44 ++++
 10 files changed, 707 insertions(+)
 create mode 100644 sysdeps/riscv/nptl/nptl-sysdep.S
 create mode 100644 sysdeps/unix/sysv/linux/riscv/arch-fork.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/clone.S
 create mode 100644 sysdeps/unix/sysv/linux/riscv/profil-counter.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/pt-vfork.S
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/lockf64.c
 create mode 100644 sysdeps/unix/sysv/linux/riscv/syscall.c
 create mode 100644 sysdeps/unix/sysv/linux/riscv/sysdep.S
 create mode 100644 sysdeps/unix/sysv/linux/riscv/sysdep.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/vfork.S

diff --git a/sysdeps/riscv/nptl/nptl-sysdep.S b/sysdeps/riscv/nptl/nptl-sysdep.S
new file mode 100644
index 000000000000..3f5c2a364afd
--- /dev/null
+++ b/sysdeps/riscv/nptl/nptl-sysdep.S
@@ -0,0 +1,2 @@
+/* Pull in __syscall_error.  */
+#include <sysdep.S>
diff --git a/sysdeps/unix/sysv/linux/riscv/arch-fork.h b/sysdeps/unix/sysv/linux/riscv/arch-fork.h
new file mode 100644
index 000000000000..9a2465b58e5a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/arch-fork.h
@@ -0,0 +1,27 @@
+/* Internal definitions for thread-friendly fork implementation.  Linux/i386.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   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 <sched.h>
+#include <sysdep.h>
+#include <tls.h>
+
+#define ARCH_FORK() \
+  INLINE_SYSCALL (clone, 5,						      \
+		  CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0,     \
+		  NULL, NULL, &THREAD_SELF->tid)
diff --git a/sysdeps/unix/sysv/linux/riscv/clone.S b/sysdeps/unix/sysv/linux/riscv/clone.S
new file mode 100644
index 000000000000..b6b9d584b14a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/clone.S
@@ -0,0 +1,85 @@
+/* Wrapper around clone system call.  RISC-V version.
+   Copyright (C) 1996-2017 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/>.  */
+
+/* clone() is even more special than fork() as it mucks with stacks
+   and invokes a function in the right context after its all over.  */
+
+#include <sys/asm.h>
+#include <sysdep.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+#include <tls.h>
+#include "tcb-offsets.h"
+
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
+	     void *parent_tidptr, void *tls, void *child_tidptr) */
+
+	.text
+LEAF (__clone)
+
+	/* Sanity check arguments.  */
+	beqz		a0,L (invalid)	/* No NULL function pointers.  */
+	beqz		a1,L (invalid)	/* No NULL stack pointers.  */
+
+	addi		a1,a1,-16	/* Reserve argument save space.  */
+	REG_S		a0,0(a1)	/* Save function pointer.  */
+	REG_S		a3,SZREG(a1)	/* Save argument pointer.  */
+
+	/* The syscall expects the args to be in different slots.  */
+	mv		a0,a2
+	mv		a2,a4
+	mv		a3,a5
+	mv		a4,a6
+
+	/* Do the system call */
+	li		a7,__NR_clone
+	scall
+
+	bltz		a0,L (error)
+	beqz		a0,L (thread_start)
+
+	/* Successful return from the parent */
+	ret
+
+L (invalid):
+	li		a0, -EINVAL
+	/* Something bad happened -- no child created */
+L (error):
+	j		__syscall_error
+	END (__clone)
+
+/* Load up the arguments to the function.  Put this block of code in
+   its own function so that we can terminate the stack trace with our
+   debug info.  */
+
+ENTRY (__thread_start)
+L (thread_start):
+	/* Restore the arg for user's function.  */
+	REG_L		a1,0(sp)	/* Function pointer.  */
+	REG_L		a0,SZREG(sp)	/* Argument pointer.  */
+
+	/* Call the user's function.  */
+	jalr		a1
+
+	/* Call _exit with the function's return value.  */
+	j		_exit
+
+	END (__thread_start)
+
+libc_hidden_def (__clone)
+weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/riscv/profil-counter.h b/sysdeps/unix/sysv/linux/riscv/profil-counter.h
new file mode 100644
index 000000000000..f3b3c42d12d8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/profil-counter.h
@@ -0,0 +1,31 @@
+/* Low-level statistical profiling support function.  Linux/RISC-V version.
+   Copyright (C) 1996-2017 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 <signal.h>
+#include <sigcontextinfo.h>
+
+static void
+__profil_counter (int signo, const SIGCONTEXT scp)
+{
+  profil_count ((void *) GET_PC (scp));
+
+  /* This is a hack to prevent the compiler from implementing the
+     above function call as a sibcall.  The sibcall would overwrite
+     the signal context.  */
+  asm volatile ("");
+}
diff --git a/sysdeps/unix/sysv/linux/riscv/pt-vfork.S b/sysdeps/unix/sysv/linux/riscv/pt-vfork.S
new file mode 100644
index 000000000000..a2cfe5f4c320
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/pt-vfork.S
@@ -0,0 +1,43 @@
+/* vfork ABI-compatibility entry points for libpthread.
+   Copyright (C) 2014-2017 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 <shlib-compat.h>
+
+/* libpthread used to have its own vfork implementation that differed
+   from libc's only in having a pointless micro-optimization.  There
+   is no longer any use to having a separate copy in libpthread, but
+   the historical ABI requires it.  For static linking, there is no
+   need to provide anything here--the libc version will be linked in.
+   For shared library ABI compatibility, there must be __vfork and
+   vfork symbols in libpthread.so.  */
+
+#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \
+     || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20))
+
+#include <vfork.S>
+
+#endif
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20)
+compat_symbol (libpthread, __libc_vfork, vfork, GLIBC_2_0);
+#endif
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)
+strong_alias (__libc_vfork, __vfork_compat)
+compat_symbol (libpthread, __vfork_compat, __vfork, GLIBC_2_1_2);
+#endif
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/lockf64.c b/sysdeps/unix/sysv/linux/riscv/rv32/lockf64.c
new file mode 100644
index 000000000000..23b99f8f2233
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/lockf64.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 1994-2017 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 <sys/types.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <sysdep.h>
+
+/* lockf is a simplified interface to fcntl's locking facilities.  */
+
+int
+lockf64 (int fd, int cmd, off64_t len64)
+{
+  struct flock64 fl64;
+  int cmd64;
+  int result;
+
+  memset ((char *) &fl64, '\0', sizeof (fl64));
+  fl64.l_whence = SEEK_CUR;
+  fl64.l_start = 0;
+  fl64.l_len = len64;
+
+  switch (cmd)
+    {
+    case F_TEST:
+      /* Test the lock: return 0 if FD is unlocked or locked by this process;
+	 return -1, set errno to EACCES, if another process holds the lock.  */
+      fl64.l_type = F_RDLCK;
+      INTERNAL_SYSCALL_DECL (err);
+      result = INTERNAL_SYSCALL (fcntl64, err, 3, fd, F_GETLK64, &fl64);
+      if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
+	return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result,
+									  err));
+      if (fl64.l_type == F_UNLCK || fl64.l_pid == __getpid ())
+        return 0;
+      return INLINE_SYSCALL_ERROR_RETURN_VALUE (EACCES);
+    case F_ULOCK:
+      fl64.l_type = F_UNLCK;
+      cmd64 = F_SETLK64;
+      break;
+    case F_LOCK:
+      fl64.l_type = F_WRLCK;
+      cmd64 = F_SETLKW64;
+      break;
+    case F_TLOCK:
+      fl64.l_type = F_WRLCK;
+      cmd64 = F_SETLK64;
+      break;
+
+    default:
+      return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
+    }
+  return INLINE_SYSCALL (fcntl64, 3, fd, cmd64, &fl64);
+}
diff --git a/sysdeps/unix/sysv/linux/riscv/syscall.c b/sysdeps/unix/sysv/linux/riscv/syscall.c
new file mode 100644
index 000000000000..bce62ca06df7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/syscall.c
@@ -0,0 +1,38 @@
+/* system call interface.  Linux/RISC-V version.
+   Copyright (C) 2001-2017 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 <sysdep.h>
+
+long
+syscall (long syscall_number, long arg1, long arg2, long arg3, long arg4,
+	 long arg5, long arg6, long arg7)
+{
+  long ret;
+  INTERNAL_SYSCALL_DECL (err);
+
+  ret = INTERNAL_SYSCALL_NCS (syscall_number, err, 7, arg1, arg2, arg3, arg4,
+			      arg5, arg6, arg7);
+
+  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+    {
+      extern long __syscall_error (long neg_errno);
+      return __syscall_error (ret);
+    }
+
+  return ret;
+}
diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.S b/sysdeps/unix/sysv/linux/riscv/sysdep.S
new file mode 100644
index 000000000000..90da2daf7655
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep.S
@@ -0,0 +1,51 @@
+/* syscall error handlers
+   Copyright (C) 2011-2017 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 <sysdep.h>
+
+#if IS_IN (libc)
+# define errno __libc_errno
+#endif
+
+ENTRY (__syscall_error)
+	mv t0, ra
+	/* Fall through to __syscall_set_errno.  */
+END (__syscall_error)
+
+/* Non-standard calling convention: argument in a0, return address in t0,
+   and clobber only t1.  */
+ENTRY (__syscall_set_errno)
+	/* We got here because a0 < 0, but only codes in the range [-4095, -1]
+	  represent errors.  Otherwise, just return the result normally.  */
+	li t1, -4096
+	bleu a0, t1, 1f
+	neg a0, a0
+#if RTLD_PRIVATE_ERRNO
+	sw a0, rtld_errno, t1
+#elif defined(__PIC__)
+	la.tls.ie t1, errno
+	add t1, t1, tp
+	sw a0, 0(t1)
+#else
+	lui t1, %tprel_hi(errno)
+	add t1, t1, tp, %tprel_add(errno)
+	sw a0, %tprel_lo(errno)(t1)
+#endif
+	li a0, -1
+1:	jr t0
+END (__syscall_set_errno)
diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h
new file mode 100644
index 000000000000..bfad2a8bb120
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h
@@ -0,0 +1,316 @@
+/* Assembly macros for RISC-V.
+   Copyright (C) 2011-2017
+   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 _LINUX_RISCV_SYSDEP_H
+#define _LINUX_RISCV_SYSDEP_H 1
+
+#include <sysdeps/unix/sysv/linux/generic/sysdep.h>
+#include <tls.h>
+
+#ifdef __ASSEMBLER__
+
+# include <sys/asm.h>
+
+# define ENTRY(name) LEAF(name)
+
+# define L(label) .L ## label
+
+/* Performs a system call, handling errors by setting errno.  Linux indicates
+   errors by setting a0 to a value between -1 and -4095.  */
+# undef PSEUDO
+# define PSEUDO(name, syscall_name, args)			\
+  .text;							\
+  .align 2;							\
+  ENTRY (name);							\
+  li a7, SYS_ify (syscall_name);				\
+  scall;							\
+  li a7, -4096;							\
+  bgtu a0, a7, .Lsyscall_error ## name;
+
+# undef PSEUDO_END
+# define PSEUDO_END(sym) 					\
+  SYSCALL_ERROR_HANDLER (sym)					\
+  ret;								\
+  END (sym)
+
+# if !IS_IN (libc)
+#  if RTLD_PRIVATE_ERRNO
+#   define SYSCALL_ERROR_HANDLER(name)				\
+.Lsyscall_error ## name:					\
+	li t1, -4096;						\
+        sw a0, rtld_errno, t1;					\
+        li a0, -1;
+#  elif defined (__PIC__)
+#   define SYSCALL_ERROR_HANDLER(name)				\
+.Lsyscall_error ## name:					\
+        la.tls.ie t1, errno;					\
+	add t1, t1, tp;						\
+	sw a0, 0(t1);						\
+        li a0, -1;
+#  else
+#   define SYSCALL_ERROR_HANDLER(name)				\
+.Lsyscall_error ## name:					\
+        lui t1, %tprel_hi(errno);				\
+        add t1, t1, tp, %tprel_add(errno);			\
+        sw a0, %tprel_lo(errno)(t1);				\
+        li a0, -1;
+#  endif
+# else
+#  define SYSCALL_ERROR_HANDLER(name)				\
+.Lsyscall_error ## name:					\
+        j       __syscall_error;
+# endif
+
+/* Performs a system call, not setting errno.  */
+# undef PSEUDO_NEORRNO
+# define PSEUDO_NOERRNO(name, syscall_name, args)	\
+  .align 2;						\
+  ENTRY (name);						\
+  li a7, SYS_ify (syscall_name);			\
+  scall;
+
+# undef PSEUDO_END_NOERRNO
+# define PSEUDO_END_NOERRNO(name)			\
+  END (name)
+
+# undef ret_NOERRNO
+# define ret_NOERRNO ret
+
+/* Perfroms a system call, returning the error code.  */
+# undef PSEUDO_ERRVAL
+# define PSEUDO_ERRVAL(name, syscall_name, args) 	\
+  PSEUDO_NOERRNO (name, syscall_name, args)		\
+  neg a0, a0;
+
+# undef PSEUDO_END_ERRVAL
+# define PSEUDO_END_ERRVAL(name)			\
+  END (name)
+
+# undef ret_ERRVAL
+# define ret_ERRVAL ret
+
+#endif /* __ASSEMBLER__ */
+
+/* In order to get __set_errno() definition in INLINE_SYSCALL.  */
+#ifndef __ASSEMBLER__
+# include <errno.h>
+#endif
+
+#include <sysdeps/unix/sysdep.h>
+
+#undef SYS_ify
+#define SYS_ify(syscall_name)	__NR_##syscall_name
+
+#ifndef __ASSEMBLER__
+
+/* List of system calls which are supported as vsyscalls.  */
+# define HAVE_CLOCK_GETRES_VSYSCALL	1
+# define HAVE_CLOCK_GETTIME_VSYSCALL	1
+# define HAVE_GETTIMEOFDAY_VSYSCALL	1
+# define HAVE_GETCPU_VSYSCALL		1
+
+/* Define a macro which expands into the inline wrapper code for a system
+   call.  */
+# undef INLINE_SYSCALL
+# define INLINE_SYSCALL(name, nr, args...)				\
+  ({ INTERNAL_SYSCALL_DECL (err);					\
+     long __sys_result = INTERNAL_SYSCALL (name, err, nr, args);	\
+     if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (__sys_result, ), 0)) \
+       {								\
+         __set_errno (INTERNAL_SYSCALL_ERRNO (__sys_result, ));		\
+	 __sys_result = (unsigned long) -1;				\
+       }								\
+     __sys_result; })
+
+# define INTERNAL_SYSCALL_DECL(err) do { } while (0)
+
+# define INTERNAL_SYSCALL_ERROR_P(val, err)   ((unsigned long) (val) > -4096UL)
+
+# define INTERNAL_SYSCALL_ERRNO(val, err)     (-val)
+
+# define INTERNAL_SYSCALL(name, err, nr, args...) \
+	internal_syscall##nr (SYS_ify (name), err, args)
+
+# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+	internal_syscall##nr (number, err, args)
+
+# define internal_syscall0(number, err, dummy...)			\
+({ 									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __a7 asm("a7") = number;				\
+	register long __a0 asm("a0");					\
+	__asm__ volatile ( 						\
+	"scall\n\t" 							\
+	: "=r" (__a0)							\
+	: "r" (__a7)							\
+	: __SYSCALL_CLOBBERS); 						\
+	_sys_result = __a0;						\
+	}								\
+	_sys_result;							\
+})
+
+# define internal_syscall1(number, err, arg0)				\
+({ 									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __a7 asm("a7") = number;				\
+	register long __a0 asm("a0") = (long) (arg0);			\
+	__asm__ volatile ( 						\
+	"scall\n\t" 							\
+	: "+r" (__a0)							\
+	: "r" (__a7)							\
+	: __SYSCALL_CLOBBERS); 						\
+	_sys_result = __a0;						\
+	}								\
+	_sys_result;							\
+})
+
+# define internal_syscall2(number, err, arg0, arg1)	    		\
+({ 									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __a7 asm("a7") = number;				\
+	register long __a0 asm("a0") = (long) (arg0);			\
+	register long __a1 asm("a1") = (long) (arg1);			\
+	__asm__ volatile ( 						\
+	"scall\n\t" 							\
+	: "+r" (__a0)							\
+	: "r" (__a7), "r"(__a1)						\
+	: __SYSCALL_CLOBBERS); 						\
+	_sys_result = __a0;						\
+	}								\
+	_sys_result;							\
+})
+
+# define internal_syscall3(number, err, arg0, arg1, arg2)      		\
+({ 									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __a7 asm("a7") = number;				\
+	register long __a0 asm("a0") = (long) (arg0);			\
+	register long __a1 asm("a1") = (long) (arg1);			\
+	register long __a2 asm("a2") = (long) (arg2);			\
+	__asm__ volatile ( 						\
+	"scall\n\t" 							\
+	: "+r" (__a0)							\
+	: "r" (__a7), "r"(__a1), "r"(__a2)				\
+	: __SYSCALL_CLOBBERS); 						\
+	_sys_result = __a0;						\
+	}								\
+	_sys_result;							\
+})
+
+# define internal_syscall4(number, err, arg0, arg1, arg2, arg3)	  \
+({ 									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __a7 asm("a7") = number;				\
+	register long __a0 asm("a0") = (long) (arg0);			\
+	register long __a1 asm("a1") = (long) (arg1);			\
+	register long __a2 asm("a2") = (long) (arg2);			\
+	register long __a3 asm("a3") = (long) (arg3);			\
+	__asm__ volatile ( 						\
+	"scall\n\t" 							\
+	: "+r" (__a0)							\
+	: "r" (__a7), "r"(__a1), "r"(__a2), "r"(__a3)			\
+	: __SYSCALL_CLOBBERS); 						\
+	_sys_result = __a0;						\
+	}								\
+	_sys_result;							\
+})
+
+# define internal_syscall5(number, err, arg0, arg1, arg2, arg3, arg4)    \
+({ 									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __a7 asm("a7") = number;				\
+	register long __a0 asm("a0") = (long) (arg0);			\
+	register long __a1 asm("a1") = (long) (arg1);			\
+	register long __a2 asm("a2") = (long) (arg2);			\
+	register long __a3 asm("a3") = (long) (arg3);			\
+	register long __a4 asm("a4") = (long) (arg4);			\
+	__asm__ volatile ( 						\
+	"scall\n\t" 							\
+	: "+r" (__a0)							\
+	: "r" (__a7), "r"(__a1), "r"(__a2), "r"(__a3), "r"(__a4)	\
+	: __SYSCALL_CLOBBERS); 						\
+	_sys_result = __a0;						\
+	}								\
+	_sys_result;							\
+})
+
+# define internal_syscall6(number, err, arg0, arg1, arg2, arg3, arg4, arg5) \
+({ 									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __a7 asm("a7") = number;				\
+	register long __a0 asm("a0") = (long) (arg0);			\
+	register long __a1 asm("a1") = (long) (arg1);			\
+	register long __a2 asm("a2") = (long) (arg2);			\
+	register long __a3 asm("a3") = (long) (arg3);			\
+	register long __a4 asm("a4") = (long) (arg4);			\
+	register long __a5 asm("a5") = (long) (arg5);			\
+	__asm__ volatile ( 						\
+	"scall\n\t" 							\
+	: "+r" (__a0)							\
+	: "r" (__a7), "r"(__a1), "r"(__a2), "r"(__a3), "r"(__a4), "r"(__a5)	\
+	: __SYSCALL_CLOBBERS); 						\
+	_sys_result = __a0;						\
+	}								\
+	_sys_result;							\
+})
+
+# define internal_syscall7(number, err, arg0, arg1, arg2, arg3, arg4, arg5, arg6) \
+({ 									\
+	long _sys_result;						\
+									\
+	{								\
+	register long __a7 asm("a7") = number;				\
+	register long __a0 asm("a0") = (long) (arg0);			\
+	register long __a1 asm("a1") = (long) (arg1);			\
+	register long __a2 asm("a2") = (long) (arg2);			\
+	register long __a3 asm("a3") = (long) (arg3);			\
+	register long __a4 asm("a4") = (long) (arg4);			\
+	register long __a5 asm("a5") = (long) (arg5);			\
+	register long __a6 asm("a6") = (long) (arg6);			\
+	__asm__ volatile ( 						\
+	"scall\n\t" 							\
+	: "+r" (__a0)							\
+	: "r" (__a7), "r"(__a1), "r"(__a2), "r"(__a3), "r"(__a4), "r"(__a5), "r"(__a6)	\
+	: __SYSCALL_CLOBBERS); 						\
+	_sys_result = __a0;						\
+	}								\
+	_sys_result;							\
+})
+
+# define __SYSCALL_CLOBBERS "memory"
+#endif /* ! __ASSEMBLER__ */
+
+/* Pointer mangling is not supported.  */
+#define PTR_MANGLE(var) (void) (var)
+#define PTR_DEMANGLE(var) (void) (var)
+
+#endif /* linux/riscv/sysdep.h */
diff --git a/sysdeps/unix/sysv/linux/riscv/vfork.S b/sysdeps/unix/sysv/linux/riscv/vfork.S
new file mode 100644
index 000000000000..9d5ebf256cbb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/vfork.S
@@ -0,0 +1,44 @@
+/* vfork for Linux, RISC-V version.
+   Copyright (C) 2005-2017 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/>.  */
+
+/* vfork() is just a special case of clone().  */
+
+#include <sys/asm.h>
+#include <sysdep.h>
+#define __ASSEMBLY__
+#include <linux/sched.h>
+#include <asm/signal.h>
+
+	.text
+LEAF (__libc_vfork)
+
+	li	a0, (CLONE_VFORK | CLONE_VM | SIGCHLD)
+	mv	a1, sp
+
+	li	a7, __NR_clone
+	scall
+
+	bltz	a0, 1f
+	ret
+
+1:	j		__syscall_error
+END (__libc_vfork)
+
+weak_alias (__libc_vfork, vfork)
+strong_alias (__libc_vfork, __vfork)
+libc_hidden_def (__vfork)
-- 
2.13.6

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

* [PATCH v3 13/19] RISC-V: RV32D, RV64F, and RV64D Support
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (9 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 09/19] RISC-V: Startup and Dynamic Loading Code Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01 17:08   ` Joseph Myers
  2017-12-27  6:06 ` [PATCH v3 16/19] RISC-V: Linux ABI Palmer Dabbelt
                   ` (9 subsequent siblings)
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

This patch adds support for the various other hardware floating point
configurations that RISC-V supports.  This is split from the RV32F patch
to avoid mailing list size restrictions.
---
 sysdeps/riscv/rv32/rvd/s_lrint.c     | 30 ++++++++++++++++++++
 sysdeps/riscv/rv32/rvd/s_lround.c    | 30 ++++++++++++++++++++
 sysdeps/riscv/rv32/rvf/s_llrintf.c   | 30 ++++++++++++++++++++
 sysdeps/riscv/rv32/rvf/s_lrintf.c    | 30 ++++++++++++++++++++
 sysdeps/riscv/rv64/rvd/s_ceil.c      | 51 ++++++++++++++++++++++++++++++++++
 sysdeps/riscv/rv64/rvd/s_floor.c     | 51 ++++++++++++++++++++++++++++++++++
 sysdeps/riscv/rv64/rvd/s_llrint.c    | 29 ++++++++++++++++++++
 sysdeps/riscv/rv64/rvd/s_llround.c   | 29 ++++++++++++++++++++
 sysdeps/riscv/rv64/rvd/s_lrint.c     | 29 ++++++++++++++++++++
 sysdeps/riscv/rv64/rvd/s_lround.c    | 29 ++++++++++++++++++++
 sysdeps/riscv/rv64/rvd/s_nearbyint.c | 51 ++++++++++++++++++++++++++++++++++
 sysdeps/riscv/rv64/rvd/s_rint.c      | 51 ++++++++++++++++++++++++++++++++++
 sysdeps/riscv/rv64/rvd/s_round.c     | 51 ++++++++++++++++++++++++++++++++++
 sysdeps/riscv/rv64/rvd/s_roundeven.c | 53 ++++++++++++++++++++++++++++++++++++
 sysdeps/riscv/rv64/rvd/s_trunc.c     | 51 ++++++++++++++++++++++++++++++++++
 sysdeps/riscv/rv64/rvf/s_llrintf.c   | 29 ++++++++++++++++++++
 sysdeps/riscv/rv64/rvf/s_llroundf.c  | 30 ++++++++++++++++++++
 sysdeps/riscv/rv64/rvf/s_lrintf.c    | 30 ++++++++++++++++++++
 sysdeps/riscv/rvd/e_sqrt.c           | 27 ++++++++++++++++++
 sysdeps/riscv/rvd/s_copysign.c       | 28 +++++++++++++++++++
 sysdeps/riscv/rvd/s_finite.c         | 28 +++++++++++++++++++
 sysdeps/riscv/rvd/s_fma.c            | 30 ++++++++++++++++++++
 sysdeps/riscv/rvd/s_fmax.c           | 28 +++++++++++++++++++
 sysdeps/riscv/rvd/s_fmin.c           | 28 +++++++++++++++++++
 sysdeps/riscv/rvd/s_fpclassify.c     | 36 ++++++++++++++++++++++++
 sysdeps/riscv/rvd/s_isinf.c          | 29 ++++++++++++++++++++
 sysdeps/riscv/rvd/s_isnan.c          | 28 +++++++++++++++++++
 sysdeps/riscv/rvd/s_issignaling.c    | 27 ++++++++++++++++++
 28 files changed, 973 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_llrintf.c
 create mode 100644 sysdeps/riscv/rv32/rvf/s_lrintf.c
 create mode 100644 sysdeps/riscv/rv64/rvd/s_ceil.c
 create mode 100644 sysdeps/riscv/rv64/rvd/s_floor.c
 create mode 100644 sysdeps/riscv/rv64/rvd/s_llrint.c
 create mode 100644 sysdeps/riscv/rv64/rvd/s_llround.c
 create mode 100644 sysdeps/riscv/rv64/rvd/s_lrint.c
 create mode 100644 sysdeps/riscv/rv64/rvd/s_lround.c
 create mode 100644 sysdeps/riscv/rv64/rvd/s_nearbyint.c
 create mode 100644 sysdeps/riscv/rv64/rvd/s_rint.c
 create mode 100644 sysdeps/riscv/rv64/rvd/s_round.c
 create mode 100644 sysdeps/riscv/rv64/rvd/s_roundeven.c
 create mode 100644 sysdeps/riscv/rv64/rvd/s_trunc.c
 create mode 100644 sysdeps/riscv/rv64/rvf/s_llrintf.c
 create mode 100644 sysdeps/riscv/rv64/rvf/s_llroundf.c
 create mode 100644 sysdeps/riscv/rv64/rvf/s_lrintf.c
 create mode 100644 sysdeps/riscv/rvd/e_sqrt.c
 create mode 100644 sysdeps/riscv/rvd/s_copysign.c
 create mode 100644 sysdeps/riscv/rvd/s_finite.c
 create mode 100644 sysdeps/riscv/rvd/s_fma.c
 create mode 100644 sysdeps/riscv/rvd/s_fmax.c
 create mode 100644 sysdeps/riscv/rvd/s_fmin.c
 create mode 100644 sysdeps/riscv/rvd/s_fpclassify.c
 create mode 100644 sysdeps/riscv/rvd/s_isinf.c
 create mode 100644 sysdeps/riscv/rvd/s_isnan.c
 create mode 100644 sysdeps/riscv/rvd/s_issignaling.c

diff --git a/sysdeps/riscv/rv32/rvd/s_lrint.c b/sysdeps/riscv/rv32/rvd/s_lrint.c
new file mode 100644
index 000000000000..7a1fff6ffd27
--- /dev/null
+++ b/sysdeps/riscv/rv32/rvd/s_lrint.c
@@ -0,0 +1,30 @@
+/* lrint().  RISC-V version.
+   Copyright (C) 2017 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>
+
+long
+__lrint (double x)
+{
+  long 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 000000000000..7c2e0b81fbe0
--- /dev/null
+++ b/sysdeps/riscv/rv32/rvd/s_lround.c
@@ -0,0 +1,30 @@
+/* lround().  RISC-V version.
+   Copyright (C) 2017 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>
+
+long
+__lround (double x)
+{
+  long 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_llrintf.c b/sysdeps/riscv/rv32/rvf/s_llrintf.c
new file mode 100644
index 000000000000..3de8aa99a7f3
--- /dev/null
+++ b/sysdeps/riscv/rv32/rvf/s_llrintf.c
@@ -0,0 +1,30 @@
+/* lrintf().  RISC-V version.
+   Copyright (C) 2017 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>
+
+long long
+__llrintf (float x)
+{
+  long res;
+  asm ("fcvt.w.s %0, %1" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/riscv/rv32/rvf/s_lrintf.c b/sysdeps/riscv/rv32/rvf/s_lrintf.c
new file mode 100644
index 000000000000..806a160ce0d7
--- /dev/null
+++ b/sysdeps/riscv/rv32/rvf/s_lrintf.c
@@ -0,0 +1,30 @@
+/* lrintf().  RISC-V version.
+   Copyright (C) 2017 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>
+
+long
+__lrintf (float x)
+{
+  long res;
+  asm ("fcvt.w.s %0, %1" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/riscv/rv64/rvd/s_ceil.c b/sysdeps/riscv/rv64/rvd/s_ceil.c
new file mode 100644
index 000000000000..b26af1bd7275
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_ceil.c
@@ -0,0 +1,51 @@
+/* ceil().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-double.h>
+
+double
+__ceil (double x)
+{
+  int flags = riscv_getflags ();
+  bool nan = isnan (x);
+  double mag = fabs (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1ULL << __DBL_MANT_DIG__))
+    {
+      long i;
+      double new_x;
+
+      asm volatile ("fcvt.l.d %0, %1, rup" : "=r" (i) : "f" (x));
+      asm volatile ("fcvt.d.l %0, %1, rup" : "=f" (new_x) : "r" (i));
+
+      /* ceil(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysign (new_x, x);
+
+      riscv_setflags (flags);
+    }
+
+  return x;
+}
+
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/riscv/rv64/rvd/s_floor.c b/sysdeps/riscv/rv64/rvd/s_floor.c
new file mode 100644
index 000000000000..6e1ce9df8f62
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_floor.c
@@ -0,0 +1,51 @@
+/* floor().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-double.h>
+
+double
+__floor (double x)
+{
+  int flags = riscv_getflags ();
+  bool nan = isnan (x);
+  double mag = fabs (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1ULL << __DBL_MANT_DIG__))
+    {
+      long i;
+      double new_x;
+
+      asm volatile ("fcvt.l.d %0, %1, rdn" : "=r" (i) : "f" (x));
+      asm volatile ("fcvt.d.l %0, %1, rdn" : "=f" (new_x) : "r" (i));
+
+      /* floor(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysign (new_x, x);
+
+      riscv_setflags (flags);
+    }
+
+  return x;
+}
+
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/riscv/rv64/rvd/s_llrint.c b/sysdeps/riscv/rv64/rvd/s_llrint.c
new file mode 100644
index 000000000000..77a7b0712f9c
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_llrint.c
@@ -0,0 +1,29 @@
+/* llrint().  RISC-V version.
+   Copyright (C) 2017 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 <libm-alias-double.h>
+
+long long
+__llrint (double x)
+{
+  long long res;
+  asm ("fcvt.l.d %0, %1" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_double(__llrint, llrint)
diff --git a/sysdeps/riscv/rv64/rvd/s_llround.c b/sysdeps/riscv/rv64/rvd/s_llround.c
new file mode 100644
index 000000000000..5df866de7245
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_llround.c
@@ -0,0 +1,29 @@
+/* llround().  RISC-V version.
+   Copyright (C) 2017 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 <libm-alias-double.h>
+
+long long
+__llround (double x)
+{
+  long long res;
+  asm ("fcvt.l.d %0, %1, rmm" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_double (__llround, llround)
diff --git a/sysdeps/riscv/rv64/rvd/s_lrint.c b/sysdeps/riscv/rv64/rvd/s_lrint.c
new file mode 100644
index 000000000000..2d11cc3cd16d
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_lrint.c
@@ -0,0 +1,29 @@
+/* lrint().  RISC-V version.
+   Copyright (C) 2017 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 <libm-alias-double.h>
+
+long
+__lrint (double x)
+{
+  long res;
+  asm ("fcvt.l.d %0, %1" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_double (__lrint, lrint)
diff --git a/sysdeps/riscv/rv64/rvd/s_lround.c b/sysdeps/riscv/rv64/rvd/s_lround.c
new file mode 100644
index 000000000000..b4f37e15bd2e
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_lround.c
@@ -0,0 +1,29 @@
+/* llround().  RISC-V version.
+   Copyright (C) 2017 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 <libm-alias-double.h>
+
+long
+__lround (double x)
+{
+  long res;
+  asm ("fcvt.l.d %0, %1, rmm" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_double (__lround, lround)
diff --git a/sysdeps/riscv/rv64/rvd/s_nearbyint.c b/sysdeps/riscv/rv64/rvd/s_nearbyint.c
new file mode 100644
index 000000000000..01e8468e281c
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_nearbyint.c
@@ -0,0 +1,51 @@
+/* nearbyint().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-double.h>
+
+double
+__nearbyint (double x)
+{
+  int flags = riscv_getflags ();
+  bool nan = isnan (x);
+  double mag = fabs (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1ULL << __DBL_MANT_DIG__))
+    {
+      long i;
+      double new_x;
+
+      asm volatile ("fcvt.l.d %0, %1" : "=r" (i) : "f" (x));
+      asm volatile ("fcvt.d.l %0, %1" : "=f" (new_x) : "r" (i));
+
+      /* nearbyint(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysign (new_x, x);
+
+      riscv_setflags (flags);
+    }
+
+  return x;
+}
+
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/riscv/rv64/rvd/s_rint.c b/sysdeps/riscv/rv64/rvd/s_rint.c
new file mode 100644
index 000000000000..6004bd73922f
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_rint.c
@@ -0,0 +1,51 @@
+/* rint().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-double.h>
+
+double
+__rint (double x)
+{
+  bool nan;
+  double mag;
+
+  nan = isnan (x);
+  mag = fabs (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1ULL << __DBL_MANT_DIG__))
+    {
+      long i;
+      double new_x;
+
+      asm ("fcvt.l.d %0, %1" : "=r" (i) : "f" (x));
+      asm ("fcvt.d.l %0, %1" : "=f" (new_x) : "r" (i));
+
+      /* rint(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysign (new_x, x);
+    }
+
+  return x;
+}
+
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/riscv/rv64/rvd/s_round.c b/sysdeps/riscv/rv64/rvd/s_round.c
new file mode 100644
index 000000000000..54092846ff23
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_round.c
@@ -0,0 +1,51 @@
+/* round().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-double.h>
+
+double
+__round (double x)
+{
+  int flags = riscv_getflags ();
+  bool nan = isnan (x);
+  double mag = fabs (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1ULL << __DBL_MANT_DIG__))
+    {
+      long i;
+      double new_x;
+
+      asm volatile ("fcvt.l.d %0, %1, rmm" : "=r" (i) : "f" (x));
+      asm volatile ("fcvt.d.l %0, %1, rmm" : "=f" (new_x) : "r" (i));
+
+      /* round(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysign (new_x, x);
+
+      riscv_setflags (flags);
+    }
+
+  return x;
+}
+
+libm_alias_double (__round, round)
diff --git a/sysdeps/riscv/rv64/rvd/s_roundeven.c b/sysdeps/riscv/rv64/rvd/s_roundeven.c
new file mode 100644
index 000000000000..1aeab4b0ff40
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_roundeven.c
@@ -0,0 +1,53 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-double.h>
+
+double
+__roundeven (double x)
+{
+  int flags = riscv_getflags ();
+  bool nan = isnan (x);
+  double mag = fabs (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1ULL << __DBL_MANT_DIG__))
+    {
+      long i;
+      double new_x;
+
+      asm volatile ("fcvt.l.d %0, %1, rne" : "=r" (i) : "f" (x));
+      asm volatile ("fcvt.d.l %0, %1, rne" : "=f" (new_x) : "r" (i));
+
+      /* roundeven(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysign (new_x, x);
+
+      riscv_setflags (flags);
+    }
+
+  return x;
+}
+
+hidden_def (__roundeven)
+libm_alias_double (__roundeven, roundeven)
diff --git a/sysdeps/riscv/rv64/rvd/s_trunc.c b/sysdeps/riscv/rv64/rvd/s_trunc.c
new file mode 100644
index 000000000000..b19a59d987a1
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/s_trunc.c
@@ -0,0 +1,51 @@
+/* trunc().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+#include <libm-alias-double.h>
+
+double
+__trunc (double x)
+{
+  int flags = riscv_getflags ();
+  bool nan = isnan (x);
+  double mag = fabs (x);
+
+  if (nan)
+    return x + x;
+
+  if (mag < (1ULL << __DBL_MANT_DIG__))
+    {
+      long i;
+      double new_x;
+
+      asm volatile ("fcvt.l.d %0, %1, rtz" : "=r" (i) : "f" (x));
+      asm volatile ("fcvt.d.l %0, %1, rtz" : "=f" (new_x) : "r" (i));
+
+      /* trunc(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysign (new_x, x);
+
+      riscv_setflags (flags);
+    }
+
+  return x;
+}
+
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/riscv/rv64/rvf/s_llrintf.c b/sysdeps/riscv/rv64/rvf/s_llrintf.c
new file mode 100644
index 000000000000..bdebf1fde3fa
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvf/s_llrintf.c
@@ -0,0 +1,29 @@
+/* Round argument to nearest integral value according to current direction.
+   Copyright (C) 2017 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 <libm-alias-float.h>
+
+long long
+__llrintf (float x)
+{
+  long long res;
+  asm ("fcvt.l.s %0, %1" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/riscv/rv64/rvf/s_llroundf.c b/sysdeps/riscv/rv64/rvf/s_llroundf.c
new file mode 100644
index 000000000000..5b69c01648ec
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvf/s_llroundf.c
@@ -0,0 +1,30 @@
+/* Round float value to long long int.  RISC-V version.
+   Copyright (C) 2017 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 <libm-alias-float.h>
+#include <libm-alias-float.h>
+
+long long
+__llroundf (float x)
+{
+  long long res;
+  asm ("fcvt.l.s %0, %1, rmm" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_float (__llround, llround)
diff --git a/sysdeps/riscv/rv64/rvf/s_lrintf.c b/sysdeps/riscv/rv64/rvf/s_lrintf.c
new file mode 100644
index 000000000000..cb28ffe1b536
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvf/s_lrintf.c
@@ -0,0 +1,30 @@
+/* lrintf().  RISC-V version.
+   Copyright (C) 2017 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>
+
+long
+__lrintf (float x)
+{
+  long res;
+  asm ("fcvt.l.s %0, %1" : "=r" (res) : "f" (x));
+  return res;
+}
+
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/riscv/rvd/e_sqrt.c b/sysdeps/riscv/rvd/e_sqrt.c
new file mode 100644
index 000000000000..ceac9f4c34a4
--- /dev/null
+++ b/sysdeps/riscv/rvd/e_sqrt.c
@@ -0,0 +1,27 @@
+/* Double precision floating point square root.  RISC-V version.
+   Copyright (C) 2017 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>
+
+double
+__ieee754_sqrt (double x)
+{
+  asm ("fsqrt.d %0, %1" : "=f" (x) : "f" (x));
+  return x;
+}
+strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/sysdeps/riscv/rvd/s_copysign.c b/sysdeps/riscv/rvd/s_copysign.c
new file mode 100644
index 000000000000..d3a5000a6e7b
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_copysign.c
@@ -0,0 +1,28 @@
+/* Copy sign bit between floating-point values.  RISC-V version.
+   Copyright (C) 2017 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>
+
+double
+__copysign (double x, double y)
+{
+  asm ("fsgnj.d %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
+  return x;
+}
+libm_alias_double (__copysign, copysign)
diff --git a/sysdeps/riscv/rvd/s_finite.c b/sysdeps/riscv/rvd/s_finite.c
new file mode 100644
index 000000000000..06914e1c1e71
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_finite.c
@@ -0,0 +1,28 @@
+/* finite().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+
+int
+__finite (double x)
+{
+  return _FCLASS (x) & ~(_FCLASS_INF | _FCLASS_NAN);
+}
+hidden_def (__finite)
+weak_alias (__finite, finite)
diff --git a/sysdeps/riscv/rvd/s_fma.c b/sysdeps/riscv/rvd/s_fma.c
new file mode 100644
index 000000000000..ff74857cf578
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_fma.c
@@ -0,0 +1,30 @@
+/* Double precision floating point fused multiply-add.  RISC-V version.
+   Copyright (C) 2017 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 <fenv.h>
+#include <ieee754.h>
+#include <libm-alias-double.h>
+
+double
+__fma (double x, double y, double z)
+{
+  asm ("fmadd.d %0, %1, %2, %3" : "=f" (x) : "f" (x), "f" (y), "f" (z));
+  return x;
+}
+libm_alias_double (__fma, fma)
diff --git a/sysdeps/riscv/rvd/s_fmax.c b/sysdeps/riscv/rvd/s_fmax.c
new file mode 100644
index 000000000000..b108434cd64b
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_fmax.c
@@ -0,0 +1,28 @@
+/* fmax().  RISC-V version.
+   Copyright (C) 2017 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>
+
+double
+__fmax (double x, double y)
+{
+  asm ("fmax.d %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
+  return x;
+}
+libm_alias_double (__fmax, fmax)
diff --git a/sysdeps/riscv/rvd/s_fmin.c b/sysdeps/riscv/rvd/s_fmin.c
new file mode 100644
index 000000000000..4894377602c3
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_fmin.c
@@ -0,0 +1,28 @@
+/* fmin().  RISC-V version.
+   Copyright (C) 2017 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>
+
+double
+__fmin (double x, double y)
+{
+  asm ("fmin.d %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
+  return x;
+}
+libm_alias_double (__fmin, fmin)
diff --git a/sysdeps/riscv/rvd/s_fpclassify.c b/sysdeps/riscv/rvd/s_fpclassify.c
new file mode 100644
index 000000000000..cdfdbdfbc1e2
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_fpclassify.c
@@ -0,0 +1,36 @@
+/* fpclassify().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+
+int
+__fpclassify (double x)
+{
+  int cls = _FCLASS (x);
+  if (__builtin_expect (cls & _FCLASS_NORM, _FCLASS_NORM))
+    return FP_NORMAL;
+  if (__builtin_expect (cls & _FCLASS_ZERO, _FCLASS_ZERO))
+    return FP_ZERO;
+  if (__builtin_expect (cls & _FCLASS_SUBNORM, _FCLASS_SUBNORM))
+    return FP_SUBNORMAL;
+  if (__builtin_expect (cls & _FCLASS_INF, _FCLASS_INF))
+    return FP_INFINITE;
+  return FP_NAN;
+}
+libm_hidden_def (__fpclassify)
diff --git a/sysdeps/riscv/rvd/s_isinf.c b/sysdeps/riscv/rvd/s_isinf.c
new file mode 100644
index 000000000000..92d2f2c261bc
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_isinf.c
@@ -0,0 +1,29 @@
+/* isinf().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+
+int
+__isinf (double x)
+{
+  int cls = _FCLASS (x);
+  return -((cls & _FCLASS_MINF) ? 1 : 0) | ((cls & _FCLASS_PINF) ? 1 : 0);
+}
+hidden_def (__isinf)
+weak_alias (__isinf, isinf)
diff --git a/sysdeps/riscv/rvd/s_isnan.c b/sysdeps/riscv/rvd/s_isnan.c
new file mode 100644
index 000000000000..e88b47287952
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_isnan.c
@@ -0,0 +1,28 @@
+/* isnan().  RISC_V version.
+   Copyright (C) 2017 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 <math_private.h>
+
+int
+__isnan (double x)
+{
+  return _FCLASS (x) & _FCLASS_NAN;
+}
+hidden_def (__isnan)
+weak_alias (__isnan, isnan)
diff --git a/sysdeps/riscv/rvd/s_issignaling.c b/sysdeps/riscv/rvd/s_issignaling.c
new file mode 100644
index 000000000000..6136d7e7f33f
--- /dev/null
+++ b/sysdeps/riscv/rvd/s_issignaling.c
@@ -0,0 +1,27 @@
+/* issignaling().  RISC-V version.
+   Copyright (C) 2017 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 <math_private.h>
+
+int
+__issignaling (double x)
+{
+  return _FCLASS (x) & _FCLASS_SNAN;
+}
+libm_hidden_def (__issignaling)
-- 
2.13.6

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

* [PATCH v3 08/19] RISC-V: ABI Implementation
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (7 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 17/19] RISC-V: Linux Startup and Dynamic Loading Code Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01 13:29   ` Joseph Myers
  2017-12-27  6:06 ` [PATCH v3 09/19] RISC-V: Startup and Dynamic Loading Code Palmer Dabbelt
                   ` (11 subsequent siblings)
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

This patch contains code that needs to directly know about the RISC-V
ABI, which is specified in a work-in-progress psABI document:

  https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md

This is meant to contain all the RISC-V code that needs to explicitly
name registers or manage in-memory structure layout.  This does not
contain any of the Linux-specific code.
---
 sysdeps/riscv/__longjmp.S     | 57 +++++++++++++++++++++++++++++++
 sysdeps/riscv/bits/endian.h   |  5 +++
 sysdeps/riscv/bits/setjmp.h   | 41 +++++++++++++++++++++++
 sysdeps/riscv/bits/wordsize.h | 31 +++++++++++++++++
 sysdeps/riscv/bsd-_setjmp.c   |  1 +
 sysdeps/riscv/bsd-setjmp.c    |  1 +
 sysdeps/riscv/dl-trampoline.S | 63 ++++++++++++++++++++++++++++++++++
 sysdeps/riscv/gccframe.h      | 21 ++++++++++++
 sysdeps/riscv/jmpbuf-unwind.h | 46 +++++++++++++++++++++++++
 sysdeps/riscv/machine-gmon.h  | 34 +++++++++++++++++++
 sysdeps/riscv/memusage.h      | 21 ++++++++++++
 sysdeps/riscv/setjmp.S        | 74 ++++++++++++++++++++++++++++++++++++++++
 sysdeps/riscv/sys/asm.h       | 78 +++++++++++++++++++++++++++++++++++++++++++
 sysdeps/riscv/tls-macros.h    | 60 +++++++++++++++++++++++++++++++++
 14 files changed, 533 insertions(+)
 create mode 100644 sysdeps/riscv/__longjmp.S
 create mode 100644 sysdeps/riscv/bits/endian.h
 create mode 100644 sysdeps/riscv/bits/setjmp.h
 create mode 100644 sysdeps/riscv/bits/wordsize.h
 create mode 100644 sysdeps/riscv/bsd-_setjmp.c
 create mode 100644 sysdeps/riscv/bsd-setjmp.c
 create mode 100644 sysdeps/riscv/dl-trampoline.S
 create mode 100644 sysdeps/riscv/gccframe.h
 create mode 100644 sysdeps/riscv/jmpbuf-unwind.h
 create mode 100644 sysdeps/riscv/machine-gmon.h
 create mode 100644 sysdeps/riscv/memusage.h
 create mode 100644 sysdeps/riscv/setjmp.S
 create mode 100644 sysdeps/riscv/sys/asm.h
 create mode 100644 sysdeps/riscv/tls-macros.h

diff --git a/sysdeps/riscv/__longjmp.S b/sysdeps/riscv/__longjmp.S
new file mode 100644
index 000000000000..e4b7b579d4bb
--- /dev/null
+++ b/sysdeps/riscv/__longjmp.S
@@ -0,0 +1,57 @@
+/* longjmp, RISC-V version.
+   Copyright (C) 1996-2017 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 <sysdep.h>
+#include <sys/asm.h>
+
+ENTRY (__longjmp)
+	REG_L ra,  0*SZREG(a0)
+	REG_L s0,  1*SZREG(a0)
+	REG_L s1,  2*SZREG(a0)
+	REG_L s2,  3*SZREG(a0)
+	REG_L s3,  4*SZREG(a0)
+	REG_L s4,  5*SZREG(a0)
+	REG_L s5,  6*SZREG(a0)
+	REG_L s6,  7*SZREG(a0)
+	REG_L s7,  8*SZREG(a0)
+	REG_L s8,  9*SZREG(a0)
+	REG_L s9, 10*SZREG(a0)
+	REG_L s10,11*SZREG(a0)
+	REG_L s11,12*SZREG(a0)
+	REG_L sp, 13*SZREG(a0)
+
+#ifndef __riscv_float_abi_soft
+	FREG_L fs0, 14*SZREG+ 0*SZFREG(a0)
+	FREG_L fs1, 14*SZREG+ 1*SZFREG(a0)
+	FREG_L fs2, 14*SZREG+ 2*SZFREG(a0)
+	FREG_L fs3, 14*SZREG+ 3*SZFREG(a0)
+	FREG_L fs4, 14*SZREG+ 4*SZFREG(a0)
+	FREG_L fs5, 14*SZREG+ 5*SZFREG(a0)
+	FREG_L fs6, 14*SZREG+ 6*SZFREG(a0)
+	FREG_L fs7, 14*SZREG+ 7*SZFREG(a0)
+	FREG_L fs8, 14*SZREG+ 8*SZFREG(a0)
+	FREG_L fs9, 14*SZREG+ 9*SZFREG(a0)
+	FREG_L fs10,14*SZREG+10*SZFREG(a0)
+	FREG_L fs11,14*SZREG+11*SZFREG(a0)
+#endif
+
+	seqz a0, a1
+	add  a0, a0, a1   # a0 = (a1 == 0) ? 1 : a1
+	ret
+
+END (__longjmp)
diff --git a/sysdeps/riscv/bits/endian.h b/sysdeps/riscv/bits/endian.h
new file mode 100644
index 000000000000..4aaf559d4f43
--- /dev/null
+++ b/sysdeps/riscv/bits/endian.h
@@ -0,0 +1,5 @@
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/sysdeps/riscv/bits/setjmp.h b/sysdeps/riscv/bits/setjmp.h
new file mode 100644
index 000000000000..54a7fb85baab
--- /dev/null
+++ b/sysdeps/riscv/bits/setjmp.h
@@ -0,0 +1,41 @@
+/* Define the machine-dependent type `jmp_buf'.  RISC-V version.
+   Copyright (C) 2011-2017 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 _RISCV_BITS_SETJMP_H
+#define _RISCV_BITS_SETJMP_H
+
+typedef struct __jmp_buf_internal_tag
+  {
+    /* Program counter.  */
+    long __pc;
+    /* Callee-saved registers. */
+    long __regs[12];
+    /* Stack pointer.  */
+    long __sp;
+
+    /* Callee-saved floating point registers.  */
+#ifdef __riscv_float_abi_single
+   float __fpregs[12];
+#elif defined __riscv_float_abi_double
+   double __fpregs[12];
+#elif !defined __riscv_float_abi_soft
+# error unsupported FLEN
+#endif
+  } __jmp_buf[1];
+
+#endif /* _RISCV_BITS_SETJMP_H */
diff --git a/sysdeps/riscv/bits/wordsize.h b/sysdeps/riscv/bits/wordsize.h
new file mode 100644
index 000000000000..4781cc4899a3
--- /dev/null
+++ b/sysdeps/riscv/bits/wordsize.h
@@ -0,0 +1,31 @@
+/* Determine the wordsize from the preprocessor defines.  RISC-V version.
+   Copyright (C) 2002-2017 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/>.  */
+
+#if __riscv_xlen == (__SIZEOF_POINTER__ * 8)
+# define __WORDSIZE __riscv_xlen
+#else
+# error unsupported ABI
+#endif
+
+#if __riscv_xlen == 64
+# define __WORDSIZE_TIME64_COMPAT32 1
+#else
+# define __WORDSIZE_TIME64_COMPAT32 0
+# define __WORDSIZE32_SIZE_ULONG    0
+# define __WORDSIZE32_PTRDIFF_LONG  0
+#endif
diff --git a/sysdeps/riscv/bsd-_setjmp.c b/sysdeps/riscv/bsd-_setjmp.c
new file mode 100644
index 000000000000..0d413101ce0d
--- /dev/null
+++ b/sysdeps/riscv/bsd-_setjmp.c
@@ -0,0 +1 @@
+/* _setjmp is implemented in setjmp.S */
diff --git a/sysdeps/riscv/bsd-setjmp.c b/sysdeps/riscv/bsd-setjmp.c
new file mode 100644
index 000000000000..ee7c5e3437d4
--- /dev/null
+++ b/sysdeps/riscv/bsd-setjmp.c
@@ -0,0 +1 @@
+/* setjmp is implemented in setjmp.S */
diff --git a/sysdeps/riscv/dl-trampoline.S b/sysdeps/riscv/dl-trampoline.S
new file mode 100644
index 000000000000..b52dd29ee4de
--- /dev/null
+++ b/sysdeps/riscv/dl-trampoline.S
@@ -0,0 +1,63 @@
+/* RISC-V PLT trampoline
+   Copyright (C) 2017 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 <sysdep.h>
+#include <sys/asm.h>
+
+/* Assembler veneer called from the PLT header code for lazy loading.
+   The PLT header passes its own args in t0-t2.  */
+
+#define FRAME_SIZE (-((-10 * SZREG) & ALMASK))
+
+ENTRY (_dl_runtime_resolve)
+  # Save arguments to stack.
+  addi sp, sp, -FRAME_SIZE
+  REG_S ra, 9*SZREG(sp)
+  REG_S a0, 1*SZREG(sp)
+  REG_S a1, 2*SZREG(sp)
+  REG_S a2, 3*SZREG(sp)
+  REG_S a3, 4*SZREG(sp)
+  REG_S a4, 5*SZREG(sp)
+  REG_S a5, 6*SZREG(sp)
+  REG_S a6, 7*SZREG(sp)
+  REG_S a7, 8*SZREG(sp)
+
+  # Update .got.plt and obtain runtime address of callee.
+  slli a1, t1, 1
+  mv a0, t0       # link map
+  add a1, a1, t1  # reloc offset (== thrice the .got.plt offset)
+  la a2, _dl_fixup
+  jalr a2
+  mv t1, a0
+
+  # Restore arguments from stack.
+  REG_L ra, 9*SZREG(sp)
+  REG_L a0, 1*SZREG(sp)
+  REG_L a1, 2*SZREG(sp)
+  REG_L a2, 3*SZREG(sp)
+  REG_L a3, 4*SZREG(sp)
+  REG_L a4, 5*SZREG(sp)
+  REG_L a5, 6*SZREG(sp)
+  REG_L a6, 7*SZREG(sp)
+  REG_L a7, 8*SZREG(sp)
+  addi sp, sp, FRAME_SIZE
+
+  # Invoke the callee.
+  jr t1
+END (_dl_runtime_resolve)
diff --git a/sysdeps/riscv/gccframe.h b/sysdeps/riscv/gccframe.h
new file mode 100644
index 000000000000..28f6908826e2
--- /dev/null
+++ b/sysdeps/riscv/gccframe.h
@@ -0,0 +1,21 @@
+/* Definition of object in frame unwind info.  RISC-V version.
+   Copyright (C) 2001-2017 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/>.  */
+
+#define FIRST_PSEUDO_REGISTER 66
+
+#include <sysdeps/generic/gccframe.h>
diff --git a/sysdeps/riscv/jmpbuf-unwind.h b/sysdeps/riscv/jmpbuf-unwind.h
new file mode 100644
index 000000000000..8b4ed8196dec
--- /dev/null
+++ b/sysdeps/riscv/jmpbuf-unwind.h
@@ -0,0 +1,46 @@
+/* Examine __jmp_buf for unwinding frames.  RISC-V version.
+   Copyright (C) 2003-2017 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 <setjmp.h>
+#include <stdint.h>
+#include <unwind.h>
+#include <sysdep.h>
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle)		\
+  ((void *) (address) < (void *) demangle ((jmpbuf)[0].__sp))
+
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
+  _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+  uintptr_t sp = regs[0].__sp;
+#ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (sp);
+#endif
+  return sp;
+}
+
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+  ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
+
+/* We use the normal longjmp for unwinding.  */
+#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
diff --git a/sysdeps/riscv/machine-gmon.h b/sysdeps/riscv/machine-gmon.h
new file mode 100644
index 000000000000..2ec7a34d9bc6
--- /dev/null
+++ b/sysdeps/riscv/machine-gmon.h
@@ -0,0 +1,34 @@
+/* RISC-V definitions for profiling support.
+   Copyright (C) 1996-2017 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/>.  */
+
+/* Accept 'frompc' address as argument from the function that calls
+   _mcount for profiling.  Use  __builtin_return_address (0)
+   for the 'selfpc' address.  */
+
+#include <sysdep.h>
+
+static void mcount_internal (u_long frompc, u_long selfpc);
+
+#define _MCOUNT_DECL(frompc, selfpc) \
+static inline void mcount_internal (u_long frompc, u_long selfpc)
+
+#define MCOUNT								\
+void _mcount (void *frompc)						\
+{									\
+  mcount_internal ((u_long) frompc, (u_long) RETURN_ADDRESS (0));	\
+}
diff --git a/sysdeps/riscv/memusage.h b/sysdeps/riscv/memusage.h
new file mode 100644
index 000000000000..eec156b3ec68
--- /dev/null
+++ b/sysdeps/riscv/memusage.h
@@ -0,0 +1,21 @@
+/* Machine-specific definitions for memory usage profiling, RISC-V version.
+   Copyright (C) 2000-2017 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/>.  */
+
+#define GETSP() ({ register uintptr_t stack_ptr asm ("sp"); stack_ptr; })
+
+#include <sysdeps/generic/memusage.h>
diff --git a/sysdeps/riscv/setjmp.S b/sysdeps/riscv/setjmp.S
new file mode 100644
index 000000000000..602218dc716b
--- /dev/null
+++ b/sysdeps/riscv/setjmp.S
@@ -0,0 +1,74 @@
+/* setjmp for RISC-V.
+   Copyright (C) 1996-2017 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 <sysdep.h>
+#include <sys/asm.h>
+
+ENTRY (_setjmp)
+  li	a1, 0
+  j	__sigsetjmp
+END (_setjmp)
+ENTRY (setjmp)
+  li	a1, 1
+  /* Fallthrough */
+END (setjmp)
+ENTRY (__sigsetjmp)
+	REG_S ra,  0*SZREG(a0)
+	REG_S s0,  1*SZREG(a0)
+	REG_S s1,  2*SZREG(a0)
+	REG_S s2,  3*SZREG(a0)
+	REG_S s3,  4*SZREG(a0)
+	REG_S s4,  5*SZREG(a0)
+	REG_S s5,  6*SZREG(a0)
+	REG_S s6,  7*SZREG(a0)
+	REG_S s7,  8*SZREG(a0)
+	REG_S s8,  9*SZREG(a0)
+	REG_S s9, 10*SZREG(a0)
+	REG_S s10,11*SZREG(a0)
+	REG_S s11,12*SZREG(a0)
+	REG_S sp, 13*SZREG(a0)
+
+#ifndef __riscv_float_abi_soft
+	FREG_S fs0, 14*SZREG+ 0*SZFREG(a0)
+	FREG_S fs1, 14*SZREG+ 1*SZFREG(a0)
+	FREG_S fs2, 14*SZREG+ 2*SZFREG(a0)
+	FREG_S fs3, 14*SZREG+ 3*SZFREG(a0)
+	FREG_S fs4, 14*SZREG+ 4*SZFREG(a0)
+	FREG_S fs5, 14*SZREG+ 5*SZFREG(a0)
+	FREG_S fs6, 14*SZREG+ 6*SZFREG(a0)
+	FREG_S fs7, 14*SZREG+ 7*SZFREG(a0)
+	FREG_S fs8, 14*SZREG+ 8*SZFREG(a0)
+	FREG_S fs9, 14*SZREG+ 9*SZFREG(a0)
+	FREG_S fs10,14*SZREG+10*SZFREG(a0)
+	FREG_S fs11,14*SZREG+11*SZFREG(a0)
+#endif
+
+#if !IS_IN (libc) && IS_IN (rtld)
+  /* In ld.so we never save the signal mask.  */
+  li a0, 0
+  ret
+#else
+  /* Make a tail call to __sigjmp_save; it takes the same args.  */
+  j __sigjmp_save
+#endif
+
+
+END (__sigsetjmp)
+
+hidden_def (__sigsetjmp)
+weak_alias (_setjmp, __GI__setjmp)
diff --git a/sysdeps/riscv/sys/asm.h b/sysdeps/riscv/sys/asm.h
new file mode 100644
index 000000000000..8ac9059d8e61
--- /dev/null
+++ b/sysdeps/riscv/sys/asm.h
@@ -0,0 +1,78 @@
+/* Miscellaneous macros.
+   Copyright (C) 2000-2017 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 _SYS_ASM_H
+#define _SYS_ASM_H
+
+/*
+ * Macros to handle different pointer/register sizes for 32/64-bit code
+ */
+#if __riscv_xlen == 64
+# define PTRLOG 3
+# define SZREG	8
+# define REG_S sd
+# define REG_L ld
+#elif __riscv_xlen == 32
+# define PTRLOG 2
+# define SZREG	4
+# define REG_S sw
+# define REG_L lw
+#else
+# error __riscv_xlen must equal 32 or 64
+#endif
+
+#if !defined __riscv_float_abi_soft
+/* For ABI uniformity, reserve 8 bytes for floats, even if double-precision
+   floating-point is not supported in hardware.  */
+# if defined __riscv_float_abi_single
+#  define FREG_L flw
+#  define FREG_S fsw
+#  define SZFREG 4
+# elif defined __riscv_float_abi_double
+#  define FREG_L fld
+#  define FREG_S fsd
+#  define SZFREG 8
+# else
+#  error unsupported FLEN
+# endif
+#endif
+
+/*
+ * LEAF - declare leaf routine
+ */
+#define	LEAF(symbol)				\
+		.globl	symbol;			\
+		.align	2;			\
+		.type	symbol,@function;	\
+symbol:						\
+		cfi_startproc;
+
+/*
+ * END - mark end of function
+ */
+#undef END
+#define END(function)				\
+		cfi_endproc;			\
+		.size	function,.-function
+
+/*
+ * Stack alignment
+ */
+#define ALMASK	~15
+
+#endif /* sys/asm.h */
diff --git a/sysdeps/riscv/tls-macros.h b/sysdeps/riscv/tls-macros.h
new file mode 100644
index 000000000000..7431d9ff25e0
--- /dev/null
+++ b/sysdeps/riscv/tls-macros.h
@@ -0,0 +1,60 @@
+/* Macros to support TLS testing in times of missing compiler support.
+   Copyright (C) 2017 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 <sys/cdefs.h>
+#include <sys/asm.h>
+#include <sysdep.h>
+#include "dl-tls.h"
+
+#define LOAD_GP						\
+	".option push\n\t"				\
+	".option norelax\n\t"				\
+	"la gp, __global_pointer$\n\t"			\
+	".option pop\n\t"
+
+#define UNLOAD_GP
+
+#define TLS_GD(x)					\
+	({ void *__result;				\
+	asm (LOAD_GP					\
+	     "la.tls.gd %0, " #x "\n\t"			\
+	     UNLOAD_GP					\
+	     : "=r" (__result));			\
+	__tls_get_addr (__result); })
+
+#define TLS_LD(x) TLS_GD(x)
+
+#define TLS_IE(x)					\
+	({ void *__result;				\
+	asm (LOAD_GP					\
+	     "la.tls.ie %0, " #x "\n\t"			\
+	     UNLOAD_GP					\
+	     : "=r" (__result));			\
+	__tls_get_addr (__result); })
+
+#define TLS_LE(x)					\
+	({ void *__result;				\
+	asm (LOAD_GP					\
+	     "lui %0, %%tprel_hi(" #x ")\n\t"		\
+	     "add %0, %0, tp, %%tprel_add(" #x ")\n\t"	\
+	     "lw %0, %%tprel_lo(" #x ")(%0)\n\t"	\
+	     UNLOAD_GP					\
+	     : "=r" (__result));			\
+	__tls_get_addr (__result); })
-- 
2.13.6

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

* [PATCH v3 03/19] Add linux-4.15 VDSO hash for RISC-V
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (5 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 11/19] RISC-V: Generic <math.h> and soft-fp Routines Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01 12:58   ` Joseph Myers
  2017-12-27  6:06 ` [PATCH v3 17/19] RISC-V: Linux Startup and Dynamic Loading Code Palmer Dabbelt
                   ` (13 subsequent siblings)
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

The RISC-V Linux port defines VDSO symbols
---
 sysdeps/unix/sysv/linux/dl-vdso.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/dl-vdso.h b/sysdeps/unix/sysv/linux/dl-vdso.h
index 7d51a33f802d..c72f307eea3b 100644
--- a/sysdeps/unix/sysv/linux/dl-vdso.h
+++ b/sysdeps/unix/sysv/linux/dl-vdso.h
@@ -44,6 +44,8 @@
 #define VDSO_HASH_LINUX_2_6_15	123718565
 #define VDSO_NAME_LINUX_2_6_29	"LINUX_2.6.29"
 #define VDSO_HASH_LINUX_2_6_29	123718585
+#define VDSO_NAME_LINUX_4_15	"LINUX_4.15"
+#define VDSO_HASH_LINUX_4_15	182943605
 
 /* Functions for resolving symbols in the VDSO link map.  */
 extern void *_dl_vdso_vsym (const char *name,
-- 
2.13.6

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

* [PATCH v3 10/19] RISC-V: Thread-Local Storage Support
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (14 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 06/19] Add RISC-V entries to config.h.in Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2017-12-27  6:06 ` [PATCH v3 04/19] Skeleton documentation for the RISC-V port Palmer Dabbelt
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

This patch implements TLS support for RISC-V.  We support all four
standard TLS addressing modes (LE, IE, LD, and GD) when running on
Linux via NPTL.  There is a draft psABI document that defines our TLS
ABI here

  https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#thread-local-storage
---
 sysdeps/riscv/dl-tls.h             |  48 ++++++++++++
 sysdeps/riscv/libc-tls.c           |  32 ++++++++
 sysdeps/riscv/nptl/tcb-offsets.sym |   6 ++
 sysdeps/riscv/nptl/tls.h           | 145 +++++++++++++++++++++++++++++++++++++
 sysdeps/riscv/stackinfo.h          |  33 +++++++++
 5 files changed, 264 insertions(+)
 create mode 100644 sysdeps/riscv/dl-tls.h
 create mode 100644 sysdeps/riscv/libc-tls.c
 create mode 100644 sysdeps/riscv/nptl/tcb-offsets.sym
 create mode 100644 sysdeps/riscv/nptl/tls.h
 create mode 100644 sysdeps/riscv/stackinfo.h

diff --git a/sysdeps/riscv/dl-tls.h b/sysdeps/riscv/dl-tls.h
new file mode 100644
index 000000000000..b68da07613a9
--- /dev/null
+++ b/sysdeps/riscv/dl-tls.h
@@ -0,0 +1,48 @@
+/* Thread-local storage handling in the ELF dynamic linker.  RISC-V version.
+   Copyright (C) 2011-2017 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/>.  */
+
+
+/* Type used for the representation of TLS information in the GOT.  */
+typedef struct
+{
+  unsigned long int ti_module;
+  unsigned long int ti_offset;
+} tls_index;
+
+/* The thread pointer points to the first static TLS block.  */
+#define TLS_TP_OFFSET		0
+
+/* Dynamic thread vector pointers point 0x800 past the start of each
+   TLS block.  */
+#define TLS_DTV_OFFSET		0x800
+
+/* Compute the value for a GOTTPREL reloc.  */
+#define TLS_TPREL_VALUE(sym_map, sym) \
+  ((sym_map)->l_tls_offset + (sym)->st_value - TLS_TP_OFFSET)
+
+/* Compute the value for a DTPREL reloc.  */
+#define TLS_DTPREL_VALUE(sym) \
+  ((sym)->st_value - TLS_DTV_OFFSET)
+
+extern void *__tls_get_addr (tls_index *ti);
+
+#define GET_ADDR_OFFSET	(ti->ti_offset + TLS_DTV_OFFSET)
+#define __TLS_GET_ADDR(__ti)	(__tls_get_addr (__ti) - TLS_DTV_OFFSET)
+
+/* Value used for dtv entries for which the allocation is delayed.  */
+#define TLS_DTV_UNALLOCATED	((void *) -1l)
diff --git a/sysdeps/riscv/libc-tls.c b/sysdeps/riscv/libc-tls.c
new file mode 100644
index 000000000000..415d6d0ab0c5
--- /dev/null
+++ b/sysdeps/riscv/libc-tls.c
@@ -0,0 +1,32 @@
+/* Thread-local storage handling in the ELF dynamic linker.  RISC-V version.
+   Copyright (C) 2011-2017 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 <csu/libc-tls.c>
+#include <dl-tls.h>
+
+/* On RISC-V, linker optimizations are not required, so __tls_get_addr
+   can be called even in statically linked binaries.  In this case module
+   must be always 1 and PT_TLS segment exist in the binary, otherwise it
+   would not link.  */
+
+void *
+__tls_get_addr (tls_index *ti)
+{
+  dtv_t *dtv = THREAD_DTV ();
+  return (char *) dtv[1].pointer.val + GET_ADDR_OFFSET;
+}
diff --git a/sysdeps/riscv/nptl/tcb-offsets.sym b/sysdeps/riscv/nptl/tcb-offsets.sym
new file mode 100644
index 000000000000..ab4981f2e269
--- /dev/null
+++ b/sysdeps/riscv/nptl/tcb-offsets.sym
@@ -0,0 +1,6 @@
+#include <sysdep.h>
+#include <tls.h>
+
+#define thread_offsetof(mem)	(long)(offsetof (struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
+
+MULTIPLE_THREADS_OFFSET		thread_offsetof (header.multiple_threads)
diff --git a/sysdeps/riscv/nptl/tls.h b/sysdeps/riscv/nptl/tls.h
new file mode 100644
index 000000000000..d4b5bcc6b805
--- /dev/null
+++ b/sysdeps/riscv/nptl/tls.h
@@ -0,0 +1,145 @@
+/* Definition for thread-local data handling.  NPTL/RISC-V version.
+   Copyright (C) 2011-2017 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 _RISCV_TLS_H
+#define _RISCV_TLS_H	1
+
+#include <dl-sysdep.h>
+
+#ifndef __ASSEMBLER__
+# include <stdbool.h>
+# include <stddef.h>
+# include <stdint.h>
+# include <dl-dtv.h>
+
+register void *__thread_self asm ("tp");
+# define READ_THREAD_POINTER() ({ __thread_self; })
+
+/* Get system call information.  */
+# include <sysdep.h>
+
+/* The TP points to the start of the thread blocks.  */
+# define TLS_DTV_AT_TP	1
+# define TLS_TCB_AT_TP	0
+
+/* Get the thread descriptor definition.  */
+# include <nptl/descr.h>
+
+typedef struct
+{
+  dtv_t *dtv;
+  void *private;
+} tcbhead_t;
+
+/* This is the size of the initial TCB.  Because our TCB is before the thread
+   pointer, we don't need this.  */
+# define TLS_INIT_TCB_SIZE	0
+
+/* Alignment requirements for the initial TCB.  */
+# define TLS_INIT_TCB_ALIGN	__alignof__ (struct pthread)
+
+/* This is the size of the TCB.  Because our TCB is before the thread
+   pointer, we don't need this.  */
+# define TLS_TCB_SIZE		0
+
+/* Alignment requirements for the TCB.  */
+# define TLS_TCB_ALIGN		__alignof__ (struct pthread)
+
+/* This is the size we need before TCB - actually, it includes the TCB.  */
+# define TLS_PRE_TCB_SIZE \
+  (sizeof (struct pthread)						      \
+   + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1)))
+
+/* The thread pointer tp points to the end of the TCB.
+   The pthread_descr structure is immediately in front of the TCB. */
+# define TLS_TCB_OFFSET	0
+
+/* Install the dtv pointer.  The pointer passed is to the element with
+   index -1 which contain the length.  */
+# define INSTALL_DTV(tcbp, dtvp) \
+  (((tcbhead_t *) (tcbp))[-1].dtv = (dtvp) + 1)
+
+/* Install new dtv for current thread.  */
+# define INSTALL_NEW_DTV(dtv) \
+  (THREAD_DTV() = (dtv))
+
+/* Return dtv of given thread descriptor.  */
+# define GET_DTV(tcbp) \
+  (((tcbhead_t *) (tcbp))[-1].dtv)
+
+/* Code to initially initialize the thread pointer. */
+# define TLS_INIT_TP(tcbp) \
+  ({ __thread_self = (char*)tcbp + TLS_TCB_OFFSET; NULL; })
+
+/* Return the address of the dtv for the current thread.  */
+# define THREAD_DTV() \
+  (((tcbhead_t *) (READ_THREAD_POINTER () - TLS_TCB_OFFSET))[-1].dtv)
+
+/* Return the thread descriptor for the current thread.  */
+# define THREAD_SELF \
+ ((struct pthread *) (READ_THREAD_POINTER ()			     \
+		      - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE))
+
+/* Value passed to 'clone' for initialization of the thread register.  */
+# define TLS_DEFINE_INIT_TP(tp, pd) \
+  void *tp = (void *) (pd) + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE
+
+/* Magic for libthread_db to know how to do THREAD_SELF.  */
+# define DB_THREAD_SELF \
+  CONST_THREAD_AREA (32, TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE)
+
+/* Access to data in the thread descriptor is easy.  */
+# define THREAD_GETMEM(descr, member) \
+  descr->member
+# define THREAD_GETMEM_NC(descr, member, idx) \
+  descr->member[idx]
+# define THREAD_SETMEM(descr, member, value) \
+  descr->member = (value)
+# define THREAD_SETMEM_NC(descr, member, idx, value) \
+  descr->member[idx] = (value)
+
+/* l_tls_offset == 0 is perfectly valid, so we have to use some different
+   value to mean unset l_tls_offset.  */
+# define NO_TLS_OFFSET		-1
+
+/* Get and set the global scope generation counter in struct pthread.  */
+# define THREAD_GSCOPE_FLAG_UNUSED 0
+# define THREAD_GSCOPE_FLAG_USED   1
+# define THREAD_GSCOPE_FLAG_WAIT   2
+# define THREAD_GSCOPE_RESET_FLAG() \
+  do									     \
+    { int __res								     \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
+			       THREAD_GSCOPE_FLAG_UNUSED);		     \
+      if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE);   \
+    }									     \
+  while (0)
+# define THREAD_GSCOPE_SET_FLAG() \
+  do									     \
+    {									     \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	     \
+      atomic_write_barrier ();						     \
+    }									     \
+  while (0)
+# define THREAD_GSCOPE_WAIT() \
+  GL(dl_wait_lookup_done) ()
+
+#endif /* __ASSEMBLER__ */
+
+#endif	/* tls.h */
diff --git a/sysdeps/riscv/stackinfo.h b/sysdeps/riscv/stackinfo.h
new file mode 100644
index 000000000000..2f0aeb85bfb9
--- /dev/null
+++ b/sysdeps/riscv/stackinfo.h
@@ -0,0 +1,33 @@
+/* Stack environment definitions for RISC-V.
+   Copyright (C) 2011-2017 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/>.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+#include <elf.h>
+
+/* On RISC-V the stack grows down.  */
+#define _STACK_GROWS_DOWN	1
+
+/* Default to a non-executable stack.  */
+#define DEFAULT_STACK_PERMS (PF_R | PF_W)
+
+#endif	/* stackinfo.h */
-- 
2.13.6

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

* [PATCH v3 01/19] Avoid race conditions when rebuilding librt.so
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (3 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 12/19] RISC-V: RV32F Support Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01  1:58   ` Joseph Myers
  2018-01-01  9:26   ` Andreas Schwab
  2017-12-27  6:06 ` [PATCH v3 11/19] RISC-V: Generic <math.h> and soft-fp Routines Palmer Dabbelt
                   ` (15 subsequent siblings)
  20 siblings, 2 replies; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

`make check' sometimes triggers a rebuild of librt.so using
nptl/Makefile, which ignores librt's dependence on libpthread.  This
causes the build to blow up when we attempt to run the test suite on
RISC-V.
---
 nptl/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/nptl/Makefile b/nptl/Makefile
index cf2ba8131b72..be6597e53942 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -612,6 +612,10 @@ else
 librt = $(common-objpfx)rt/librt.a
 endif
 
+# `make check' sometimes triggers a rebuild of librt.so using this Makefile,
+# which ignores librt's dependence on libpthread
+$(common-objpfx)rt/librt.so: $(shared-thread-library)
+
 $(objpfx)tst-cancel17: $(librt)
 $(objpfx)tst-cancelx17: $(librt)
 $(objpfx)tst-_res1mod2.so: $(objpfx)tst-_res1mod1.so
-- 
2.13.6

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

* [PATCH v3 04/19] Skeleton documentation for the RISC-V port
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (15 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 10/19] RISC-V: Thread-Local Storage Support Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2017-12-27  6:06 ` [PATCH v3 14/19] RISC-V: Atomic and Locking Routines Palmer Dabbelt
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

During the upstreaming process it was suggested that I add a handful of
small documentation entries about the RISC-V port, which I've collected
here.
---
 NEWS             | 19 +++++++++++++++----
 README           |  2 ++
 manual/math.texi |  2 +-
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index 95f368340b2d..e46facc728cc 100644
--- a/NEWS
+++ b/NEWS
@@ -40,13 +40,13 @@ Major new features:
   process aborts as the result of assertion failures.
 
 * On platforms where long double has the IEEE binary128 format (aarch64,
-  alpha, mips64, s390 and sparc), the math library now implements _Float128
-  interfaces for that type, as defined by ISO/IEC TS 18661-3:2015.  These
-  are the same interfaces added in version 2.26 for some platforms where
+  alpha, mips64, riscv, s390 and sparc), the math library now implements
+  _Float128 interfaces for that type, as defined by ISO/IEC TS 18661-3:2015.
+  These are the same interfaces added in version 2.26 for some platforms where
   this format is supported but is not the format of long double.
 
 * On platforms with support for _Float64x (aarch64, alpha, i386, ia64,
-  mips64, powerpc64le, s390, sparc and x86_64), the math library now
+  mips64, powerpc64le, riscv, s390, sparc and x86_64), the math library now
   implements interfaces for that type, as defined by ISO/IEC TS
   18661-3:2015.  These are corresponding interfaces to those supported for
   _Float128.
@@ -69,6 +69,17 @@ Major new features:
   collation ordering.  Previous glibc versions used locale-specific
   ordering, the change might break systems that relied on that.
 
+* Support for the RISC-V ISA running on Linux has been added.  This port
+  requires at least binutils-2.30, gcc-7.3.0, and linux-4.15; and is supported
+  for the following ISA and ABI pairs:
+
+    - rv32imac ilp32
+    - rv32imafdc ilp32
+    - rv32imafdc ilp32d
+    - rv64imac lp64
+    - rv64imafdc lp64
+    - rv64imafdc lp64d
+
 Deprecated and removed features, and other changes affecting compatibility:
 
 * On GNU/Linux, the obsolete Linux constant PTRACE_SEIZE_DEVEL is no longer
diff --git a/README b/README
index d0e99ea7d5a0..425a82956fc8 100644
--- a/README
+++ b/README
@@ -39,6 +39,8 @@ 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
 	sparc64*-*-linux-gnu
diff --git a/manual/math.texi b/manual/math.texi
index a9f2a9813832..d19a14b47dc3 100644
--- a/manual/math.texi
+++ b/manual/math.texi
@@ -70,7 +70,7 @@ provided for @code{_Float32}, @code{_Float64} and @code{_Float32x} on
 all platforms.
 It is also provided for @code{_Float128} and @code{_Float64x} on
 powerpc64le (PowerPC 64-bits little-endian), x86_64, x86, ia64,
-aarch64, alpha, mips64, s390 and sparc.
+aarch64, alpha, mips64, riscv, s390 and sparc.
 
 @menu
 * Mathematical Constants::      Precise numeric values for often-used
-- 
2.13.6

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

* [PATCH v3 06/19] Add RISC-V entries to config.h.in
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (13 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 07/19] RISC-V: Build Infastructure Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2017-12-27  6:06 ` [PATCH v3 10/19] RISC-V: Thread-Local Storage Support Palmer Dabbelt
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

These were autogenerated.
---
 config.h.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/config.h.in b/config.h.in
index d928e7dd867c..b0b7cf26cb4b 100644
--- a/config.h.in
+++ b/config.h.in
@@ -100,6 +100,11 @@
 /* AArch64 big endian ABI */
 #undef HAVE_AARCH64_BE
 
+/* RISC-V integer ABI for ld.so.  */
+#undef RISCV_ABI_XLEN
+
+/* RISC-V floating-point ABI for ld.so.  */
+#undef RISCV_ABI_FLEN
 
 /* Linux specific: minimum supported kernel version.  */
 #undef	__LINUX_KERNEL_VERSION
-- 
2.13.6

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

* [PATCH v3 16/19] RISC-V: Linux ABI
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (10 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 13/19] RISC-V: RV32D, RV64F, and RV64D Support Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01 17:35   ` Joseph Myers
  2017-12-27  6:06 ` [PATCH v3 05/19] Add RISC-V dynamic relocations to elf.h Palmer Dabbelt
                   ` (8 subsequent siblings)
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

Linux-specific code that is required for maintaining ABI compatibility.
This doesn't contain the actual system call interface, that is split out
in order to avoid having a patch that's too big.
---
 sysdeps/riscv/nptl/pthread-offsets.h               |  24 ++++
 sysdeps/riscv/nptl/pthreaddef.h                    |  32 +++++
 sysdeps/unix/sysv/linux/riscv/____longjmp_chk.S    |   2 +
 sysdeps/unix/sysv/linux/riscv/bits/fcntl.h         |  62 ++++++++++
 sysdeps/unix/sysv/linux/riscv/bits/mman.h          |  36 ++++++
 sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h    |  32 +++++
 sysdeps/unix/sysv/linux/riscv/flush-icache.c       |  61 ++++++++++
 sysdeps/unix/sysv/linux/riscv/getcontext.S         |  77 ++++++++++++
 sysdeps/unix/sysv/linux/riscv/init-first.c         |  56 +++++++++
 sysdeps/unix/sysv/linux/riscv/libc-vdso.h          |  38 ++++++
 sysdeps/unix/sysv/linux/riscv/makecontext.c        |  71 ++++++++++++
 sysdeps/unix/sysv/linux/riscv/register-dump.h      |  63 ++++++++++
 .../unix/sysv/linux/riscv/rv32/jmp_buf-macros.h    |  53 +++++++++
 .../unix/sysv/linux/riscv/rv64/jmp_buf-macros.h    |  53 +++++++++
 sysdeps/unix/sysv/linux/riscv/setcontext.S         | 114 ++++++++++++++++++
 sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h     |  28 +++++
 sysdeps/unix/sysv/linux/riscv/swapcontext.S        | 125 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/riscv/sys/cachectl.h       |  31 +++++
 sysdeps/unix/sysv/linux/riscv/sys/procfs.h         | 114 ++++++++++++++++++
 sysdeps/unix/sysv/linux/riscv/sys/ucontext.h       | 118 +++++++++++++++++++
 sysdeps/unix/sysv/linux/riscv/sys/user.h           |  23 ++++
 sysdeps/unix/sysv/linux/riscv/sysdep-cancel.h      | 129 +++++++++++++++++++++
 sysdeps/unix/sysv/linux/riscv/ucontext-macros.h    |  49 ++++++++
 sysdeps/unix/sysv/linux/riscv/ucontext_i.sym       |  31 +++++
 24 files changed, 1422 insertions(+)
 create mode 100644 sysdeps/riscv/nptl/pthread-offsets.h
 create mode 100644 sysdeps/riscv/nptl/pthreaddef.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/____longjmp_chk.S
 create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/fcntl.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/mman.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/flush-icache.c
 create mode 100644 sysdeps/unix/sysv/linux/riscv/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/riscv/init-first.c
 create mode 100644 sysdeps/unix/sysv/linux/riscv/libc-vdso.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/makecontext.c
 create mode 100644 sysdeps/unix/sysv/linux/riscv/register-dump.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv64/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/setcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/swapcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/riscv/sys/cachectl.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/sys/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/sys/ucontext.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/sys/user.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/sysdep-cancel.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/ucontext-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/riscv/ucontext_i.sym

diff --git a/sysdeps/riscv/nptl/pthread-offsets.h b/sysdeps/riscv/nptl/pthread-offsets.h
new file mode 100644
index 000000000000..940f496b37e2
--- /dev/null
+++ b/sysdeps/riscv/nptl/pthread-offsets.h
@@ -0,0 +1,24 @@
+/* RISC-V pthread offsets
+   Copyright (C) 2017 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/>.  */
+
+#define __PTHREAD_MUTEX_NUSERS_OFFSET   12
+#define __PTHREAD_MUTEX_KIND_OFFSET     16
+#define __PTHREAD_MUTEX_SPINS_OFFSET    20
+#define __PTHREAD_MUTEX_ELISION_OFFSET  22
+#define __PTHREAD_MUTEX_LIST_OFFSET     24
diff --git a/sysdeps/riscv/nptl/pthreaddef.h b/sysdeps/riscv/nptl/pthreaddef.h
new file mode 100644
index 000000000000..4919be835c63
--- /dev/null
+++ b/sysdeps/riscv/nptl/pthreaddef.h
@@ -0,0 +1,32 @@
+/* pthread machine parameter definitions,  RISC-V version.
+   Copyright (C) 2011-2017 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/>.  */
+
+/* Default stack size.  */
+#define ARCH_STACK_DEFAULT_SIZE	(2 * 1024 * 1024)
+
+/* Required stack pointer alignment at beginning.  */
+#define STACK_ALIGN		16
+
+/* Minimal stack size after allocating thread descriptor and guard size.  */
+#define MINIMAL_REST_STACK	2048
+
+/* Alignment requirement for TCB.  */
+#define TCB_ALIGNMENT		16
+
+/* Location of current stack frame.  */
+#define CURRENT_STACK_FRAME	__builtin_frame_address (0)
diff --git a/sysdeps/unix/sysv/linux/riscv/____longjmp_chk.S b/sysdeps/unix/sysv/linux/riscv/____longjmp_chk.S
new file mode 100644
index 000000000000..e903c7e0df2a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/____longjmp_chk.S
@@ -0,0 +1,2 @@
+#define __longjmp ____longjmp_chk
+#include <__longjmp.S>
diff --git a/sysdeps/unix/sysv/linux/riscv/bits/fcntl.h b/sysdeps/unix/sysv/linux/riscv/bits/fcntl.h
new file mode 100644
index 000000000000..d8cd045319b1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/bits/fcntl.h
@@ -0,0 +1,62 @@
+/* O_*, F_*, FD_* bit values for Linux / RISC-V.
+   Copyright (C) 2011-2017 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	_FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+/* In 64-bit ISA files are always with 64bit off_t and F_*LK64 are the same as
+ * non-64-bit versions.  It will need to be revised for 128-bit.  */
+#if __WORDSIZE == 64
+# define __O_LARGEFILE	0
+
+# define F_GETLK64	5	/* Get record locking info.  */
+# define F_SETLK64	6	/* Set record locking info (non-blocking).  */
+# define F_SETLKW64	7	/* Set record locking info (blocking).	*/
+#endif
+
+struct flock
+  {
+    short int l_type;   /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_whence; /* Where `l_start' is relative to (like `lseek').  */
+#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+    __off_t l_start;    /* Offset where the lock begins.  */
+    __off_t l_len;      /* Size of the locked area; zero means until EOF.  */
+#else
+    __off64_t l_start;  /* Offset where the lock begins.  */
+    __off64_t l_len;    /* Size of the locked area; zero means until EOF.  */
+#endif
+    __pid_t l_pid;      /* Process holding the lock.  */
+  };
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+  {
+    short int l_type;   /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_whence; /* Where `l_start' is relative to (like `lseek').  */
+    __off64_t l_start;  /* Offset where the lock begins.  */
+    __off64_t l_len;    /* Size of the locked area; zero means until EOF.  */
+    __pid_t l_pid;      /* Process holding the lock.  */
+  };
+#endif
+
+/* Include generic Linux declarations.  */
+#include <bits/fcntl-linux.h>
diff --git a/sysdeps/unix/sysv/linux/riscv/bits/mman.h b/sysdeps/unix/sysv/linux/riscv/bits/mman.h
new file mode 100644
index 000000000000..92d3e136aaf1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/bits/mman.h
@@ -0,0 +1,36 @@
+/* Definitions for POSIX memory map interface.  Linux/RISC-V version.
+   Copyright (C) 1997-2017 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 _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN	0x00100		/* Stack-like segment.  */
+# define MAP_DENYWRITE	0x00800		/* ETXTBSY */
+# define MAP_EXECUTABLE	0x01000		/* Mark it as an executable.  */
+# define MAP_LOCKED	0x02000		/* Lock the mapping.  */
+# define MAP_NORESERVE	0x04000		/* Don't check for reservations.  */
+# define MAP_POPULATE	0x08000		/* Populate (prefault) pagetables.  */
+# define MAP_NONBLOCK	0x10000		/* Do not block on IO.  */
+# define MAP_STACK	0x20000		/* Allocation is for a stack.  */
+# define MAP_HUGETLB	0x40000		/* Create huge page mapping.  */
+#endif
+
+/* Include generic Linux declarations.  */
+#include <bits/mman-linux.h>
diff --git a/sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h b/sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h
new file mode 100644
index 000000000000..7d3de8f21c37
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h
@@ -0,0 +1,32 @@
+/* Machine-dependent signal context structure for Linux.  RISC-V version.
+   Copyright (C) 1996-2017 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_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+struct sigcontext {
+  /* gregs[0] holds the program counter. */
+  unsigned long gregs[32];
+  unsigned long long fpregs[66] __attribute__ ((aligned(16)));
+};
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/riscv/flush-icache.c b/sysdeps/unix/sysv/linux/riscv/flush-icache.c
new file mode 100644
index 000000000000..32238e6839d5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/flush-icache.c
@@ -0,0 +1,61 @@
+/* RISC-V instruction cache flushing VDSO calls
+   Copyright (C) 2017 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 <dl-vdso.h>
+#include <stdlib.h>
+#include <atomic.h>
+#include <sys/cachectl.h>
+
+typedef int (*func_type) (void *, void *, unsigned long);
+
+static func_type
+__lookup_riscv_flush_icache (void)
+{
+  PREPARE_VERSION_KNOWN (linux_version, LINUX_4_15);
+
+  func_type func = _dl_vdso_vsym ("__vdso_flush_icache", &linux_version);
+
+  /* The vDSO is required, as there is no exposed system call equivalent.  */
+  if (!func)
+    abort ();
+
+  return func;
+}
+
+#ifdef SHARED
+
+# define INIT_ARCH()
+libc_ifunc (__riscv_flush_icache, __lookup_riscv_flush_icache ())
+
+#else
+
+int
+__riscv_flush_icache (void *start, void *end, unsigned long flags)
+{
+  static volatile func_type cached_func;
+
+  func_type func = cached_func;
+
+  if (!func)
+    cached_func = func = __lookup_riscv_flush_icache ();
+
+  return func (start, end, flags);
+}
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/riscv/getcontext.S b/sysdeps/unix/sysv/linux/riscv/getcontext.S
new file mode 100644
index 000000000000..0203ce49c2eb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/getcontext.S
@@ -0,0 +1,77 @@
+/* Save current context.
+   Copyright (C) 2009-2017 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 "ucontext-macros.h"
+
+/* int getcontext (ucontext_t *ucp) */
+
+	.text
+LEAF (__getcontext)
+	SAVE_INT_REG (ra,   0, a0)
+	SAVE_INT_REG (ra,   1, a0)
+	SAVE_INT_REG (sp,   2, a0)
+	SAVE_INT_REG (s0,   8, a0)
+	SAVE_INT_REG (s1,   9, a0)
+	SAVE_INT_REG (x0,  10, a0)	/* return 0 */
+	SAVE_INT_REG (s2,  18, a0)
+	SAVE_INT_REG (s3,  19, a0)
+	SAVE_INT_REG (s4,  20, a0)
+	SAVE_INT_REG (s5,  21, a0)
+	SAVE_INT_REG (s6,  22, a0)
+	SAVE_INT_REG (s7,  23, a0)
+	SAVE_INT_REG (s8,  24, a0)
+	SAVE_INT_REG (s9,  25, a0)
+	SAVE_INT_REG (s10, 26, a0)
+	SAVE_INT_REG (s11, 27, a0)
+
+#ifndef __riscv_float_abi_soft
+	frsr	a1
+
+	SAVE_FP_REG (fs0,   8, a0)
+	SAVE_FP_REG (fs1,   9, a0)
+	SAVE_FP_REG (fs2,  18, a0)
+	SAVE_FP_REG (fs3,  19, a0)
+	SAVE_FP_REG (fs4,  20, a0)
+	SAVE_FP_REG (fs5,  21, a0)
+	SAVE_FP_REG (fs6,  22, a0)
+	SAVE_FP_REG (fs7,  23, a0)
+	SAVE_FP_REG (fs8,  24, a0)
+	SAVE_FP_REG (fs9,  25, a0)
+	SAVE_FP_REG (fs10, 26, a0)
+	SAVE_FP_REG (fs11, 27, a0)
+
+	sw	a1, MCONTEXT_FSR(a0)
+#endif /* __riscv_float_abi_soft */
+
+/* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
+	li	a3, _NSIG8
+	add     a2, a0, UCONTEXT_SIGMASK
+	mv	a1, zero
+	li	a0, SIG_BLOCK
+
+	li	a7, SYS_ify (rt_sigprocmask)
+	scall
+	bltz	a0, 99f
+
+	ret
+
+99:	j	__syscall_error
+
+PSEUDO_END (__getcontext)
+
+weak_alias (__getcontext, getcontext)
diff --git a/sysdeps/unix/sysv/linux/riscv/init-first.c b/sysdeps/unix/sysv/linux/riscv/init-first.c
new file mode 100644
index 000000000000..69deefd030e6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/init-first.c
@@ -0,0 +1,56 @@
+/* RISC-V VDSO initialization
+   Copyright (C) 2017 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/>.  */
+
+#ifdef SHARED
+# include <dl-vdso.h>
+# include <libc-vdso.h>
+
+long (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *) attribute_hidden;
+long (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *) attribute_hidden;
+long (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
+    attribute_hidden;
+long (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *)
+    attribute_hidden;
+
+static inline void
+_libc_vdso_platform_setup (void)
+{
+  PREPARE_VERSION_KNOWN (linux_version, LINUX_4_15);
+
+  void *p = _dl_vdso_vsym ("__vdso_getcpu", &linux_version);
+  PTR_MANGLE (p);
+  VDSO_SYMBOL(getcpu) = p;
+
+  p = _dl_vdso_vsym ("__vdso_gettimeofday", &linux_version);
+  PTR_MANGLE (p);
+  VDSO_SYMBOL(gettimeofday) = p;
+
+  p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux_version);
+  PTR_MANGLE (p);
+  VDSO_SYMBOL(clock_gettime) = p;
+
+  p = _dl_vdso_vsym ("__vdso_clock_getres", &linux_version);
+  PTR_MANGLE (p);
+  VDSO_SYMBOL(clock_getres) = p;
+}
+
+# define VDSO_SETUP _libc_vdso_platform_setup
+#endif
+
+#include <csu/init-first.c>
diff --git a/sysdeps/unix/sysv/linux/riscv/libc-vdso.h b/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
new file mode 100644
index 000000000000..dc7f5edb186e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
@@ -0,0 +1,38 @@
+/* RISC-V VDSO function declarations
+   Copyright (C) 2017 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 _LIBC_VDSO_H
+#define _LIBC_VDSO_H
+
+#ifdef SHARED
+
+# include <sysdep-vdso.h>
+
+extern long (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
+    attribute_hidden;
+extern long (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
+    attribute_hidden;
+extern long (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
+    attribute_hidden;
+extern long (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *)
+    attribute_hidden;
+
+#endif
+
+#endif /* _LIBC_VDSO_H */
diff --git a/sysdeps/unix/sysv/linux/riscv/makecontext.c b/sysdeps/unix/sysv/linux/riscv/makecontext.c
new file mode 100644
index 000000000000..b9304711479f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/makecontext.c
@@ -0,0 +1,71 @@
+/* Create new context.  RISC-V version.
+   Copyright (C) 2001-2017 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 <sysdep.h>
+#include <sys/asm.h>
+#include <sys/ucontext.h>
+#include <stdarg.h>
+#include <assert.h>
+
+void
+__makecontext (ucontext_t *ucp, void (*func) (void), int argc,
+	       long a0, long a1, long a2, long a3, long a4, ...)
+{
+  extern void __start_context (void) attribute_hidden;
+  long i, sp;
+
+  _Static_assert (REG_NARGS == 8, "__makecontext assumes 8 argument registers");
+
+  /* Set up the stack. */
+  sp = ((long)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size) & ALMASK;
+
+  /* Set up the register context.
+     ra = s0 = 0, terminating the stack for backtracing purposes.
+     s1 = the function we must call.
+     s2 = the subsequent context to run.  */
+  ucp->uc_mcontext.gregs[REG_RA] = 0;
+  ucp->uc_mcontext.gregs[REG_S0 + 0] = 0;
+  ucp->uc_mcontext.gregs[REG_S0 + 1] = (long)func;
+  ucp->uc_mcontext.gregs[REG_S0 + 2] = (long)ucp->uc_link;
+  ucp->uc_mcontext.gregs[REG_SP] = sp;
+  ucp->uc_mcontext.gregs[REG_PC] = (long)&__start_context;
+
+  /* Put args in a0-a7, then put any remaining args on the stack. */
+  ucp->uc_mcontext.gregs[REG_A0 + 0] = a0;
+  ucp->uc_mcontext.gregs[REG_A0 + 1] = a1;
+  ucp->uc_mcontext.gregs[REG_A0 + 2] = a2;
+  ucp->uc_mcontext.gregs[REG_A0 + 3] = a3;
+  ucp->uc_mcontext.gregs[REG_A0 + 4] = a4;
+
+  if (__builtin_expect (argc > 5, 0))
+    {
+      va_list vl;
+      va_start (vl, a4);
+
+      long reg_args = argc < REG_NARGS ? argc : REG_NARGS;
+      sp = (sp - (argc - reg_args) * sizeof (long)) & ALMASK;
+      for (i = 5; i < reg_args; i++)
+        ucp->uc_mcontext.gregs[REG_A0 + i] = va_arg (vl, long);
+      for (i = 0; i < argc - reg_args; i++)
+        ((long*)sp)[i] = va_arg (vl, long);
+
+      va_end (vl);
+    }
+}
+
+weak_alias (__makecontext, makecontext)
diff --git a/sysdeps/unix/sysv/linux/riscv/register-dump.h b/sysdeps/unix/sysv/linux/riscv/register-dump.h
new file mode 100644
index 000000000000..8d5617b49e6c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/register-dump.h
@@ -0,0 +1,63 @@
+/* Dump registers.
+   Copyright (C) 2000-2017 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 <unistd.h>
+#include <string.h>
+#include <_itoa.h>
+
+static void
+hexvalue (unsigned long int value, char *buf, size_t len)
+{
+  char *cp = _itoa_word (value, buf + len, 16, 0);
+  while (cp > buf)
+    *--cp = '0';
+}
+
+#define REGDUMP_NREGS 32
+#define REGDUMP_PER_LINE (80 / (__WORDSIZE/4 + 4))
+
+static void
+register_dump (int fd, ucontext_t *ctx)
+{
+  int i;
+  char regvalue[__WORDSIZE/4 + 1];
+  char str[82 * ((REGDUMP_NREGS + REGDUMP_PER_LINE - 1) / REGDUMP_PER_LINE)];
+
+  static const char names[REGDUMP_NREGS][4] = {
+    "pc", "ra", "sp", "gp", "tp", "t0", "t1", "t2",
+    "s0", "s1", "a0", "a1", "a2", "a3", "a4", "a5",
+    "a6", "a7", "s2", "s3", "s4", "s5", "s6", "s7",
+    "s8", "s9", "sA", "sB", "t3", "t4", "t5", "t6"
+  };
+
+  str[0] = 0;
+  for (i = 0; i < REGDUMP_NREGS; i++)
+    {
+      strcat (str, names[i]);
+      strcat (str, " ");
+      hexvalue (ctx->uc_mcontext.gregs[i], regvalue, __WORDSIZE/4);
+      strcat (str, regvalue);
+
+      if ((i + 1) % REGDUMP_PER_LINE == 0)
+	strcat (str, "\n");
+    }
+
+  write (fd, str, strlen (str));
+}
+
+#define REGISTER_DUMP register_dump (fd, ctx)
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 000000000000..283ce3e97bc2
--- /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 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
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/riscv/rv64/jmp_buf-macros.h
new file mode 100644
index 000000000000..2aa8c8f3129b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/jmp_buf-macros.h
@@ -0,0 +1,53 @@
+/* jump buffer constants for RISC-V
+   Copyright (C) 2017 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 248
+# define JMP_BUF_ALIGN 8
+# define SIGJMP_BUF_SIZE 248
+# define SIGJMP_BUF_ALIGN 8
+# define MASK_WAS_SAVED_OFFSET 112
+# define SAVED_MASK_OFFSET 120
+#elif defined __riscv_float_abi_double
+# define JMP_BUF_SIZE 344
+# define JMP_BUF_ALIGN 8
+# define SIGJMP_BUF_SIZE 344
+# define SIGJMP_BUF_ALIGN 8
+# define MASK_WAS_SAVED_OFFSET 208
+# define SAVED_MASK_OFFSET 216
+#else
+# error "Unknown RISC-V floating-point ABI"
+#endif
diff --git a/sysdeps/unix/sysv/linux/riscv/setcontext.S b/sysdeps/unix/sysv/linux/riscv/setcontext.S
new file mode 100644
index 000000000000..27c14dd9da3f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/setcontext.S
@@ -0,0 +1,114 @@
+/* Set current context.
+   Copyright (C) 2009-2017 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 "ucontext-macros.h"
+
+/*  int __setcontext (const ucontext_t *ucp)
+
+  Restores the machine context in UCP and thereby resumes execution
+  in that context.
+
+  This implementation is intended to be used for *synchronous* context
+  switches only.  Therefore, it does not have to restore anything
+  other than the PRESERVED state.  */
+
+	.text
+LEAF (__setcontext)
+
+	mv	t0, a0					/* t0 <- ucp */
+
+/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8) */
+	li	a3, _NSIG8
+	mv	a2, zero
+	add     a1, a0, UCONTEXT_SIGMASK
+	li	a0, SIG_SETMASK
+
+	li	a7, SYS_ify (rt_sigprocmask)
+	scall
+
+	bltz	a0, 99f
+
+	cfi_def_cfa (t0, 0)
+
+#ifndef __riscv_float_abi_soft
+	lw	t1, MCONTEXT_FSR(t0)
+
+	RESTORE_FP_REG_CFI (fs0,   8, t0)
+	RESTORE_FP_REG_CFI (fs1,   9, t0)
+	RESTORE_FP_REG_CFI (fs2,  18, t0)
+	RESTORE_FP_REG_CFI (fs3,  19, t0)
+	RESTORE_FP_REG_CFI (fs4,  20, t0)
+	RESTORE_FP_REG_CFI (fs5,  21, t0)
+	RESTORE_FP_REG_CFI (fs6,  22, t0)
+	RESTORE_FP_REG_CFI (fs7,  23, t0)
+	RESTORE_FP_REG_CFI (fs8,  24, t0)
+	RESTORE_FP_REG_CFI (fs9,  25, t0)
+	RESTORE_FP_REG_CFI (fs10, 26, t0)
+	RESTORE_FP_REG_CFI (fs11, 27, t0)
+
+	fssr	t1
+#endif /* __riscv_float_abi_soft */
+
+	/* Note the contents of argument registers will be random
+	   unless makecontext() has been called.  */
+	RESTORE_INT_REG     (t1,   0, t0)
+	RESTORE_INT_REG_CFI (ra,   1, t0)
+	RESTORE_INT_REG     (sp,   2, t0)
+	RESTORE_INT_REG_CFI (s0,   8, t0)
+	RESTORE_INT_REG_CFI (s1,   9, t0)
+	RESTORE_INT_REG     (a0,  10, t0)
+	RESTORE_INT_REG     (a1,  11, t0)
+	RESTORE_INT_REG     (a2,  12, t0)
+	RESTORE_INT_REG     (a3,  13, t0)
+	RESTORE_INT_REG     (a4,  14, t0)
+	RESTORE_INT_REG     (a5,  15, t0)
+	RESTORE_INT_REG     (a6,  16, t0)
+	RESTORE_INT_REG     (a7,  17, t0)
+	RESTORE_INT_REG_CFI (s2,  18, t0)
+	RESTORE_INT_REG_CFI (s3,  19, t0)
+	RESTORE_INT_REG_CFI (s4,  20, t0)
+	RESTORE_INT_REG_CFI (s5,  21, t0)
+	RESTORE_INT_REG_CFI (s6,  22, t0)
+	RESTORE_INT_REG_CFI (s7,  23, t0)
+	RESTORE_INT_REG_CFI (s8,  24, t0)
+	RESTORE_INT_REG_CFI (s9,  25, t0)
+	RESTORE_INT_REG_CFI (s10, 26, t0)
+	RESTORE_INT_REG_CFI (s11, 27, t0)
+
+	jr	t1
+
+99:	j	__syscall_error
+
+PSEUDO_END (__setcontext)
+weak_alias (__setcontext, setcontext)
+
+LEAF (__start_context)
+
+	/* Terminate call stack by noting ra == 0.  Happily, s0 == 0 here.  */
+	cfi_register (ra, s0)
+
+	/* Call the function passed to makecontext.  */
+	jalr	s1
+
+	/* Invoke subsequent context if present, else exit(0).  */
+	mv	a0, s2
+	beqz	s2, 1f
+	jal	__setcontext
+1:	j	exit
+
+PSEUDO_END (__start_context)
diff --git a/sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h b/sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h
new file mode 100644
index 000000000000..dba9f76f1a66
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h
@@ -0,0 +1,28 @@
+/* RISC-V definitions for signal handling calling conventions.
+   Copyright (C) 2000-2017 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 <sys/ucontext.h>
+
+#define SIGCONTEXT siginfo_t *_si, ucontext_t *
+#define SIGCONTEXT_EXTRA_ARGS _si,
+#define GET_PC(ctx)	((void *) ctx->uc_mcontext.gregs[REG_PC])
+#define GET_FRAME(ctx)	((void *) ctx->uc_mcontext.gregs[REG_S0])
+#define GET_STACK(ctx)	((void *) ctx->uc_mcontext.gregs[REG_SP])
+
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/riscv/swapcontext.S b/sysdeps/unix/sysv/linux/riscv/swapcontext.S
new file mode 100644
index 000000000000..1cbb3dcf1bdc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/swapcontext.S
@@ -0,0 +1,125 @@
+/* Save and set current context.
+   Copyright (C) 2009-2017 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 "ucontext-macros.h"
+
+/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */
+
+LEAF (__swapcontext)
+	mv	t0, a1					/* t0 <- ucp */
+
+	SAVE_INT_REG (ra,   0, a0)
+	SAVE_INT_REG (ra,   1, a0)
+	SAVE_INT_REG (sp,   2, a0)
+	SAVE_INT_REG (s0,   8, a0)
+	SAVE_INT_REG (s1,   9, a0)
+	SAVE_INT_REG (x0,  10, a0)	/* return 0 */
+	SAVE_INT_REG (s2,  18, a0)
+	SAVE_INT_REG (s3,  19, a0)
+	SAVE_INT_REG (s4,  20, a0)
+	SAVE_INT_REG (s5,  21, a0)
+	SAVE_INT_REG (s6,  22, a0)
+	SAVE_INT_REG (s7,  23, a0)
+	SAVE_INT_REG (s8,  24, a0)
+	SAVE_INT_REG (s9,  25, a0)
+	SAVE_INT_REG (s10, 26, a0)
+	SAVE_INT_REG (s11, 27, a0)
+
+#ifndef __riscv_float_abi_soft
+	frsr a1
+
+	SAVE_FP_REG (fs0,   8, a0)
+	SAVE_FP_REG (fs1,   9, a0)
+	SAVE_FP_REG (fs2,  18, a0)
+	SAVE_FP_REG (fs3,  19, a0)
+	SAVE_FP_REG (fs4,  20, a0)
+	SAVE_FP_REG (fs5,  21, a0)
+	SAVE_FP_REG (fs6,  22, a0)
+	SAVE_FP_REG (fs7,  23, a0)
+	SAVE_FP_REG (fs8,  24, a0)
+	SAVE_FP_REG (fs9,  25, a0)
+	SAVE_FP_REG (fs10, 26, a0)
+	SAVE_FP_REG (fs11, 27, a0)
+
+	sw	a1, MCONTEXT_FSR(a0)
+#endif /* __riscv_float_abi_soft */
+
+/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8) */
+	li	a3, _NSIG8
+	mv	a2, zero
+	add     a1, a0, UCONTEXT_SIGMASK
+	li	a0, SIG_SETMASK
+
+	li	a7, SYS_ify (rt_sigprocmask)
+	scall
+
+	bltz	a0, 99f
+
+#ifndef __riscv_float_abi_soft
+	lw	t1, MCONTEXT_FSR(t0)
+
+	RESTORE_FP_REG (fs0,   8, t0)
+	RESTORE_FP_REG (fs1,   9, t0)
+	RESTORE_FP_REG (fs2,  18, t0)
+	RESTORE_FP_REG (fs3,  19, t0)
+	RESTORE_FP_REG (fs4,  20, t0)
+	RESTORE_FP_REG (fs5,  21, t0)
+	RESTORE_FP_REG (fs6,  22, t0)
+	RESTORE_FP_REG (fs7,  23, t0)
+	RESTORE_FP_REG (fs8,  24, t0)
+	RESTORE_FP_REG (fs9,  25, t0)
+	RESTORE_FP_REG (fs10, 26, t0)
+	RESTORE_FP_REG (fs11, 27, t0)
+
+	fssr	t1
+#endif /* __riscv_float_abi_soft */
+
+	/* Note the contents of argument registers will be random
+	   unless makecontext() has been called.  */
+	RESTORE_INT_REG (t1,   0, t0)
+	RESTORE_INT_REG (ra,   1, t0)
+	RESTORE_INT_REG (sp,   2, t0)
+	RESTORE_INT_REG (s0,   8, t0)
+	RESTORE_INT_REG (s1,   9, t0)
+	RESTORE_INT_REG (a0,  10, t0)
+	RESTORE_INT_REG (a1,  11, t0)
+	RESTORE_INT_REG (a2,  12, t0)
+	RESTORE_INT_REG (a3,  13, t0)
+	RESTORE_INT_REG (a4,  14, t0)
+	RESTORE_INT_REG (a5,  15, t0)
+	RESTORE_INT_REG (a6,  16, t0)
+	RESTORE_INT_REG (a7,  17, t0)
+	RESTORE_INT_REG (s2,  18, t0)
+	RESTORE_INT_REG (s3,  19, t0)
+	RESTORE_INT_REG (s4,  20, t0)
+	RESTORE_INT_REG (s5,  21, t0)
+	RESTORE_INT_REG (s6,  22, t0)
+	RESTORE_INT_REG (s7,  23, t0)
+	RESTORE_INT_REG (s8,  24, t0)
+	RESTORE_INT_REG (s9,  25, t0)
+	RESTORE_INT_REG (s10, 26, t0)
+	RESTORE_INT_REG (s11, 27, t0)
+
+	jr	t1
+
+
+99:	j	__syscall_error
+
+PSEUDO_END (__swapcontext)
+
+weak_alias (__swapcontext, swapcontext)
diff --git a/sysdeps/unix/sysv/linux/riscv/sys/cachectl.h b/sysdeps/unix/sysv/linux/riscv/sys/cachectl.h
new file mode 100644
index 000000000000..6ba37cf7c93b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sys/cachectl.h
@@ -0,0 +1,31 @@
+/* RISC-V instruction cache flushing interface
+   Copyright (C) 2017 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 _SYS_CACHECTL_H
+#define _SYS_CACHECTL_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+extern int __riscv_flush_icache (void *start, void *end, unsigned long flags);
+
+__END_DECLS
+
+#endif /* sys/cachectl.h */
diff --git a/sysdeps/unix/sysv/linux/riscv/sys/procfs.h b/sysdeps/unix/sysv/linux/riscv/sys/procfs.h
new file mode 100644
index 000000000000..83aaadae8529
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sys/procfs.h
@@ -0,0 +1,114 @@
+/* Core image file related definitions, RISC-V version.
+   Copyright (C) 1996-2017 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 _SYS_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  */
+
+#include <features.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/user.h>
+#include <sys/ucontext.h>
+
+/* ELF register definitions */
+#define ELF_NGREG	NGREG
+#define ELF_NFPREG	NFPREG
+
+typedef unsigned long elf_greg_t;
+typedef unsigned long  elf_gregset_t[32];
+typedef union __riscv_fp_state elf_fpregset_t;
+
+__BEGIN_DECLS
+
+struct elf_siginfo
+  {
+    int si_signo;			/* Signal number.  */
+    int si_code;			/* Extra code.  */
+    int si_errno;			/* Errno.  */
+  };
+
+
+/* Definitions to generate Intel SVR4-like core files.  These mostly
+   have the same names as the SVR4 types with "elf_" tacked on the
+   front to prevent clashes with linux definitions, and the typedef
+   forms have been avoided.  This is mostly like the SVR4 structure,
+   but more Linuxy, with things that Linux does not support and which
+   gdb doesn't really use excluded.  Fields present but not used are
+   marked with "XXX".  */
+struct elf_prstatus
+  {
+    struct elf_siginfo pr_info;		/* Info associated with signal.  */
+    short int pr_cursig;		/* Current signal.  */
+    unsigned long int pr_sigpend;	/* Set of pending signals.  */
+    unsigned long int pr_sighold;	/* Set of held signals.  */
+    __pid_t pr_pid;
+    __pid_t pr_ppid;
+    __pid_t pr_pgrp;
+    __pid_t pr_sid;
+    struct timeval pr_utime;		/* User time.  */
+    struct timeval pr_stime;		/* System time.  */
+    struct timeval pr_cutime;		/* Cumulative user time.  */
+    struct timeval pr_cstime;		/* Cumulative system time.  */
+    elf_gregset_t pr_reg;		/* GP registers.  */
+    int pr_fpvalid;			/* True if math copro being used.  */
+  };
+
+
+#define ELF_PRARGSZ     (80)    /* Number of chars for args */
+
+struct elf_prpsinfo
+  {
+    char pr_state;			/* Numeric process state.  */
+    char pr_sname;			/* Char for pr_state.  */
+    char pr_zomb;			/* Zombie.  */
+    char pr_nice;			/* Nice val.  */
+    unsigned long int pr_flag;		/* Flags.  */
+    long pr_uid;
+    long pr_gid;
+    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+    /* Lots missing */
+    char pr_fname[16];			/* Filename of executable.  */
+    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
+  };
+
+/* The rest of this file provides the types for emulation of the
+   Solaris <proc_service.h> interfaces that should be implemented by
+   users of libthread_db.  */
+
+/* Addresses.  */
+typedef void *psaddr_t;
+
+/* Register sets.  Linux has different names.  */
+typedef elf_gregset_t prgregset_t;
+typedef elf_fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+   therefore habe only ine PID type.  */
+typedef __pid_t lwpid_t;
+
+/* Process status and info.  In the end we do provide typedefs for them.  */
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+
+__END_DECLS
+
+#endif	/* sys/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h b/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h
new file mode 100644
index 000000000000..841f6b1f0037
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h
@@ -0,0 +1,118 @@
+/* struct ucontext definition, RISC-V version.
+   Copyright (C) 1997-2017 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/>.  */
+
+/* Don't rely on this, the interface is currently messed up and may need to
+   be broken to be fixed.  */
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
+
+#ifdef __USE_MISC
+# define NGREG	32
+
+# define REG_PC 0
+# define REG_RA 1
+# define REG_SP 2
+# define REG_TP 4
+# define REG_S0 8
+# define REG_A0 10
+# define REG_NARGS 8
+
+typedef unsigned long greg_t;
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+/* Container for floating-point state.  */
+typedef union __riscv_fp_state fpregset_t;
+#endif
+
+struct __riscv_f_ext_state
+  {
+    unsigned int __ctx(f)[32];
+    unsigned int __ctx(fcsr);
+  };
+
+struct __riscv_d_ext_state
+  {
+    unsigned long long __ctx(f[32]);
+    unsigned int __ctx(fcsr);
+  };
+
+struct __riscv_q_ext_state
+  {
+    unsigned long long __ctx(f[64]) __attribute__ ((__aligned__ (16)));
+    unsigned int __ctx(fcsr);
+    /*
+     * Reserved for expansion of sigcontext structure.  Currently zeroed
+     * upon signal, and must be zero upon sigreturn.
+     */
+    unsigned int __ctx(reserved)[3];
+  };
+
+union __riscv_fp_state
+  {
+    struct __riscv_f_ext_state __ctx(f);
+    struct __riscv_d_ext_state __ctx(d);
+    struct __riscv_q_ext_state __ctx(q);
+  };
+
+typedef unsigned long __riscv_gp_state[32];
+
+typedef struct mcontext_t
+  {
+    __riscv_gp_state __ctx(gregs);
+    union  __riscv_fp_state __ctx(fpregs);
+  } mcontext_t;
+
+/* Userlevel context.  */
+typedef struct ucontext_t
+  {
+    unsigned long      __ctx(uc_flags);
+    struct ucontext_t *uc_link;
+    stack_t            uc_stack;
+    sigset_t           uc_sigmask;
+    /* There's some padding here to allow sigset_t to be expanded in the
+     * future.  Though this is unlikely, other architectures put uc_sigmask
+     * at the end of this structure and explicitly state it can be
+     * expanded, so we didn't want to box ourselves in here. */
+    char               __unused[1024 / 8 - sizeof (sigset_t)];
+    /* We can't put uc_sigmask at the end of this structure because we need
+     * to be able to expand sigcontext in the future.  For example, the
+     * vector ISA extension will almost certainly add ISA state.  We want
+     * to ensure all user-visible ISA state can be saved and restored via a
+     * ucontext, so we're putting this at the end in order to allow for
+     * infinite extensibility.  Since we know this will be extended and we
+     * assume sigset_t won't be extended an extreme amount, we're
+     * prioritizing this. */
+    mcontext_t uc_mcontext;
+  } ucontext_t;
+
+#undef __ctx
+
+#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/riscv/sys/user.h b/sysdeps/unix/sysv/linux/riscv/sys/user.h
new file mode 100644
index 000000000000..36248d7b649a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sys/user.h
@@ -0,0 +1,23 @@
+/* Copyright (C) 2001-2017 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 _SYS_USER_H
+#define _SYS_USER_H	1
+
+
+
+#endif	/* _SYS_USER_H */
diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep-cancel.h b/sysdeps/unix/sysv/linux/riscv/sysdep-cancel.h
new file mode 100644
index 000000000000..a2d4e2d15e15
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep-cancel.h
@@ -0,0 +1,129 @@
+/* Assembler macros with cancellation support, RISC-V version.
+   Copyright (C) 2003-2017 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 <sysdep.h>
+#include <sysdeps/generic/sysdep.h>
+#include <tls.h>
+#ifndef __ASSEMBLER__
+# include <nptl/pthreadP.h>
+#endif
+#include <sys/asm.h>
+
+/* Gas will put the initial save of $gp into the CIE, because it appears to
+   happen before any instructions.  So we use cfi_same_value instead of
+   cfi_restore.  */
+
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
+
+# undef PSEUDO
+# define PSEUDO(name, syscall_name, args)				\
+      .align 2;								\
+  L(pseudo_start):							\
+  99: j __syscall_error;						\
+  ENTRY (name)								\
+    SINGLE_THREAD_P(t0);						\
+    bnez t0, L(pseudo_cancel);  					\
+  .type __##syscall_name##_nocancel, @function;				\
+  .globl __##syscall_name##_nocancel;					\
+  __##syscall_name##_nocancel:						\
+    li a7, SYS_ify(syscall_name);					\
+    scall;								\
+    bltz a0, 99b;							\
+    ret;								\
+  .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;	\
+  L(pseudo_cancel):							\
+    addi sp, sp, -STKSPACE;						\
+    REG_S ra, STKOFF_RA(sp);						\
+    cfi_rel_offset (ra, STKOFF_RA);					\
+    PUSHARGS_##args;			/* save syscall args */		\
+    CENABLE;								\
+    REG_S a0, STKOFF_SVMSK(sp);		/* save mask */			\
+    POPARGS_##args;			/* restore syscall args */	\
+    li a7, SYS_ify (syscall_name);					\
+    scall;								\
+    REG_S a0, STKOFF_A0(sp);		/* save syscall result */	\
+    REG_L a0, STKOFF_SVMSK(sp);		/* pass mask as arg1 */		\
+    CDISABLE;								\
+    REG_L ra, STKOFF_RA(sp);		/* restore return address */	\
+    REG_L a0, STKOFF_A0(sp);		/* restore syscall result */	\
+    addi sp, sp, STKSPACE;						\
+    bltz a0, 99b;							\
+  L(pseudo_end):
+
+
+# define PUSHARGS_0	/* nothing to do */
+# define PUSHARGS_1	PUSHARGS_0 REG_S a0, STKOFF_A0(sp); cfi_rel_offset (a0, STKOFF_A0);
+# define PUSHARGS_2	PUSHARGS_1 REG_S a1, STKOFF_A1(sp); cfi_rel_offset (a1, STKOFF_A1);
+# define PUSHARGS_3	PUSHARGS_2 REG_S a2, STKOFF_A2(sp); cfi_rel_offset (a2, STKOFF_A2);
+# define PUSHARGS_4	PUSHARGS_3 REG_S a3, STKOFF_A3(sp); cfi_rel_offset (a3, STKOFF_A3);
+# define PUSHARGS_5	PUSHARGS_4 REG_S a4, STKOFF_A4(sp); cfi_rel_offset (a4, STKOFF_A4);
+# define PUSHARGS_6	PUSHARGS_5 REG_S a5, STKOFF_A5(sp); cfi_rel_offset (a5, STKOFF_A5);
+
+# define POPARGS_0	/* nothing to do */
+# define POPARGS_1	POPARGS_0 REG_L a0, STKOFF_A0(sp);
+# define POPARGS_2	POPARGS_1 REG_L a1, STKOFF_A1(sp);
+# define POPARGS_3	POPARGS_2 REG_L a2, STKOFF_A2(sp);
+# define POPARGS_4	POPARGS_3 REG_L a3, STKOFF_A3(sp);
+# define POPARGS_5	POPARGS_4 REG_L a4, STKOFF_A4(sp);
+# define POPARGS_6	POPARGS_5 REG_L a5, STKOFF_A5(sp);
+
+/* Avoid D$ misses by keeping less-used arguments further down stack.  */
+# define STKOFF_A5	0
+# define STKOFF_A4	(STKOFF_A5 + SZREG)
+# define STKOFF_A3	(STKOFF_A4 + SZREG)
+# define STKOFF_A2	(STKOFF_A3 + SZREG)
+# define STKOFF_A1	(STKOFF_A2 + SZREG)
+# define STKOFF_A0	(STKOFF_A1 + SZREG)
+# define STKOFF_SVMSK	(STKOFF_A0 + SZREG)
+# define STKOFF_RA	(STKOFF_SVMSK + SZREG)
+# define STKSPACE	(STKOFF_RA + SZREG)
+
+# if IS_IN (libpthread)
+#  define CENABLE  call __pthread_enable_asynccancel
+#  define CDISABLE call __pthread_disable_asynccancel
+# elif IS_IN (librt)
+#  define CENABLE  call __librt_enable_asynccancel
+#  define CDISABLE call __librt_disable_asynccancel
+# else
+#  define CENABLE  call __libc_enable_asynccancel
+#  define CDISABLE call __libc_disable_asynccancel
+# endif
+
+# ifndef __ASSEMBLER__
+#  define SINGLE_THREAD_P						\
+	__builtin_expect (THREAD_GETMEM (THREAD_SELF,			\
+					 header.multiple_threads)	\
+			  == 0, 1)
+# else
+#  include "tcb-offsets.h"
+#  define SINGLE_THREAD_P(reg)						\
+	lw reg, MULTIPLE_THREADS_OFFSET(tp)
+#endif
+
+#elif !defined __ASSEMBLER__
+
+# define SINGLE_THREAD_P 1
+# define NO_CANCELLATION 1
+
+#endif
+
+#ifndef __ASSEMBLER__
+# define RTLD_SINGLE_THREAD_P \
+  __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+				   header.multiple_threads) == 0, 1)
+#endif
diff --git a/sysdeps/unix/sysv/linux/riscv/ucontext-macros.h b/sysdeps/unix/sysv/linux/riscv/ucontext-macros.h
new file mode 100644
index 000000000000..9d4e8ffcde8f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/ucontext-macros.h
@@ -0,0 +1,49 @@
+/* Macros for ucontext routines.
+   Copyright (C) 2017 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 _LINUX_RISCV_UCONTEXT_MACROS_H
+#define _LINUX_RISCV_UCONTEXT_MACROS_H
+
+#include <sysdep.h>
+#include <sys/asm.h>
+
+#include "ucontext_i.h"
+
+#define MCONTEXT_FSR (32 * SZFREG + MCONTEXT_FPREGS)
+
+#define SAVE_FP_REG(name, num, base)			\
+  FREG_S name, ((num) * SZFREG + MCONTEXT_FPREGS)(base)
+
+#define RESTORE_FP_REG(name, num, base)			\
+  FREG_L name, ((num) * SZFREG + MCONTEXT_FPREGS)(base)
+
+#define RESTORE_FP_REG_CFI(name, num, base)		\
+  RESTORE_FP_REG (name, num, base);			\
+  cfi_offset (name, (num) * SZFREG + MCONTEXT_FPREGS)
+
+#define SAVE_INT_REG(name, num, base)			\
+  REG_S name, ((num) * SZREG + MCONTEXT_GREGS)(base)
+
+#define RESTORE_INT_REG(name, num, base)		\
+  REG_L name, ((num) * SZREG + MCONTEXT_GREGS)(base)
+
+#define RESTORE_INT_REG_CFI(name, num, base)		\
+  RESTORE_INT_REG (name, num, base);			\
+  cfi_offset (name, (num) * SZREG + MCONTEXT_GREGS)
+
+#endif /* _LINUX_RISCV_UCONTEXT_MACROS_H */
diff --git a/sysdeps/unix/sysv/linux/riscv/ucontext_i.sym b/sysdeps/unix/sysv/linux/riscv/ucontext_i.sym
new file mode 100644
index 000000000000..f30ba391827c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/ucontext_i.sym
@@ -0,0 +1,31 @@
+#include <inttypes.h>
+#include <signal.h>
+#include <stddef.h>
+#include <sys/ucontext.h>
+
+-- Constants used by the rt_sigprocmask call.
+
+SIG_BLOCK
+SIG_SETMASK
+
+_NSIG8				(_NSIG / 8)
+
+-- Offsets of the fields in the ucontext_t structure.
+#define ucontext(member)	offsetof (ucontext_t, member)
+#define stack(member)		ucontext (uc_stack.member)
+#define mcontext(member)	ucontext (uc_mcontext.member)
+
+UCONTEXT_FLAGS			ucontext (uc_flags)
+UCONTEXT_LINK			ucontext (uc_link)
+UCONTEXT_STACK			ucontext (uc_stack)
+UCONTEXT_MCONTEXT		ucontext (uc_mcontext)
+UCONTEXT_SIGMASK		ucontext (uc_sigmask)
+
+STACK_SP			stack (ss_sp)
+STACK_SIZE			stack (ss_size)
+STACK_FLAGS			stack (ss_flags)
+
+MCONTEXT_GREGS			mcontext (gregs)
+MCONTEXT_FPREGS			mcontext (fpregs)
+
+UCONTEXT_SIZE			sizeof (ucontext_t)
-- 
2.13.6

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

* [PATCH v3 07/19] RISC-V: Build Infastructure
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (12 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 05/19] Add RISC-V dynamic relocations to elf.h Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01 13:09   ` Joseph Myers
  2017-12-27  6:06 ` [PATCH v3 06/19] Add RISC-V entries to config.h.in Palmer Dabbelt
                   ` (6 subsequent siblings)
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

This patch lays out the top-level orginazition of the RISC-V port.  It
contains all the Implies files as well as various other fragments of
build infastructure for the RISC-V port.  This contains the only change
to a shared file: config.h.in.

RISC-V is a family of base ISAs with optional extensions.  The base ISAs
are RV32I and RV64I, which are 32-bit and 64-bit integer-only ISAs.
Support for these live in sysdeps/riscv/rv{32,64}.  In addition to these
ISAs, our glibc port supports most of the currently-defined extensions:
the A extension for atomics, the M extension for multiplication, the C
extension for compressed instructions, and the F/D extensions for
single/double precision IEEE floating-point.  Most of these extensions
are handled by GCC, but glibc defines various floating-point wrappers
(in sysdeps/riscv/rv{32,64}/rv{f,d}) and emulation routines (in
sysdeps/riscv/soft-fp).

We support running glibc-based programs on Linux, the suppor for which
lives in sysdeps/unix/sysv/linux/riscv.
---
 sysdeps/riscv/Implies                        |   5 +
 sysdeps/riscv/Makefile                       |  11 ++
 sysdeps/riscv/Versions                       |   4 +
 sysdeps/riscv/configure                      |   4 +
 sysdeps/riscv/configure.ac                   |   4 +
 sysdeps/riscv/nptl/Makefile                  |  26 ++++
 sysdeps/riscv/preconfigure                   |  67 +++++++++
 sysdeps/riscv/rv32/Implies-after             |   1 +
 sysdeps/riscv/rv32/rvd/Implies               |   2 +
 sysdeps/riscv/rv32/rvf/Implies               |   1 +
 sysdeps/riscv/rv64/Implies-after             |   1 +
 sysdeps/riscv/rv64/rvd/Implies               |   3 +
 sysdeps/riscv/rv64/rvf/Implies               |   1 +
 sysdeps/unix/sysv/linux/riscv/Implies        |   1 +
 sysdeps/unix/sysv/linux/riscv/Makefile       |  50 +++++++
 sysdeps/unix/sysv/linux/riscv/Versions       |   5 +
 sysdeps/unix/sysv/linux/riscv/configure      | 210 +++++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/riscv/configure.ac   |  33 +++++
 sysdeps/unix/sysv/linux/riscv/rv32/Implies   |   3 +
 sysdeps/unix/sysv/linux/riscv/rv64/Implies   |   3 +
 sysdeps/unix/sysv/linux/riscv/rv64/Makefile  |   4 +
 sysdeps/unix/sysv/linux/riscv/shlib-versions |  17 +++
 22 files changed, 456 insertions(+)
 create mode 100644 sysdeps/riscv/Implies
 create mode 100644 sysdeps/riscv/Makefile
 create mode 100644 sysdeps/riscv/Versions
 create mode 100644 sysdeps/riscv/configure
 create mode 100644 sysdeps/riscv/configure.ac
 create mode 100644 sysdeps/riscv/nptl/Makefile
 create mode 100644 sysdeps/riscv/preconfigure
 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/riscv/rv64/Implies-after
 create mode 100644 sysdeps/riscv/rv64/rvd/Implies
 create mode 100644 sysdeps/riscv/rv64/rvf/Implies
 create mode 100644 sysdeps/unix/sysv/linux/riscv/Implies
 create mode 100644 sysdeps/unix/sysv/linux/riscv/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/riscv/Versions
 create mode 100755 sysdeps/unix/sysv/linux/riscv/configure
 create mode 100644 sysdeps/unix/sysv/linux/riscv/configure.ac
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/Implies
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv64/Implies
 create mode 100644 sysdeps/unix/sysv/linux/riscv/rv64/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/riscv/shlib-versions

diff --git a/sysdeps/riscv/Implies b/sysdeps/riscv/Implies
new file mode 100644
index 000000000000..c88325b8be16
--- /dev/null
+++ b/sysdeps/riscv/Implies
@@ -0,0 +1,5 @@
+init_array
+
+ieee754/ldbl-128
+ieee754/dbl-64
+ieee754/flt-32
diff --git a/sysdeps/riscv/Makefile b/sysdeps/riscv/Makefile
new file mode 100644
index 000000000000..4401dc2b089d
--- /dev/null
+++ b/sysdeps/riscv/Makefile
@@ -0,0 +1,11 @@
+ifeq ($(subdir),misc)
+sysdep_headers += sys/asm.h
+endif
+
+# RISC-V's assembler also needs to know about PIC as it changes the definition
+# of some assembler macros.
+ASFLAGS-.os += $(pic-ccflag)
+
+ifeq ($(subdir),math)
+CPPFLAGS += -I../soft-fp
+endif
diff --git a/sysdeps/riscv/Versions b/sysdeps/riscv/Versions
new file mode 100644
index 000000000000..aafa348a2395
--- /dev/null
+++ b/sysdeps/riscv/Versions
@@ -0,0 +1,4 @@
+libc {
+  GLIBC_2.27 {
+  }
+}
diff --git a/sysdeps/riscv/configure b/sysdeps/riscv/configure
new file mode 100644
index 000000000000..53f5f1b5f113
--- /dev/null
+++ b/sysdeps/riscv/configure
@@ -0,0 +1,4 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/riscv/elf.
+
+$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
diff --git a/sysdeps/riscv/configure.ac b/sysdeps/riscv/configure.ac
new file mode 100644
index 000000000000..34f62d4b4b82
--- /dev/null
+++ b/sysdeps/riscv/configure.ac
@@ -0,0 +1,4 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/riscv/elf.
+
+AC_DEFINE(PI_STATIC_AND_HIDDEN)
diff --git a/sysdeps/riscv/nptl/Makefile b/sysdeps/riscv/nptl/Makefile
new file mode 100644
index 000000000000..5a4be9b00e93
--- /dev/null
+++ b/sysdeps/riscv/nptl/Makefile
@@ -0,0 +1,26 @@
+# Makefile for sysdeps/riscv/nptl.
+# Copyright (C) 2005-2017 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/>.
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif
+
+ifeq ($(subdir),nptl)
+libpthread-sysdep_routines += nptl-sysdep
+libpthread-shared-only-routines += nptl-sysdep
+endif
diff --git a/sysdeps/riscv/preconfigure b/sysdeps/riscv/preconfigure
new file mode 100644
index 000000000000..5c2b0df33c92
--- /dev/null
+++ b/sysdeps/riscv/preconfigure
@@ -0,0 +1,67 @@
+case "$machine" in
+riscv*)
+    xlen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_xlen \(.*\)/\1/p'`
+    flen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_flen \(.*\)/\1/p'`
+    float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_float_abi_\([^ ]*\) .*/\1/p'`
+    atomic=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep '#define __riscv_atomic' | cut -d' ' -f2`
+    
+    case "$xlen" in
+    32 | 64)
+    	;;
+    *)
+    	echo "Unable to determine XLEN" >&2
+    	exit 1
+    	;;
+    esac
+    
+    case "$flen" in
+    64)
+    	float_machine=rvd
+	with_fp_cond=1
+    	;;
+    32)
+    	float_machine=rvf
+	with_fp_cond=1
+    	;;
+    "")
+    	float_machine=
+	with_fp_cond=0
+    	;;
+    *)
+    	echo "Unable to determine FLEN" >&2
+    	exit 1
+    	;;
+    esac
+    
+    case "$float_abi" in
+    soft)
+    	abi_flen=0
+    	;;
+    single)
+    	abi_flen=32
+    	;;
+    double)
+    	abi_flen=64
+    	;;
+    *)
+    	echo "Unable to determine floating-point ABI" >&2
+    	exit 1
+    	;;
+    esac
+
+    case "$atomic" in
+    __riscv_atomic)
+        ;;
+    *)
+        echo "glibc requires the A extension" >&2
+	exit 1
+	;;
+    esac
+    
+    base_machine=riscv
+    machine=riscv/rv$xlen/$float_machine
+    
+    $as_echo "#define RISCV_ABI_XLEN $xlen" >>confdefs.h
+    $as_echo "#define RISCV_ABI_FLEN $abi_flen" >>confdefs.h
+    ;;
+esac
diff --git a/sysdeps/riscv/rv32/Implies-after b/sysdeps/riscv/rv32/Implies-after
new file mode 100644
index 000000000000..39a34c5f5743
--- /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 000000000000..9438838e98b9
--- /dev/null
+++ b/sysdeps/riscv/rv32/rvd/Implies
@@ -0,0 +1,2 @@
+riscv/rvd
+riscv/rvf
diff --git a/sysdeps/riscv/rv32/rvf/Implies b/sysdeps/riscv/rv32/rvf/Implies
new file mode 100644
index 000000000000..66c401443b8c
--- /dev/null
+++ b/sysdeps/riscv/rv32/rvf/Implies
@@ -0,0 +1 @@
+riscv/rvf
diff --git a/sysdeps/riscv/rv64/Implies-after b/sysdeps/riscv/rv64/Implies-after
new file mode 100644
index 000000000000..a8cae95f9d46
--- /dev/null
+++ b/sysdeps/riscv/rv64/Implies-after
@@ -0,0 +1 @@
+wordsize-64
diff --git a/sysdeps/riscv/rv64/rvd/Implies b/sysdeps/riscv/rv64/rvd/Implies
new file mode 100644
index 000000000000..42fb132d12ae
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvd/Implies
@@ -0,0 +1,3 @@
+riscv/rv64/rvf
+riscv/rvd
+riscv/rvf
diff --git a/sysdeps/riscv/rv64/rvf/Implies b/sysdeps/riscv/rv64/rvf/Implies
new file mode 100644
index 000000000000..66c401443b8c
--- /dev/null
+++ b/sysdeps/riscv/rv64/rvf/Implies
@@ -0,0 +1 @@
+riscv/rvf
diff --git a/sysdeps/unix/sysv/linux/riscv/Implies b/sysdeps/unix/sysv/linux/riscv/Implies
new file mode 100644
index 000000000000..6faec7011569
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/Implies
@@ -0,0 +1 @@
+riscv/nptl
diff --git a/sysdeps/unix/sysv/linux/riscv/Makefile b/sysdeps/unix/sysv/linux/riscv/Makefile
new file mode 100644
index 000000000000..2f7e4eee7096
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/Makefile
@@ -0,0 +1,50 @@
+ifeq ($(subdir),elf)
+sysdep_routines	+= dl-vdso
+ifeq ($(build-shared),yes)
+# This is needed for DSO loading from static binaries.
+sysdep-dl-routines += dl-static
+endif
+endif
+
+ifeq ($(subdir),misc)
+sysdep_headers += sys/cachectl.h
+sysdep_routines += flush-icache
+endif
+
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
+
+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   := (__SIZEOF_INT__ == 4)
+abi-ilp32-condition   += && (__SIZEOF_LONG__ == 4)
+abi-ilp32-condition   += && (__SIZEOF_POINTER__ == 4)
+abi-ilp32-condition   += && (defined __riscv_float_abi_soft)
+abi-ilp32-condition   += && (!defined __riscv_float_abi_single)
+abi-ilp32-condition   += && (!defined __riscv_float_abi_double)
+
+abi-ilp32d-condition  := (__SIZEOF_INT__ == 4)
+abi-ilp32d-condition  += && (__SIZEOF_LONG__ == 4)
+abi-ilp32d-condition  += && (__SIZEOF_POINTER__ == 4)
+abi-ilp32d-condition  += && (!defined __riscv_float_abi_soft)
+abi-ilp32d-condition  += && (!defined __riscv_float_abi_single)
+abi-ilp32d-condition  += && (defined __riscv_float_abi_double)
+
+abi-lp64-condition    := (__SIZEOF_INT__ == 4)
+abi-lp64-condition    += && (__SIZEOF_LONG__ == 8)
+abi-lp64-condition    += && (__SIZEOF_POINTER__ == 8)
+abi-lp64-condition    += && (defined __riscv_float_abi_soft)
+abi-lp64-condition    += && (!defined __riscv_float_abi_single)
+abi-lp64-condition    += && (!defined __riscv_float_abi_double)
+
+abi-lp64d-condition   := (__SIZEOF_INT__ == 4)
+abi-lp64d-condition   += && (__SIZEOF_LONG__ == 8)
+abi-lp64d-condition   += && (__SIZEOF_POINTER__ == 8)
+abi-lp64d-condition   += && (!defined __riscv_float_abi_soft)
+abi-lp64d-condition   += && (!defined __riscv_float_abi_single)
+abi-lp64d-condition   += && (defined __riscv_float_abi_double)
diff --git a/sysdeps/unix/sysv/linux/riscv/Versions b/sysdeps/unix/sysv/linux/riscv/Versions
new file mode 100644
index 000000000000..f61c7e31a0ae
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/Versions
@@ -0,0 +1,5 @@
+libc {
+  GLIBC_2.27 {
+    __riscv_flush_icache;
+  }
+}
diff --git a/sysdeps/unix/sysv/linux/riscv/configure b/sysdeps/unix/sysv/linux/riscv/configure
new file mode 100755
index 000000000000..4dd085a7b0b6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/configure
@@ -0,0 +1,210 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/unix/sysv/linux/riscv.
+
+arch_minimum_kernel=4.15.0
+
+libc_cv_riscv_int_abi=no
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+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 8 8" >/dev/null 2>&1; then :
+  libc_cv_riscv_int_abi=lp64
+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
+
+libc_cv_riscv_float_abi=no
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __riscv_float_abi_double
+		   yes
+		   #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  libc_cv_riscv_float_abi=d
+fi
+rm -f conftest*
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __riscv_float_abi_single
+		   yes
+		   #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  libc_cv_riscv_float_abi=f
+fi
+rm -f conftest*
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __riscv_float_abi_soft
+		   yes
+		   #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  libc_cv_riscv_float_abi=
+fi
+rm -f conftest*
+
+if test $libc_cv_riscv_float_abi = no; then
+  as_fn_error $? "Unable to determine floating-point ABI" "$LINENO" 5
+fi
+
+config_vars="$config_vars
+default-abi = $libc_cv_riscv_int_abi$libc_cv_riscv_float_abi"
diff --git a/sysdeps/unix/sysv/linux/riscv/configure.ac b/sysdeps/unix/sysv/linux/riscv/configure.ac
new file mode 100644
index 000000000000..b9a6207d48d6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/configure.ac
@@ -0,0 +1,33 @@
+sinclude(./aclocal.m4)dnl Autoconf lossage
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/unix/sysv/linux/riscv.
+
+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
+
+libc_cv_riscv_float_abi=no
+AC_EGREP_CPP(yes, [#ifdef __riscv_float_abi_double
+		   yes
+		   #endif
+  ],libc_cv_riscv_float_abi=d)
+AC_EGREP_CPP(yes, [#ifdef __riscv_float_abi_single
+		   yes
+		   #endif
+  ],libc_cv_riscv_float_abi=f)
+AC_EGREP_CPP(yes, [#ifdef __riscv_float_abi_soft
+		   yes
+		   #endif
+  ],libc_cv_riscv_float_abi=)
+if test $libc_cv_riscv_float_abi = no; then
+  AC_MSG_ERROR([Unable to determine floating-point ABI])
+fi
+
+LIBC_CONFIG_VAR([default-abi], [$libc_cv_riscv_int_abi$libc_cv_riscv_float_abi])
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/Implies b/sysdeps/unix/sysv/linux/riscv/rv32/Implies
new file mode 100644
index 000000000000..8b7deb33cd51
--- /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/rv64/Implies b/sysdeps/unix/sysv/linux/riscv/rv64/Implies
new file mode 100644
index 000000000000..f042343bf7b4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/Implies
@@ -0,0 +1,3 @@
+unix/sysv/linux/riscv
+unix/sysv/linux/generic
+unix/sysv/linux/wordsize-64
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/Makefile b/sysdeps/unix/sysv/linux/riscv/rv64/Makefile
new file mode 100644
index 000000000000..cb60d740476d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/Makefile
@@ -0,0 +1,4 @@
+ifeq ($(subdir),socket)
+CFLAGS-recv.c += -fexceptions
+CFLAGS-send.c += -fexceptions
+endif
diff --git a/sysdeps/unix/sysv/linux/riscv/shlib-versions b/sysdeps/unix/sysv/linux/riscv/shlib-versions
new file mode 100644
index 000000000000..fe7322d23a94
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/shlib-versions
@@ -0,0 +1,17 @@
+DEFAULT		GLIBC_2.27
+
+%if RISCV_ABI_XLEN == 64 && RISCV_ABI_FLEN == 64
+ld=ld-linux-riscv64-lp64d.so.1
+%elif RISCV_ABI_XLEN == 64 && RISCV_ABI_FLEN == 32
+ld=ld-linux-riscv64-lp64f.so.1
+%elif RISCV_ABI_XLEN == 64 && RISCV_ABI_FLEN == 0
+ld=ld-linux-riscv64-lp64.so.1
+%elif RISCV_ABI_XLEN == 32 && RISCV_ABI_FLEN == 64
+ld=ld-linux-riscv32-ilp32d.so.1
+%elif RISCV_ABI_XLEN == 32 && RISCV_ABI_FLEN == 32
+ld=ld-linux-riscv32-ilp32f.so.1
+%elif RISCV_ABI_XLEN == 32 && RISCV_ABI_FLEN == 0
+ld=ld-linux-riscv32-ilp32.so.1
+%else
+%error cannot determine ABI
+%endif
-- 
2.13.6

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

* [PATCH v3 05/19] Add RISC-V dynamic relocations to elf.h
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (11 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 16/19] RISC-V: Linux ABI Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01  2:00   ` Joseph Myers
  2017-12-27  6:06 ` [PATCH v3 07/19] RISC-V: Build Infastructure Palmer Dabbelt
                   ` (7 subsequent siblings)
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

These relocations can appear in shared objects on RISC-V ELF systems.
---
 elf/elf.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/elf/elf.h b/elf/elf.h
index 01a43ce9ac51..bf10ade6639b 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -3762,6 +3762,20 @@ enum
 
 #define R_TILEGX_NUM		130
 
+/* RISC-V relocations.  */
+#define R_RISCV_NONE          0
+#define R_RISCV_32            1
+#define R_RISCV_64            2
+#define R_RISCV_RELATIVE      3
+#define R_RISCV_COPY          4
+#define R_RISCV_JUMP_SLOT     5
+#define R_RISCV_TLS_DTPMOD32  6
+#define R_RISCV_TLS_DTPMOD64  7
+#define R_RISCV_TLS_DTPREL32  8
+#define R_RISCV_TLS_DTPREL64  9
+#define R_RISCV_TLS_TPREL32  10
+#define R_RISCV_TLS_TPREL64  11
+
 /* BPF specific declarations.  */
 
 #define R_BPF_NONE		0	/* No reloc */
-- 
2.13.6

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

* [PATCH v3 09/19] RISC-V: Startup and Dynamic Loading Code
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (8 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 08/19] RISC-V: ABI Implementation Palmer Dabbelt
@ 2017-12-27  6:06 ` Palmer Dabbelt
  2018-01-01 14:56   ` Joseph Myers
  2017-12-27  6:06 ` [PATCH v3 13/19] RISC-V: RV32D, RV64F, and RV64D Support Palmer Dabbelt
                   ` (10 subsequent siblings)
  20 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2017-12-27  6:06 UTC (permalink / raw)
  To: libc-alpha; +Cc: patches, Palmer Dabbelt

This patch contains the various bits of support used by the C startup
code and the dynamic loader when running on a RISC-V system.  This
contains the implementation of our PLT entries, various ld.so hooks, and
_start.  This does not contain any Linux-specific code.
---
 sysdeps/riscv/bits/link.h   |  56 ++++++++
 sysdeps/riscv/crti.S        |  32 +++++
 sysdeps/riscv/dl-machine.h  | 308 ++++++++++++++++++++++++++++++++++++++++++++
 sysdeps/riscv/ldsodefs.h    |  47 +++++++
 sysdeps/riscv/linkmap.h     |   4 +
 sysdeps/riscv/sotruss-lib.c |  51 ++++++++
 sysdeps/riscv/start.S       |  80 ++++++++++++
 sysdeps/riscv/tst-audit.h   |  23 ++++
 8 files changed, 601 insertions(+)
 create mode 100644 sysdeps/riscv/bits/link.h
 create mode 100644 sysdeps/riscv/crti.S
 create mode 100644 sysdeps/riscv/dl-machine.h
 create mode 100644 sysdeps/riscv/ldsodefs.h
 create mode 100644 sysdeps/riscv/linkmap.h
 create mode 100644 sysdeps/riscv/sotruss-lib.c
 create mode 100644 sysdeps/riscv/start.S
 create mode 100644 sysdeps/riscv/tst-audit.h

diff --git a/sysdeps/riscv/bits/link.h b/sysdeps/riscv/bits/link.h
new file mode 100644
index 000000000000..067f2298e115
--- /dev/null
+++ b/sysdeps/riscv/bits/link.h
@@ -0,0 +1,56 @@
+/* Machine-specific declarations for dynamic linker interface.  RISC-V version.
+   Copyright (C) 2005-2017 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	_LINK_H
+# error "Never include <bits/link.h> directly; use <link.h> instead."
+#endif
+
+typedef struct La_riscv_regs
+{
+  unsigned long lr_reg[8]; /* a0 - a7 */
+  double lr_fpreg[8]; /* fa0 - fa7 */
+  unsigned long lr_ra;
+  unsigned long lr_sp;
+} La_riscv_regs;
+
+/* Return values for calls from PLT on RISC-V.  */
+typedef struct La_riscv_retval
+{
+  unsigned long lrv_a0;
+  unsigned long lrv_a1;
+  double lrv_fa0;
+  double lrv_fa1;
+} La_riscv_retval;
+
+__BEGIN_DECLS
+
+extern ElfW(Addr) la_riscv_gnu_pltenter (ElfW(Sym) *__sym, unsigned int __ndx,
+					 uintptr_t *__refcook,
+					 uintptr_t *__defcook,
+					 La_riscv_regs *__regs,
+					 unsigned int *__flags,
+					 const char *__symname,
+					 long int *__framesizep);
+extern unsigned int la_riscv_gnu_pltexit (ElfW(Sym) *__sym, unsigned int __ndx,
+					  uintptr_t *__refcook,
+					  uintptr_t *__defcook,
+					  const La_riscv_regs *__inregs,
+					  La_riscv_retval *__outregs,
+					  const char *__symname);
+
+__END_DECLS
diff --git a/sysdeps/riscv/crti.S b/sysdeps/riscv/crti.S
new file mode 100644
index 000000000000..c28222578ef0
--- /dev/null
+++ b/sysdeps/riscv/crti.S
@@ -0,0 +1,32 @@
+/* Facilitate pthread initialization using init_array.
+   Copyright (C) 2017 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 <sys/asm.h>
+
+#ifdef PREINIT_FUNCTION
+
+#if PREINIT_FUNCTION_WEAK
+# error PREINIT_FUNCTION_WEAK is unsupported
+#endif
+
+	.section .init_array, "aw"
+	.dc.a PREINIT_FUNCTION
+
+#endif
diff --git a/sysdeps/riscv/dl-machine.h b/sysdeps/riscv/dl-machine.h
new file mode 100644
index 000000000000..0837487c64b6
--- /dev/null
+++ b/sysdeps/riscv/dl-machine.h
@@ -0,0 +1,308 @@
+/* Machine-dependent ELF dynamic relocation inline functions.  RISC-V version.
+   Copyright (C) 2011-2017 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 dl_machine_h
+#define dl_machine_h
+
+#define ELF_MACHINE_NAME "RISC-V"
+
+#include <entry.h>
+#include <elf/elf.h>
+#include <sys/asm.h>
+#include <dl-tls.h>
+
+#ifndef _RTLD_PROLOGUE
+# define _RTLD_PROLOGUE(entry)						\
+	".globl\t" __STRING(entry) "\n\t"				\
+	".type\t" __STRING(entry) ", @function\n"			\
+	__STRING(entry) ":\n\t"
+#endif
+
+#ifndef _RTLD_EPILOGUE
+# define _RTLD_EPILOGUE(entry)						\
+	".size\t" __STRING(entry) ", . - " __STRING(entry) "\n\t"
+#endif
+
+#define ELF_MACHINE_JMP_SLOT R_RISCV_JUMP_SLOT
+
+#define elf_machine_type_class(type)				\
+  ((ELF_RTYPE_CLASS_PLT * ((type) == ELF_MACHINE_JMP_SLOT	\
+     || (__WORDSIZE == 32 && (type) == R_RISCV_TLS_DTPREL32)	\
+     || (__WORDSIZE == 32 && (type) == R_RISCV_TLS_DTPMOD32)	\
+     || (__WORDSIZE == 32 && (type) == R_RISCV_TLS_TPREL32)	\
+     || (__WORDSIZE == 64 && (type) == R_RISCV_TLS_DTPREL64)	\
+     || (__WORDSIZE == 64 && (type) == R_RISCV_TLS_DTPMOD64)	\
+     || (__WORDSIZE == 64 && (type) == R_RISCV_TLS_TPREL64)))	\
+   | (ELF_RTYPE_CLASS_COPY * ((type) == R_RISCV_COPY)))
+
+#define ELF_MACHINE_NO_REL 1
+#define ELF_MACHINE_NO_RELA 0
+
+/* Return nonzero iff ELF header is compatible with the running host.  */
+static inline int __attribute_used__
+elf_machine_matches_host (const ElfW(Ehdr) *ehdr)
+{
+  return ehdr->e_machine == EM_RISCV;
+}
+
+/* Return the link-time address of _DYNAMIC.  */
+static inline ElfW(Addr)
+elf_machine_dynamic (void)
+{
+  extern ElfW(Addr) _GLOBAL_OFFSET_TABLE_ __attribute__ ((visibility("hidden")));
+  return _GLOBAL_OFFSET_TABLE_;
+}
+
+#define STRINGXP(X) __STRING (X)
+#define STRINGXV(X) STRINGV_ (X)
+#define STRINGV_(...) # __VA_ARGS__
+
+/* Return the run-time load address of the shared object.  */
+static inline ElfW(Addr)
+elf_machine_load_address (void)
+{
+  ElfW(Addr) load_addr;
+  asm ("lla %0, _DYNAMIC" : "=r"(load_addr));
+  return load_addr - elf_machine_dynamic ();
+}
+
+/* Initial entry point code for the dynamic linker.
+   The C function `_dl_start' is the real entry point;
+   its return value is the user program's entry point. */
+
+#define RTLD_START asm (\
+	".text\n\
+	" _RTLD_PROLOGUE(ENTRY_POINT) "\
+	mv a0, sp\n\
+	jal _dl_start\n\
+	# Stash user entry point in s0.\n\
+	mv s0, a0\n\
+	# See if we were run as a command with the executable file\n\
+	# name as an extra leading argument.\n\
+	lw a0, _dl_skip_args\n\
+	# Load the original argument count.\n\
+	" STRINGXP(REG_L) " a1, 0(sp)\n\
+	# Subtract _dl_skip_args from it.\n\
+	sub a1, a1, a0\n\
+	# Adjust the stack pointer to skip _dl_skip_args words.\n\
+	sll a0, a0, " STRINGXP (PTRLOG) "\n\
+	add sp, sp, a0\n\
+	# Save back the modified argument count.\n\
+	" STRINGXP(REG_S) " a1, 0(sp)\n\
+	# Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env) \n\
+	" STRINGXP(REG_L) " a0, _rtld_local\n\
+	add a2, sp, " STRINGXP (SZREG) "\n\
+	sll a3, a1, " STRINGXP (PTRLOG) "\n\
+	add a3, a3, a2\n\
+	add a3, a3, " STRINGXP (SZREG) "\n\
+	# Call the function to run the initializers.\n\
+	jal _dl_init\n\
+	# Pass our finalizer function to _start.\n\
+	lla a0, _dl_fini\n\
+	# Jump to the user entry point.\n\
+	jr s0\n\
+	" _RTLD_EPILOGUE(ENTRY_POINT) "\
+	.previous" \
+);
+
+/* Names of the architecture-specific auditing callback functions.  */
+#define ARCH_LA_PLTENTER riscv_gnu_pltenter
+#define ARCH_LA_PLTEXIT riscv_gnu_pltexit
+
+/* Bias .got.plt entry by the offset requested by the PLT header. */
+#define elf_machine_plt_value(map, reloc, value) (value)
+
+static inline ElfW(Addr)
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+		       const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
+		       const ElfW(Rela) *reloc,
+		       ElfW(Addr) *reloc_addr, ElfW(Addr) value)
+{
+  return *reloc_addr = value;
+}
+
+#endif /* !dl_machine_h */
+
+#ifdef RESOLVE_MAP
+
+/* Perform a relocation described by R_INFO at the location pointed to
+   by RELOC_ADDR.  SYM is the relocation symbol specified by R_INFO and
+   MAP is the object containing the reloc.  */
+
+auto inline void
+__attribute__ ((always_inline))
+elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
+		  const ElfW(Sym) *sym, const struct r_found_version *version,
+		  void *const reloc_addr, int skip_ifunc)
+{
+  ElfW(Addr) r_info = reloc->r_info;
+  const unsigned long int r_type = ELFW(R_TYPE) (r_info);
+  ElfW(Addr) *addr_field = (ElfW(Addr) *) reloc_addr;
+  const ElfW(Sym) *const __attribute__ ((unused)) refsym = sym;
+  struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
+  ElfW(Addr) value = 0;
+  if (sym_map != NULL)
+    value = sym_map->l_addr + sym->st_value + reloc->r_addend;
+
+  switch (r_type)
+    {
+#ifndef RTLD_BOOTSTRAP
+    case __WORDSIZE == 64 ? R_RISCV_TLS_DTPMOD64 : R_RISCV_TLS_DTPMOD32:
+      if (sym_map)
+	*addr_field = sym_map->l_tls_modid;
+      break;
+
+    case __WORDSIZE == 64 ? R_RISCV_TLS_DTPREL64 : R_RISCV_TLS_DTPREL32:
+      if (sym != NULL)
+	*addr_field = TLS_DTPREL_VALUE (sym) + reloc->r_addend;
+      break;
+
+    case __WORDSIZE == 64 ? R_RISCV_TLS_TPREL64 : R_RISCV_TLS_TPREL32:
+      if (sym != NULL)
+	{
+	  CHECK_STATIC_TLS (map, sym_map);
+	  *addr_field = TLS_TPREL_VALUE (sym_map, sym) + reloc->r_addend;
+	}
+      break;
+
+    case R_RISCV_COPY:
+      {
+	if (__builtin_expect (sym == NULL, 0))
+	  /* This can happen in trace mode if an object could not be
+	     found.  */
+	  break;
+
+	/* Handle TLS copy relocations.  */
+	if (__glibc_unlikely (ELFW(ST_TYPE) (sym->st_info) == STT_TLS))
+	  {
+	    /* There's nothing to do if the symbol is in .tbss.  */
+	    if (__glibc_likely (sym->st_value >= sym_map->l_tls_initimage_size))
+	      break;
+	    value += (ElfW(Addr)) sym_map->l_tls_initimage - sym_map->l_addr;
+	  }
+
+	size_t size = sym->st_size;
+	if (__builtin_expect (sym->st_size != refsym->st_size, 0))
+	  {
+	    const char *strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
+	    if (sym->st_size > refsym->st_size)
+	      size = refsym->st_size;
+	    if (sym->st_size > refsym->st_size || GLRO(dl_verbose))
+	      _dl_error_printf ("\
+  %s: Symbol `%s' has different size in shared object, consider re-linking\n",
+				rtld_progname ?: "<program name unknown>",
+				strtab + refsym->st_name);
+	  }
+
+	memcpy (reloc_addr, (void *)value, size);
+	break;
+      }
+#endif
+
+#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
+    case R_RISCV_RELATIVE:
+      {
+# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
+	/* This is defined in rtld.c, but nowhere in the static libc.a;
+	   make the reference weak so static programs can still link.
+	   This declaration cannot be done when compiling rtld.c
+	   (i.e. #ifdef RTLD_BOOTSTRAP) because rtld.c contains the
+	   common defn for _dl_rtld_map, which is incompatible with a
+	   weak decl in the same file.  */
+#  ifndef SHARED
+	weak_extern (GL(dl_rtld_map));
+#  endif
+	if (map != &GL(dl_rtld_map)) /* Already done in rtld itself.  */
+# endif
+	  *addr_field = map->l_addr + reloc->r_addend;
+      break;
+    }
+#endif
+
+    case R_RISCV_JUMP_SLOT:
+    case __WORDSIZE == 64 ? R_RISCV_64 : R_RISCV_32:
+      *addr_field = value;
+      break;
+
+    case R_RISCV_NONE:
+      break;
+
+    default:
+      _dl_reloc_bad_type (map, r_type, 0);
+      break;
+    }
+}
+
+auto inline void
+__attribute__ ((always_inline))
+elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
+			  void *const reloc_addr)
+{
+  *(ElfW(Addr) *)reloc_addr = l_addr + reloc->r_addend;
+}
+
+auto inline void
+__attribute__ ((always_inline))
+elf_machine_lazy_rel (struct link_map *map, ElfW(Addr) l_addr,
+		      const ElfW(Rela) *reloc, int skip_ifunc)
+{
+  ElfW(Addr) *const reloc_addr = (void *) (l_addr + reloc->r_offset);
+  const unsigned int r_type = ELFW(R_TYPE) (reloc->r_info);
+
+  /* Check for unexpected PLT reloc type.  */
+  if (__builtin_expect (r_type == R_RISCV_JUMP_SLOT, 1))
+    {
+      if (__builtin_expect (map->l_mach.plt, 0) == 0)
+	{
+	  if (l_addr)
+	    *reloc_addr += l_addr;
+	}
+      else
+	*reloc_addr = map->l_mach.plt;
+    }
+  else
+    _dl_reloc_bad_type (map, r_type, 1);
+}
+
+/* Set up the loaded object described by L so its stub function
+   will jump to the on-demand fixup code __dl_runtime_resolve.  */
+
+auto inline int
+__attribute__ ((always_inline))
+elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
+{
+#ifndef RTLD_BOOTSTRAP
+  /* If using PLTs, fill in the first two entries of .got.plt.  */
+  if (l->l_info[DT_JMPREL])
+    {
+      extern void _dl_runtime_resolve (void) __attribute__ ((visibility("hidden")));
+      ElfW(Addr) *gotplt = (ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]);
+      /* If a library is prelinked but we have to relocate anyway,
+	 we have to be able to undo the prelinking of .got.plt.
+	 The prelinker saved the address of .plt for us here.  */
+      if (gotplt[1])
+	l->l_mach.plt = gotplt[1] + l->l_addr;
+      gotplt[0] = (ElfW(Addr)) &_dl_runtime_resolve;
+      gotplt[1] = (ElfW(Addr)) l;
+    }
+#endif
+
+  return lazy;
+}
+
+#endif /* RESOLVE_MAP */
diff --git a/sysdeps/riscv/ldsodefs.h b/sysdeps/riscv/ldsodefs.h
new file mode 100644
index 000000000000..91e7a8c88ff5
--- /dev/null
+++ b/sysdeps/riscv/ldsodefs.h
@@ -0,0 +1,47 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+   Copyright (C) 2011-2017 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 _RISCV_LDSODEFS_H
+#define _RISCV_LDSODEFS_H 1
+
+#include <elf.h>
+
+struct La_riscv_regs;
+struct La_riscv_retval;
+
+#define ARCH_PLTENTER_MEMBERS						\
+    ElfW(Addr) (*riscv_gnu_pltenter) (ElfW(Sym) *, unsigned int,	\
+				      uintptr_t *, uintptr_t *,		\
+				      const struct La_riscv_regs *,	\
+				      unsigned int *, const char *name,	\
+				      long int *framesizep);
+
+#define ARCH_PLTEXIT_MEMBERS						\
+    unsigned int (*riscv_gnu_pltexit) (ElfW(Sym) *, unsigned int,	\
+				       uintptr_t *, uintptr_t *,	\
+				       const struct La_riscv_regs *,	\
+				       struct La_riscv_retval *,	\
+				       const char *);
+
+/* The RISC-V ABI specifies that the dynamic section has to be read-only.  */
+
+#define DL_RO_DYN_SECTION 1
+
+#include_next <ldsodefs.h>
+
+#endif
diff --git a/sysdeps/riscv/linkmap.h b/sysdeps/riscv/linkmap.h
new file mode 100644
index 000000000000..a6df7821e675
--- /dev/null
+++ b/sysdeps/riscv/linkmap.h
@@ -0,0 +1,4 @@
+struct link_map_machine
+  {
+    ElfW(Addr) plt; /* Address of .plt */
+  };
diff --git a/sysdeps/riscv/sotruss-lib.c b/sysdeps/riscv/sotruss-lib.c
new file mode 100644
index 000000000000..ef57f6885a96
--- /dev/null
+++ b/sysdeps/riscv/sotruss-lib.c
@@ -0,0 +1,51 @@
+/* Override generic sotruss-lib.c to define actual functions for RISC-V.
+   Copyright (C) 2012-2017 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/>.  */
+
+#define HAVE_ARCH_PLTENTER
+#define HAVE_ARCH_PLTEXIT
+
+#include <elf/sotruss-lib.c>
+
+ElfW(Addr)
+la_riscv_gnu_pltenter (ElfW(Sym) *sym __attribute__ ((unused)),
+		       unsigned int ndx __attribute__ ((unused)),
+		       uintptr_t *refcook, uintptr_t *defcook,
+		       La_riscv_regs *regs, unsigned int *flags,
+		       const char *symname, long int *framesizep)
+{
+  print_enter (refcook, defcook, symname,
+	       regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2],
+	       *flags);
+
+  /* No need to copy anything, we will not need the parameters in any case.  */
+  *framesizep = 0;
+
+  return sym->st_value;
+}
+
+unsigned int
+la_riscv_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+		      uintptr_t *defcook,
+		      const struct La_riscv_regs *inregs,
+		      struct La_riscv_retval *outregs,
+		      const char *symname)
+{
+  print_exit (refcook, defcook, symname, outregs->lrv_a0);
+
+  return 0;
+}
diff --git a/sysdeps/riscv/start.S b/sysdeps/riscv/start.S
new file mode 100644
index 000000000000..9bdb8849b5d5
--- /dev/null
+++ b/sysdeps/riscv/start.S
@@ -0,0 +1,80 @@
+/* Startup code compliant to the ELF RISC-V ABI.
+   Copyright (C) 1995-2017 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.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   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/>.  */
+
+#define __ASSEMBLY__ 1
+#include <entry.h>
+#include <sysdep.h>
+#include <sys/asm.h>
+
+/* The entry point's job is to call __libc_start_main.  Per the ABI,
+   a0 contains the address of a function to be passed to atexit.
+   __libc_start_main wants this in a5.  */
+
+ENTRY (ENTRY_POINT)
+	call  .Lload_gp
+	mv    a5, a0  /* rtld_fini */
+	lla   a0, main
+	REG_L a1, 0(sp)      /* argc */
+	addi  a2, sp, SZREG  /* argv */
+	andi  sp, sp, ALMASK /* Align stack. */
+	lla   a3, __libc_csu_init
+	lla   a4, __libc_csu_fini
+	mv    a6, sp  /* stack_end */
+
+	tail  __libc_start_main@plt
+END (ENTRY_POINT)
+
+/* Dynamic links need the global pointer to be initialized prior to calling
+   any shared library's initializers, so we use preinit_array to load it.
+   This doesn't cut it for static links, though, since the global pointer
+   needs to be initialized before calling __libc_start_main in that case.
+   So we redundantly initialize it at the beginning of _start.  */
+
+.Lload_gp:
+.option push
+.option norelax
+	lla   gp, __global_pointer$
+.option pop
+	ret
+
+	.section .preinit_array,"aw"
+	.dc.a .Lload_gp
+
+/* Define a symbol for the first piece of initialized data.  */
+	.data
+	.globl __data_start
+__data_start:
+	.weak data_start
+	data_start = __data_start
diff --git a/sysdeps/riscv/tst-audit.h b/sysdeps/riscv/tst-audit.h
new file mode 100644
index 000000000000..d49d577f68a6
--- /dev/null
+++ b/sysdeps/riscv/tst-audit.h
@@ -0,0 +1,23 @@
+/* Definitions for testing PLT entry/exit auditing.  RISC-V version.
+   Copyright (C) 2005-2017 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/>.  */
+
+#define pltenter la_riscv_gnu_pltenter
+#define pltexit la_riscv_gnu_pltexit
+#define La_regs La_riscv_regs
+#define La_retval La_riscv_retval
+#define int_retval lrv_a0
-- 
2.13.6

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

* Re: RISC-V glibc Port v3
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (18 preceding siblings ...)
  2017-12-27  6:06 ` [PATCH v3 18/19] RISC-V: Add ABI Lists Palmer Dabbelt
@ 2018-01-01  1:48 ` Joseph Myers
  2018-01-02 13:01 ` Florian Weimer
  20 siblings, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-01-01  1:48 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> in (I'm running another build now, but it'll take hours).  We still need to get
> things running natively to see the test suite results, but I think I've

Again, that will be needed to complete the patch review - full test 
results for all supported configurations of the port are important 
information for the review that may help point out issues with the port 
that need to be addressed.

> * I need to add a soft-fp directory, which should be very quick to do but all
>   my build machines are tied up running build-many-glibcs.py 

You mean a nofpu directory?

> * Many copyright cleanups.

Of course the next version of the port will need to use <year>-2018 
copyright date ranges in all new files now.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 19/19] Add RISC-V to build-many-glibcs.py
  2017-12-27  6:06 ` [PATCH v3 19/19] Add RISC-V to build-many-glibcs.py Palmer Dabbelt
@ 2018-01-01  1:55   ` Joseph Myers
  0 siblings, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-01-01  1:55 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> +        self.add_config(arch='riscv64',
> +                        os_name='linux-gnu',
> +                        glibcs=[{'variant': 'rv64imafdc-lp64d',
> +                                 'ccopts': '-march=rv64imafdc -mabi=lp64d',
> +                                 'cfg': ['--libdir=/usr/lib64/lp64d',
> +                                         'libc_cv_slibdir=/lib64/lp64d',
> +                                         'libc_cv_rtlddir=/lib']},

You shouldn't need any of those --libdir libc_cv_slibdir libc_cv_rtlddir 
settings in build-many-glibcs.py - they indicate something is missing in 
the port itself.  Specifically, you should have a LIBC_SLIBDIR_RTLDDIR 
call in an appropriate sysdeps configure.ac file or files.

Also, the use of lib<something>/<something> subdirectories will break the 
handling of --strip, which expects to be able to strip lib*/*.so and catch 
all the shared libraries that way.  Probably that code should change to 
something like '%s $(find %s/lib* -name "*.so")' in place of the present 
'%s %s/lib*/*.so', supposing that does work.

(Most RISC-V build-many-glibcs.py testing of course only needs to test 
building compilers and glibc for the configurations you're adding.  But 
for the --strip fix you should test at least one other configuration as 
well to make sure --strip continues to work in existing configurations 
with e.g. lib and lib64 directories.  There should be no need for any of 
your build-many-glibcs.py testing to use the full set of configurations 
for all architectures.)

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 01/19] Avoid race conditions when rebuilding librt.so
  2017-12-27  6:06 ` [PATCH v3 01/19] Avoid race conditions when rebuilding librt.so Palmer Dabbelt
@ 2018-01-01  1:58   ` Joseph Myers
  2018-01-01  9:26   ` Andreas Schwab
  1 sibling, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-01-01  1:58 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> `make check' sometimes triggers a rebuild of librt.so using
> nptl/Makefile, which ignores librt's dependence on libpthread.  This
> causes the build to blow up when we attempt to run the test suite on
> RISC-V.

OK, please commit, fixed as noted (with an appropriate ChangeLog entry, of 
course).

> +# `make check' sometimes triggers a rebuild of librt.so using this Makefile,

Should use neutral vertical quotes now in all new comments, 'make check', 
not `'.

> +# which ignores librt's dependence on libpthread

Need '.' at end of comment.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 02/19] Allow make-link-multidir to make subdirectories
  2017-12-27  6:05 ` [PATCH v3 02/19] Allow make-link-multidir to make subdirectories Palmer Dabbelt
@ 2018-01-01  1:59   ` Joseph Myers
  2018-01-01  9:35   ` Andreas Schwab
  1 sibling, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-01-01  1:59 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> The RISC-V Linux ABI doesn't define any libraries that go directly in
> lib, instead they go into lib/ilp32 or lib/lp64.  This casuse
> make-link-multidir to fail when attempting to make library directories
> when building a static libc on multilib RISC-V systems.
> 
> This patch adds '-p' to mkdir so it will make subdirectories.  I've
> added "." as an argument so mkdir won't error out if no directories are
> provided -- I think "mkdir -p ." should always do nothing.

OK, please commit, with an appropriate ChangeLog entry.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 05/19] Add RISC-V dynamic relocations to elf.h
  2017-12-27  6:06 ` [PATCH v3 05/19] Add RISC-V dynamic relocations to elf.h Palmer Dabbelt
@ 2018-01-01  2:00   ` Joseph Myers
  0 siblings, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-01-01  2:00 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> These relocations can appear in shared objects on RISC-V ELF systems.

OK, please commit, with an appropriate ChangeLog entry.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 01/19] Avoid race conditions when rebuilding librt.so
  2017-12-27  6:06 ` [PATCH v3 01/19] Avoid race conditions when rebuilding librt.so Palmer Dabbelt
  2018-01-01  1:58   ` Joseph Myers
@ 2018-01-01  9:26   ` Andreas Schwab
  2018-01-06  5:50     ` Palmer Dabbelt
  1 sibling, 1 reply; 57+ messages in thread
From: Andreas Schwab @ 2018-01-01  9:26 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

Who is racing with whom?  There should not be any parallelism involved
here.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH v3 02/19] Allow make-link-multidir to make subdirectories
  2017-12-27  6:05 ` [PATCH v3 02/19] Allow make-link-multidir to make subdirectories Palmer Dabbelt
  2018-01-01  1:59   ` Joseph Myers
@ 2018-01-01  9:35   ` Andreas Schwab
  1 sibling, 0 replies; 57+ messages in thread
From: Andreas Schwab @ 2018-01-01  9:35 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Dez 26 2017, Palmer Dabbelt <palmer@dabbelt.com> wrote:

> This patch adds '-p' to mkdir so it will make subdirectories.  I've
> added "." as an argument so mkdir won't error out if no directories are
> provided -- I think "mkdir -p ." should always do nothing.

You can use $(addprefix) like make-target-directory.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH v3 03/19] Add linux-4.15 VDSO hash for RISC-V
  2017-12-27  6:06 ` [PATCH v3 03/19] Add linux-4.15 VDSO hash for RISC-V Palmer Dabbelt
@ 2018-01-01 12:58   ` Joseph Myers
  2018-01-05 13:50     ` Joseph Myers
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-01-01 12:58 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

OK, please commit with an appropriate ChangeLog entry.

See <https://sourceware.org/glibc/wiki/Committer%20checklist> for 
committer instructions.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 07/19] RISC-V: Build Infastructure
  2017-12-27  6:06 ` [PATCH v3 07/19] RISC-V: Build Infastructure Palmer Dabbelt
@ 2018-01-01 13:09   ` Joseph Myers
  2018-01-05  3:25     ` Darius Rad
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-01-01 13:09 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> diff --git a/sysdeps/riscv/Versions b/sysdeps/riscv/Versions
> new file mode 100644
> index 000000000000..aafa348a2395
> --- /dev/null
> +++ b/sysdeps/riscv/Versions
> @@ -0,0 +1,4 @@
> +libc {
> +  GLIBC_2.27 {
> +  }
> +}

I still don't see why this file should be needed.  You need more 
explanation than "IIRC some test was depending on this." for such an empty 
GLIBC_2.27 version here (and the explanation ought to go in a comment in 
the file to justify why the file exists).

> diff --git a/sysdeps/riscv/preconfigure b/sysdeps/riscv/preconfigure
> +    case "$float_abi" in
> +    soft)
> +    	abi_flen=0
> +    	;;
> +    single)
> +    	abi_flen=32
> +    	;;

I'd expect the "single" case to be removed or made into an error, given 
the decision not to support the "f" ABIs.

> +abi-ilp32-condition   := (__SIZEOF_INT__ == 4)
> +abi-ilp32-condition   += && (__SIZEOF_LONG__ == 4)
> +abi-ilp32-condition   += && (__SIZEOF_POINTER__ == 4)
> +abi-ilp32-condition   += && (defined __riscv_float_abi_soft)
> +abi-ilp32-condition   += && (!defined __riscv_float_abi_single)
> +abi-ilp32-condition   += && (!defined __riscv_float_abi_double)

You don't need such long and redundant conditions.  I'd expect something 
simpler like on other architectures (e.g. !defined __LP64__ && defined 
__riscv_float_abi_soft in this case - in general, just checking one macro 
for the ILP32/LP64 distinction, one for the floating-point ABI).

> diff --git a/sysdeps/unix/sysv/linux/riscv/configure.ac b/sysdeps/unix/sysv/linux/riscv/configure.ac

> +AC_EGREP_CPP(yes, [#ifdef __riscv_float_abi_single
> +		   yes
> +		   #endif
> +  ],libc_cv_riscv_float_abi=f)

I'd expect this "f" ABI support to go away.

> diff --git a/sysdeps/unix/sysv/linux/riscv/shlib-versions b/sysdeps/unix/sysv/linux/riscv/shlib-versions

> +%elif RISCV_ABI_XLEN == 64 && RISCV_ABI_FLEN == 32
> +ld=ld-linux-riscv64-lp64f.so.1

> +%elif RISCV_ABI_XLEN == 32 && RISCV_ABI_FLEN == 32
> +ld=ld-linux-riscv32-ilp32f.so.1

Again, I'd expect the "f" ABI support to go away.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 08/19] RISC-V: ABI Implementation
  2017-12-27  6:06 ` [PATCH v3 08/19] RISC-V: ABI Implementation Palmer Dabbelt
@ 2018-01-01 13:29   ` Joseph Myers
  0 siblings, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-01-01 13:29 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> diff --git a/sysdeps/riscv/bits/setjmp.h b/sysdeps/riscv/bits/setjmp.h

> +    /* Callee-saved floating point registers.  */
> +#ifdef __riscv_float_abi_single
> +   float __fpregs[12];

More stray "f" ABI support to remove given that ABI's not being supported.

> diff --git a/sysdeps/riscv/dl-trampoline.S b/sysdeps/riscv/dl-trampoline.S

Your ABI document says that the floating-point ABI passes arguments in 
floating-point registers, and those argument registers are not preserved 
across calls.

This means that (in the hard-float ABI case) _dl_runtime_resolve needs to 
preserve those registers in case the dynamic linker clobbers them.  Even 
if you somehow ensure that no dynamic linker code uses those registers 
(e.g. compile the dynamic linker with -ffixed-* options for them), the 
dynamic linker can call user code (audit modules, interposed malloc, IFUNC 
resolvers - you don't have IFUNC support for RISC-V at present, but the 
other cases still apply).  If such user code, called during symbol 
resolution, were to change those call-clobbered argument registers, that 
would corrupt the floating-point arguments to the function being called.

> diff --git a/sysdeps/riscv/machine-gmon.h b/sysdeps/riscv/machine-gmon.h

> +static void mcount_internal (u_long frompc, u_long selfpc);
> +
> +#define _MCOUNT_DECL(frompc, selfpc) \
> +static inline void mcount_internal (u_long frompc, u_long selfpc)
> +
> +#define MCOUNT								\
> +void _mcount (void *frompc)						\
> +{									\
> +  mcount_internal ((u_long) frompc, (u_long) RETURN_ADDRESS (0));	\

Please use "unsigned long int", not the legacy "u_long" name, in new code.  
(Note that the sys/gmon.h header, which this is probably meant to match, 
now uses "unsigned long" after Zack's installed header cleanups.)

> diff --git a/sysdeps/riscv/sys/asm.h b/sysdeps/riscv/sys/asm.h

> +/* For ABI uniformity, reserve 8 bytes for floats, even if double-precision
> +   floating-point is not supported in hardware.  */
> +# if defined __riscv_float_abi_single

More stray "f" ABI support here.

> +/*
> + * LEAF - declare leaf routine
> + */

Please see my previous comments in 
<https://sourceware.org/ml/libc-alpha/2017-12/msg00742.html> regarding 
proper GNU comment formatting, for this and other macros in this file.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 09/19] RISC-V: Startup and Dynamic Loading Code
  2017-12-27  6:06 ` [PATCH v3 09/19] RISC-V: Startup and Dynamic Loading Code Palmer Dabbelt
@ 2018-01-01 14:56   ` Joseph Myers
  2018-01-04 18:34     ` Darius Rad
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-01-01 14:56 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> +/* Return the link-time address of _DYNAMIC.  */
> +static inline ElfW(Addr)
> +elf_machine_dynamic (void)
> +{
> +  extern ElfW(Addr) _GLOBAL_OFFSET_TABLE_ __attribute__ ((visibility("hidden")));

Missing space between "visibility" and "(".  Please check for and fix such 
issues throughout the patch series.

> +/* Return the run-time load address of the shared object.  */
> +static inline ElfW(Addr)
> +elf_machine_load_address (void)
> +{
> +  ElfW(Addr) load_addr;
> +  asm ("lla %0, _DYNAMIC" : "=r"(load_addr));

Missing space before "(load_addr)".  Again, please check for and fix such 
issues in asms throughout the patch series.

> +  /* Check for unexpected PLT reloc type.  */
> +  if (__builtin_expect (r_type == R_RISCV_JUMP_SLOT, 1))
> +    {
> +      if (__builtin_expect (map->l_mach.plt, 0) == 0)

When __builtin_expect is being used for a boolean condition, please use 
__glibc_likely and __glibc_unlikely instead throughout this patch series.  
So that's __glibc_likely (r_type == R_RISCV_JUMP_SLOT) and __glibc_likely 
(map->l_mach.plt == 0), in this case.

> +auto inline int
> +__attribute__ ((always_inline))
> +elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
> +{
> +#ifndef RTLD_BOOTSTRAP
> +  /* If using PLTs, fill in the first two entries of .got.plt.  */
> +  if (l->l_info[DT_JMPREL])
> +    {
> +      extern void _dl_runtime_resolve (void) __attribute__ ((visibility("hidden")));

Another missing space in visibility attribute.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 11/19] RISC-V: Generic <math.h> and soft-fp Routines
  2017-12-27  6:06 ` [PATCH v3 11/19] RISC-V: Generic <math.h> and soft-fp Routines Palmer Dabbelt
@ 2018-01-01 15:02   ` Joseph Myers
  2018-01-04 18:36     ` Darius Rad
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-01-01 15:02 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> +    FE_INVALID   =
> +#define FE_INVALID	(0x10)
> +      FE_INVALID,
> +  };

C90 / C++98 don't support trailing commas in enum definitions, and I don't 
think that's one of the extensions beyond those standards that we intend 
to require for compilers to use glibc headers (unlike long long, anonymous 
structs / unions, and probably alignment attributes and asm redirection of 
functions in certain cases).  Though I see such trailing commas have crept 
into some other architectures' enum definitions; we don't have any good 
testing for headers only using the intended features with anything else 
being appropriately conditioned on compiler support.

> +    FE_UPWARD     =
> +#define FE_UPWARD	(0x3)
> +      FE_UPWARD,

Likewise.

> +# define _FCLASS(x) ({ int res; \
> +  if (sizeof (x) * 8 > __riscv_flen) __builtin_trap (); \
> +  if (sizeof (x) == 4) asm ("fclass.s %0, %1" : "=r" (res) : "f" (x)); \
> +  else if (sizeof (x) == 8) asm ("fclass.d %0, %1" : "=r" (res) : "f" (x)); \
> +  else __builtin_trap (); \
> +  res; })

If this is meant to be a public interface for users of fpu_control.h, then 
(a) you need to use __res not plain res for the variable used in this 
macro, and (b) it needs to use (__extension__ ({ ... })).  If it's only 
intended for use within glibc then it should go in an internal header, not 
an installed one.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 12/19] RISC-V: RV32F Support
  2017-12-27  6:06 ` [PATCH v3 12/19] RISC-V: RV32F Support Palmer Dabbelt
@ 2018-01-01 16:51   ` Joseph Myers
  2018-01-04 18:41     ` Darius Rad
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-01-01 16:51 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> diff --git a/sysdeps/riscv/e_sqrtl.c b/sysdeps/riscv/e_sqrtl.c
> new file mode 100644
> index 000000000000..e80a5b0d5b7e
> --- /dev/null
> +++ b/sysdeps/riscv/e_sqrtl.c
> @@ -0,0 +1,39 @@
> +/* long double square root in software floating-point emulation.
> +   Copyright (C) 1997-2017 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +   Contributed by Richard Henderson (rth@cygnus.com) and
> +		  Jakub Jelinek (jj@ultra.linux.cz).

No "Contributed by" in new files, including where copied from or based on 
existing files (your commit message / ChangeLog entry can note where a 
file is substantially copied from some other existing file).

> +long
> +__lroundf (float x)
> +{
> +  long res;

The glibc style is "long int", not plain "long" (likewise unsigned long 
int, long long int, unsigned long long int).  Please check for this 
throughout the patch series.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 13/19] RISC-V: RV32D, RV64F, and RV64D Support
  2017-12-27  6:06 ` [PATCH v3 13/19] RISC-V: RV32D, RV64F, and RV64D Support Palmer Dabbelt
@ 2018-01-01 17:08   ` Joseph Myers
  2018-01-04 18:50     ` Darius Rad
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-01-01 17:08 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> +long
> +__lrint (double x)
> +{
> +  long res;

long int, as in the previous patch.

> +long
> +__lround (double x)
> +{
> +  long res;

Likewise.

> +long long
> +__llrintf (float x)
> +{
> +  long res;
> +  asm ("fcvt.w.s %0, %1" : "=r" (res) : "f" (x));
> +  return res;

Likewise (long long int), and I don't see how "long res;" here can be 
correct at all, since this is in an rv32 file, and float can represent 
integers outside the range of 32-bit long, which need to be correctly 
converted to 64-bit long long for this function.  Maybe llrintf should 
actually be rv64-only, since you need to convert to a 64-bit integer?

> +long
> +__lrintf (float x)
> +{
> +  long res;

Likewise.

> diff --git a/sysdeps/riscv/rv64/rvd/s_ceil.c b/sysdeps/riscv/rv64/rvd/s_ceil.c

> +      long i;

I would like to suggest, throughout the rv64 functions, where you are 
using long (as here) for a 64-bit internal temporary (as opposed to long 
int actually being part of the defined function API), you use int64_t 
instead of changing long -> long int - after all, the instructions you are 
using are defined to convert to/from 64-bit integers.  That way, the code 
would work unchanged if you support RV64 ILP32 in future, whereas if you 
use long int you need to change it again to support RV64 ILP32.

(More generally, if what you want about an integer type is a particular 
number of bits, using intN_t / uintN_t is encouraged.  That's definitely 
the case when using asm instructions as here that are defined to use 
integers with a given number of bits rather than linked to the C ABI.)

> +      long i;

Same in floor.

> +long long
> +__llrint (double x)
> +{
> +  long long res;

Use long long int.

> +long long
> +__llround (double x)
> +{
> +  long long res;

Use long long int.

> +long
> +__lrint (double x)
> +{
> +  long res;
> +  asm ("fcvt.l.d %0, %1" : "=r" (res) : "f" (x));

Use long int (but note a further change would be needed in future for RV64 
ILP32 where you want a conversion to 32-bit not 64-bit integer in the 
asm).

> +long
> +__lround (double x)
> +{
> +  long res;
> +  asm ("fcvt.l.d %0, %1, rmm" : "=r" (res) : "f" (x));

Likewise.

> +      long i;

int64_t in nearbyint as elsewhere.

> +      long i;

Likewise in rint.

> +      long i;

Likewise in round.

> +      long i;

Likewise in roundeven.

> +      long i;

Likewise in trunc.

> +long long
> +__llrintf (float x)
> +{
> +  long long res;

long long int.

> +#include <libm-alias-float.h>
> +#include <libm-alias-float.h>

You don't want to include the same header twice in a row (this is in 
llroundf).

> +long long
> +__llroundf (float x)
> +{
> +  long long res;

long long int.

> +long
> +__lrintf (float x)
> +{
> +  long res;
> +  asm ("fcvt.l.s %0, %1" : "=r" (res) : "f" (x));

long int (again, would need to change for ILP32 support).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 14/19] RISC-V: Atomic and Locking Routines
  2017-12-27  6:06 ` [PATCH v3 14/19] RISC-V: Atomic and Locking Routines Palmer Dabbelt
@ 2018-01-01 17:12   ` Joseph Myers
  2018-01-04 18:52     ` Darius Rad
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-01-01 17:12 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> diff --git a/sysdeps/unix/sysv/linux/riscv/atomic-machine.h b/sysdeps/unix/sysv/linux/riscv/atomic-machine.h

> +#include <inttypes.h>

Do you really need inttypes.h here, or just stdint.h?

> +#define atomic_full_barrier() __sync_synchronize()

Missing space before '(' in call to __sync_synchronize.

> +# define asm_amo(which, ordering, mem, value) ({ 		\
> +  __atomic_check_size(mem);					\
> +  typeof(*mem) __tmp; 						\
> +  if (sizeof(__tmp) == 4)					\
> +    asm volatile (which ".w" ordering "\t%0, %z2, %1"		\
> +		  : "=r"(__tmp), "+A"(*(mem))			\
> +		  : "rJ"(value));				\
> +  else if (sizeof(__tmp) == 8)					\
> +    asm volatile (which ".d" ordering "\t%0, %z2, %1"		\
> +		  : "=r"(__tmp), "+A"(*(mem))			\
> +		  : "rJ"(value));				\
> +  else								\
> +    abort();							\
> +  __tmp; })

Lots of missing spaces before '(' there, after __atomic_check_size, 
typeof, sizeof, abort, strings in asms.

> +# define atomic_max(mem, value) asm_amo("amomaxu", ".aq", mem, value)
> +# define atomic_min(mem, value) asm_amo("amominu", ".aq", mem, value)

Missing spaces in calls to asm_amo.

> +# define atomic_bit_test_set(mem, bit)                   \
> +  ({ typeof(*mem) __mask = (typeof(*mem))1 << (bit);    \
> +     asm_amo("amoor", ".aq", mem, __mask) & __mask; })
> +
> +# define catomic_exchange_and_add(mem, value)		\
> +  atomic_exchange_and_add(mem, value)
> +# define catomic_max(mem, value) atomic_max(mem, value)

More missing spaces in calls to typeof, asm_amo, atomic_exchange_and_add, 
atomic_max.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 15/19] RISC-V: Linux Syscall Interface
  2017-12-27  6:06 ` [PATCH v3 15/19] RISC-V: Linux Syscall Interface Palmer Dabbelt
@ 2018-01-01 17:18   ` Joseph Myers
  2018-01-05 14:04   ` Adhemerval Zanella
  1 sibling, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-01-01 17:18 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> diff --git a/sysdeps/unix/sysv/linux/riscv/arch-fork.h b/sysdeps/unix/sysv/linux/riscv/arch-fork.h
> new file mode 100644
> index 000000000000..9a2465b58e5a
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/riscv/arch-fork.h
> @@ -0,0 +1,27 @@
> +/* Internal definitions for thread-friendly fork implementation.  Linux/i386.
> +   Copyright (C) 2002-2017 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.

No "Contributed by" in new files, even when copied.

> diff --git a/sysdeps/unix/sysv/linux/riscv/pt-vfork.S b/sysdeps/unix/sysv/linux/riscv/pt-vfork.S

> +/* libpthread used to have its own vfork implementation that differed
> +   from libc's only in having a pointless micro-optimization.  There
> +   is no longer any use to having a separate copy in libpthread, but
> +   the historical ABI requires it.  For static linking, there is no
> +   need to provide anything here--the libc version will be linked in.
> +   For shared library ABI compatibility, there must be __vfork and
> +   vfork symbols in libpthread.so.  */
> +
> +#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \
> +     || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20))

No file for a new port should include SHLIB_COMPAT conditionals on 
versions that don't exist for that port.

I think that means this file can just be a one-line

/* Not needed.  */

or similar comment (no copyright / license notice needed in that case).

> +long
> +syscall (long syscall_number, long arg1, long arg2, long arg3, long arg4,
> +	 long arg5, long arg6, long arg7)
> +{
> +  long ret;

long int.

> +  INTERNAL_SYSCALL_DECL (err);
> +
> +  ret = INTERNAL_SYSCALL_NCS (syscall_number, err, 7, arg1, arg2, arg3, arg4,
> +			      arg5, arg6, arg7);
> +
> +  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
> +    {
> +      extern long __syscall_error (long neg_errno);
> +      return __syscall_error (ret);

Avoid such block-scope function declarations.  Include some header that 
declares __syscall_error instead.

> diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h
> +/* Define a macro which expands into the inline wrapper code for a system
> +   call.  */
> +# undef INLINE_SYSCALL
> +# define INLINE_SYSCALL(name, nr, args...)				\
> +  ({ INTERNAL_SYSCALL_DECL (err);					\
> +     long __sys_result = INTERNAL_SYSCALL (name, err, nr, args);	\

long int.

> +# define INTERNAL_SYSCALL_ERROR_P(val, err)   ((unsigned long) (val) > -4096UL)

unsigned long int.

> +# define internal_syscall0(number, err, dummy...)			\
> +({ 									\
> +	long _sys_result;						\
> +									\
> +	{								\
> +	register long __a7 asm("a7") = number;				\
> +	register long __a0 asm("a0");					\

More uses of long int, throughout all these macros.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 16/19] RISC-V: Linux ABI
  2017-12-27  6:06 ` [PATCH v3 16/19] RISC-V: Linux ABI Palmer Dabbelt
@ 2018-01-01 17:35   ` Joseph Myers
  0 siblings, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-01-01 17:35 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> diff --git a/sysdeps/unix/sysv/linux/riscv/____longjmp_chk.S b/sysdeps/unix/sysv/linux/riscv/____longjmp_chk.S
> new file mode 100644
> index 000000000000..e903c7e0df2a
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/riscv/____longjmp_chk.S
> @@ -0,0 +1,2 @@
> +#define __longjmp ____longjmp_chk
> +#include <__longjmp.S>

Same comment as before about how this doesn't actually seem to implement 
____longjmp_chk semantics for stack checks which include using 
sigaltstack.

> diff --git a/sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h b/sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h

> +struct sigcontext {
> +  /* gregs[0] holds the program counter. */
> +  unsigned long gregs[32];
> +  unsigned long long fpregs[66] __attribute__ ((aligned(16)));

Should use __aligned__ (even though this struct isn't part of a standard, 
there's no reason to take the identifier aligned from the user's 
namespace).  And missing space before "(16)".

> +int
> +__riscv_flush_icache (void *start, void *end, unsigned long flags)
> +{
> +  static volatile func_type cached_func;
> +
> +  func_type func = cached_func;
> +
> +  if (!func)
> +    cached_func = func = __lookup_riscv_flush_icache ();

I think we now prefer to explicitly use relaxed atomic loads and stores 
for such static variables that could be accessed from multiple threads at 
once (that shouldn't change the code generated).

The question of whether there should be a leading __ on the function name 
has been discussed separately.

> diff --git a/sysdeps/unix/sysv/linux/riscv/init-first.c b/sysdeps/unix/sysv/linux/riscv/init-first.c

> +long (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *) attribute_hidden;
> +long (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *) attribute_hidden;
> +long (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
> +    attribute_hidden;
> +long (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *)
> +    attribute_hidden;

long int, unsigned int.

> diff --git a/sysdeps/unix/sysv/linux/riscv/libc-vdso.h b/sysdeps/unix/sysv/linux/riscv/libc-vdso.h

> +extern long (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
> +    attribute_hidden;
> +extern long (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
> +    attribute_hidden;
> +extern long (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
> +    attribute_hidden;
> +extern long (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *)
> +    attribute_hidden;

Likewise.

> +void
> +__makecontext (ucontext_t *ucp, void (*func) (void), int argc,
> +	       long a0, long a1, long a2, long a3, long a4, ...)
> +{
> +  extern void __start_context (void) attribute_hidden;
> +  long i, sp;

long int, and likewise elsewhere in this function.

> +  /* Set up the stack. */
> +  sp = ((long)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size) & ALMASK;

Should have spaces in casts, (long int) ucp->uc_stack.ss_sp, and likewise 
elsewhere in this function.

> +  if (__builtin_expect (argc > 5, 0))

__glibc_unlikely, as elsewhere.

> diff --git a/sysdeps/unix/sysv/linux/riscv/register-dump.h b/sysdeps/unix/sysv/linux/riscv/register-dump.h

> +      hexvalue (ctx->uc_mcontext.gregs[i], regvalue, __WORDSIZE/4);

Missing spaces, __WORDSIZE / 4.

> diff --git a/sysdeps/unix/sysv/linux/riscv/sys/cachectl.h b/sysdeps/unix/sysv/linux/riscv/sys/cachectl.h

> +extern int __riscv_flush_icache (void *start, void *end, unsigned long flags);

As discussed elsewhere, need __ on parameter names.

> diff --git a/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h b/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h

> +/* Don't rely on this, the interface is currently messed up and may need to
> +   be broken to be fixed.  */

You need to make sure you get the interface right, at least at the ABI 
level, before the port goes in.

> +#ifdef __USE_MISC
> +# define __ctx(fld) fld
> +#else
> +# define __ctx(fld) __ ## fld
> +#endif

The use of __ctx in other sys/ucontext.h headers was a matter of keeping 
maximum API compatibility with existing users, that might expect fields to 
be present with given names without leading __ in the default case (when 
__USE_MISC is defined), while having POSIX compatibility in the strict 
POSIX case when the field names without __ are not allowed.

Since you don't have existing users, that issue does not apply here.  I 
think it would be best for all the fields not permitted by POSIX to have 
leading __ unconditionally, so that you expose the same API for those 
fields both with and without __USE_MISC, and don't need __ctx.

> +typedef unsigned long greg_t;

unsigned long int.  Likewise elsewhere in this file.

> +struct __riscv_d_ext_state
> +  {
> +    unsigned long long __ctx(f[32]);

unsigned long long int (or uint64_t).  Likewise elsewhere in this file.

> +    /*
> +     * Reserved for expansion of sigcontext structure.  Currently zeroed
> +     * upon signal, and must be zero upon sigreturn.
> +     */

Stray leading '*' on comment lines.

> +    unsigned int __ctx(reserved)[3];

Reserved space should definitely use the __glibc_reserved* naming 
convention, unconditionally, no __ctx.

> +    /* There's some padding here to allow sigset_t to be expanded in the
> +     * future.  Though this is unlikely, other architectures put uc_sigmask
> +     * at the end of this structure and explicitly state it can be
> +     * expanded, so we didn't want to box ourselves in here. */
> +    char               __unused[1024 / 8 - sizeof (sigset_t)];
> +    /* We can't put uc_sigmask at the end of this structure because we need
> +     * to be able to expand sigcontext in the future.  For example, the
> +     * vector ISA extension will almost certainly add ISA state.  We want
> +     * to ensure all user-visible ISA state can be saved and restored via a
> +     * ucontext, so we're putting this at the end in order to allow for
> +     * infinite extensibility.  Since we know this will be extended and we
> +     * assume sigset_t won't be extended an extreme amount, we're
> +     * prioritizing this. */

Comment style, and use of __glibc_reserved, again.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 17/19] RISC-V: Linux Startup and Dynamic Loading Code
  2017-12-27  6:06 ` [PATCH v3 17/19] RISC-V: Linux Startup and Dynamic Loading Code Palmer Dabbelt
@ 2018-01-01 17:35   ` Joseph Myers
  0 siblings, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-01-01 17:35 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> +#define SYSDEP_KNOWN_INTERPRETER_NAMES				\
> +  { LD_SO_PREFIX LD_SO_ABI "d" LD_SO_SUFFIX, FLAG_ELF_LIBC6 },	\
> +  { LD_SO_PREFIX LD_SO_ABI "f" LD_SO_SUFFIX, FLAG_ELF_LIBC6 },	\
> +  { LD_SO_PREFIX LD_SO_ABI     LD_SO_SUFFIX, FLAG_ELF_LIBC6 },

Stray handling of the "f" ABI, should be removed.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 18/19] RISC-V: Add ABI Lists
  2017-12-27  6:06 ` [PATCH v3 18/19] RISC-V: Add ABI Lists Palmer Dabbelt
@ 2018-01-01 17:37   ` Joseph Myers
  0 siblings, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-01-01 17:37 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

On Tue, 26 Dec 2017, Palmer Dabbelt wrote:

> The libm-test-ulps* are just placeholders, so they're almost certainly
> nonsense.  Aside from those, I started with the aarch64 ABI lists and

(That is, truncate libm-test-ulps and run "make regen-ulps".)

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: RISC-V glibc Port v3
  2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
                   ` (19 preceding siblings ...)
  2018-01-01  1:48 ` RISC-V glibc Port v3 Joseph Myers
@ 2018-01-02 13:01 ` Florian Weimer
  2018-01-04 14:16   ` Christoph Hellwig
  20 siblings, 1 reply; 57+ messages in thread
From: Florian Weimer @ 2018-01-02 13:01 UTC (permalink / raw)
  To: Palmer Dabbelt, libc-alpha; +Cc: patches

On 12/27/2017 07:05 AM, Palmer Dabbelt wrote:
> It's been about a week since the last patch set, and while there's a bit more
> work to do I wanted to get something out so everyone is one the same page.  The
> major milestone here is that we now pass build-many-glibcs.py -- or at least we
> did a few hours ago, but I've rebased recently so some trouble may have snuck
> in (I'm running another build now, but it'll take hours).  We still need to get
> things running natively to see the test suite results, but I think I've
> responded to all the feedback from v2 patch set aside from the what's listed
> below.  Sorry if I've missed anything, feel free to just poke the v2 email so
> it ends up back in my inbox.

Is there some documentation of the assembler syntax?

The assembler code uses some instructions which appear to have 
ABI-specific defaults, and I can't find documentation for them, neither 
in the ISA manual nor in the psABI supplement.

Thanks,
Florian

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

* Re: RISC-V glibc Port v3
  2018-01-02 13:01 ` Florian Weimer
@ 2018-01-04 14:16   ` Christoph Hellwig
  2018-01-04 15:12     ` Florian Weimer
  2018-01-04 19:49     ` Palmer Dabbelt
  0 siblings, 2 replies; 57+ messages in thread
From: Christoph Hellwig @ 2018-01-04 14:16 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Palmer Dabbelt, libc-alpha, patches

On Tue, Jan 02, 2018 at 02:01:45PM +0100, Florian Weimer wrote:
> Is there some documentation of the assembler syntax?
>
> The assembler code uses some instructions which appear to have ABI-specific 
> defaults, and I can't find documentation for them, neither in the ISA 
> manual nor in the psABI supplement.

Chapter 20 of the RISC-V ISA spec contains an assembly writers
handbook that documents the ABI register aliases and pseudo-instructions
if that is what you are looking for.

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

* Re: RISC-V glibc Port v3
  2018-01-04 14:16   ` Christoph Hellwig
@ 2018-01-04 15:12     ` Florian Weimer
  2018-01-04 19:49     ` Palmer Dabbelt
  1 sibling, 0 replies; 57+ messages in thread
From: Florian Weimer @ 2018-01-04 15:12 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Palmer Dabbelt, libc-alpha, patches

On 01/04/2018 03:16 PM, Christoph Hellwig wrote:
> On Tue, Jan 02, 2018 at 02:01:45PM +0100, Florian Weimer wrote:
>> Is there some documentation of the assembler syntax?
>>
>> The assembler code uses some instructions which appear to have ABI-specific
>> defaults, and I can't find documentation for them, neither in the ISA
>> manual nor in the psABI supplement.
> 
> Chapter 20 of the RISC-V ISA spec contains an assembly writers
> handbook that documents the ABI register aliases and pseudo-instructions
> if that is what you are looking for.

Thanks, I missed that the PDF is only partially searchable.

Florian

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

* Re: [PATCH v3 09/19] RISC-V: Startup and Dynamic Loading Code
  2018-01-01 14:56   ` Joseph Myers
@ 2018-01-04 18:34     ` Darius Rad
  0 siblings, 0 replies; 57+ messages in thread
From: Darius Rad @ 2018-01-04 18:34 UTC (permalink / raw)
  To: Joseph Myers, Palmer Dabbelt; +Cc: libc-alpha, patches

On 01/01/2018 09:55 AM, Joseph Myers wrote:
> On Tue, 26 Dec 2017, Palmer Dabbelt wrote:
> 
>> +/* Return the link-time address of _DYNAMIC.  */
>> +static inline ElfW(Addr)
>> +elf_machine_dynamic (void)
>> +{
>> +  extern ElfW(Addr) _GLOBAL_OFFSET_TABLE_ __attribute__ ((visibility("hidden")));
> 
> Missing space between "visibility" and "(".  Please check for and fix such 
> issues throughout the patch series.
> 

Thanks, I'll fix here and elsewhere in the series.

>> +/* Return the run-time load address of the shared object.  */
>> +static inline ElfW(Addr)
>> +elf_machine_load_address (void)
>> +{
>> +  ElfW(Addr) load_addr;
>> +  asm ("lla %0, _DYNAMIC" : "=r"(load_addr));
> 
> Missing space before "(load_addr)".  Again, please check for and fix such 
> issues in asms throughout the patch series.
> 

Will do.

>> +  /* Check for unexpected PLT reloc type.  */
>> +  if (__builtin_expect (r_type == R_RISCV_JUMP_SLOT, 1))
>> +    {
>> +      if (__builtin_expect (map->l_mach.plt, 0) == 0)
> 
> When __builtin_expect is being used for a boolean condition, please use 
> __glibc_likely and __glibc_unlikely instead throughout this patch series.  
> So that's __glibc_likely (r_type == R_RISCV_JUMP_SLOT) and __glibc_likely 
> (map->l_mach.plt == 0), in this case.
> 

Understood, thanks.  I'll fix here and throughout.

>> +auto inline int
>> +__attribute__ ((always_inline))
>> +elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
>> +{
>> +#ifndef RTLD_BOOTSTRAP
>> +  /* If using PLTs, fill in the first two entries of .got.plt.  */
>> +  if (l->l_info[DT_JMPREL])
>> +    {
>> +      extern void _dl_runtime_resolve (void) __attribute__ ((visibility("hidden")));
> 
> Another missing space in visibility attribute.
> 

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

* Re: [PATCH v3 11/19] RISC-V: Generic <math.h> and soft-fp Routines
  2018-01-01 15:02   ` Joseph Myers
@ 2018-01-04 18:36     ` Darius Rad
  0 siblings, 0 replies; 57+ messages in thread
From: Darius Rad @ 2018-01-04 18:36 UTC (permalink / raw)
  To: Joseph Myers, Palmer Dabbelt; +Cc: libc-alpha, patches

On 01/01/2018 10:02 AM, Joseph Myers wrote:
> On Tue, 26 Dec 2017, Palmer Dabbelt wrote:
> 
>> +    FE_INVALID   =
>> +#define FE_INVALID	(0x10)
>> +      FE_INVALID,
>> +  };
> 
> C90 / C++98 don't support trailing commas in enum definitions, and I don't 
> think that's one of the extensions beyond those standards that we intend 
> to require for compilers to use glibc headers (unlike long long, anonymous 
> structs / unions, and probably alignment attributes and asm redirection of 
> functions in certain cases).  Though I see such trailing commas have crept 
> into some other architectures' enum definitions; we don't have any good 
> testing for headers only using the intended features with anything else 
> being appropriately conditioned on compiler support.
> 

Thanks, I'll remove them.

>> +    FE_UPWARD     =
>> +#define FE_UPWARD	(0x3)
>> +      FE_UPWARD,
> 
> Likewise.
> 
>> +# define _FCLASS(x) ({ int res; \
>> +  if (sizeof (x) * 8 > __riscv_flen) __builtin_trap (); \
>> +  if (sizeof (x) == 4) asm ("fclass.s %0, %1" : "=r" (res) : "f" (x)); \
>> +  else if (sizeof (x) == 8) asm ("fclass.d %0, %1" : "=r" (res) : "f" (x)); \
>> +  else __builtin_trap (); \
>> +  res; })
> 
> If this is meant to be a public interface for users of fpu_control.h, then 
> (a) you need to use __res not plain res for the variable used in this 
> macro, and (b) it needs to use (__extension__ ({ ... })).  If it's only 
> intended for use within glibc then it should go in an internal header, not 
> an installed one.
> 

Ok, thanks.  I think we want it public, so I'll make the necessary changes.

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

* Re: [PATCH v3 12/19] RISC-V: RV32F Support
  2018-01-01 16:51   ` Joseph Myers
@ 2018-01-04 18:41     ` Darius Rad
  0 siblings, 0 replies; 57+ messages in thread
From: Darius Rad @ 2018-01-04 18:41 UTC (permalink / raw)
  To: Joseph Myers, Palmer Dabbelt; +Cc: libc-alpha, patches

On 01/01/2018 11:51 AM, Joseph Myers wrote:
> On Tue, 26 Dec 2017, Palmer Dabbelt wrote:
> 
>> diff --git a/sysdeps/riscv/e_sqrtl.c b/sysdeps/riscv/e_sqrtl.c
>> new file mode 100644
>> index 000000000000..e80a5b0d5b7e
>> --- /dev/null
>> +++ b/sysdeps/riscv/e_sqrtl.c
>> @@ -0,0 +1,39 @@
>> +/* long double square root in software floating-point emulation.
>> +   Copyright (C) 1997-2017 Free Software Foundation, Inc.
>> +   This file is part of the GNU C Library.
>> +   Contributed by Richard Henderson (rth@cygnus.com) and
>> +		  Jakub Jelinek (jj@ultra.linux.cz).
> 
> No "Contributed by" in new files, including where copied from or based on 
> existing files (your commit message / ChangeLog entry can note where a 
> file is substantially copied from some other existing file).
> 

Ok, thanks.  I'll remove here and elsewhere.

>> +long
>> +__lroundf (float x)
>> +{
>> +  long res;
> 
> The glibc style is "long int", not plain "long" (likewise unsigned long 
> int, long long int, unsigned long long int).  Please check for this 
> throughout the patch series.
> 

Thanks.  I'll change those throughout the series.

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

* Re: [PATCH v3 13/19] RISC-V: RV32D, RV64F, and RV64D Support
  2018-01-01 17:08   ` Joseph Myers
@ 2018-01-04 18:50     ` Darius Rad
  0 siblings, 0 replies; 57+ messages in thread
From: Darius Rad @ 2018-01-04 18:50 UTC (permalink / raw)
  To: Joseph Myers, Palmer Dabbelt; +Cc: libc-alpha, patches

On 01/01/2018 12:08 PM, Joseph Myers wrote:
> On Tue, 26 Dec 2017, Palmer Dabbelt wrote:
> 
>> +long
>> +__lrint (double x)
>> +{
>> +  long res;
> 
> long int, as in the previous patch.
> 

Indeed, and I will fix.

>> +long
>> +__lround (double x)
>> +{
>> +  long res;
> 
> Likewise.
> 
>> +long long
>> +__llrintf (float x)
>> +{
>> +  long res;
>> +  asm ("fcvt.w.s %0, %1" : "=r" (res) : "f" (x));
>> +  return res;
> 
> Likewise (long long int), and I don't see how "long res;" here can be 
> correct at all, since this is in an rv32 file, and float can represent 
> integers outside the range of 32-bit long, which need to be correctly 
> converted to 64-bit long long for this function.  Maybe llrintf should 
> actually be rv64-only, since you need to convert to a 64-bit integer?
> 

You're correct, llrintf should be RV64 only.  I will remove it.

>> +long
>> +__lrintf (float x)
>> +{
>> +  long res;
> 
> Likewise.
> 
>> diff --git a/sysdeps/riscv/rv64/rvd/s_ceil.c b/sysdeps/riscv/rv64/rvd/s_ceil.c
> 
>> +      long i;
> 
> I would like to suggest, throughout the rv64 functions, where you are 
> using long (as here) for a 64-bit internal temporary (as opposed to long 
> int actually being part of the defined function API), you use int64_t 
> instead of changing long -> long int - after all, the instructions you are 
> using are defined to convert to/from 64-bit integers.  That way, the code 
> would work unchanged if you support RV64 ILP32 in future, whereas if you 
> use long int you need to change it again to support RV64 ILP32.
> 

Thanks.  I'll update to use int64_t/int32_t as appropriate for the assembly.

> (More generally, if what you want about an integer type is a particular 
> number of bits, using intN_t / uintN_t is encouraged.  That's definitely 
> the case when using asm instructions as here that are defined to use 
> integers with a given number of bits rather than linked to the C ABI.)
> 
>> +      long i;
> 
> Same in floor.
> 
>> +long long
>> +__llrint (double x)
>> +{
>> +  long long res;
> 
> Use long long int.
> 
>> +long long
>> +__llround (double x)
>> +{
>> +  long long res;
> 
> Use long long int.
> 
>> +long
>> +__lrint (double x)
>> +{
>> +  long res;
>> +  asm ("fcvt.l.d %0, %1" : "=r" (res) : "f" (x));
> 
> Use long int (but note a further change would be needed in future for RV64 
> ILP32 where you want a conversion to 32-bit not 64-bit integer in the 
> asm).
> 

Thanks, good to know for the future.

>> +long
>> +__lround (double x)
>> +{
>> +  long res;
>> +  asm ("fcvt.l.d %0, %1, rmm" : "=r" (res) : "f" (x));
> 
> Likewise.
> 
>> +      long i;
> 
> int64_t in nearbyint as elsewhere.
> 
>> +      long i;
> 
> Likewise in rint.
> 
>> +      long i;
> 
> Likewise in round.
> 
>> +      long i;
> 
> Likewise in roundeven.
> 
>> +      long i;
> 
> Likewise in trunc.
> 
>> +long long
>> +__llrintf (float x)
>> +{
>> +  long long res;
> 
> long long int.
> 
>> +#include <libm-alias-float.h>
>> +#include <libm-alias-float.h>
> 
> You don't want to include the same header twice in a row (this is in 
> llroundf).
> 

Yes, thanks.  I'll fix.

>> +long long
>> +__llroundf (float x)
>> +{
>> +  long long res;
> 
> long long int.
> 
>> +long
>> +__lrintf (float x)
>> +{
>> +  long res;
>> +  asm ("fcvt.l.s %0, %1" : "=r" (res) : "f" (x));
> 
> long int (again, would need to change for ILP32 support).
> 

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

* Re: [PATCH v3 14/19] RISC-V: Atomic and Locking Routines
  2018-01-01 17:12   ` Joseph Myers
@ 2018-01-04 18:52     ` Darius Rad
  0 siblings, 0 replies; 57+ messages in thread
From: Darius Rad @ 2018-01-04 18:52 UTC (permalink / raw)
  To: Joseph Myers, Palmer Dabbelt; +Cc: libc-alpha, patches

On 01/01/2018 12:11 PM, Joseph Myers wrote:
> On Tue, 26 Dec 2017, Palmer Dabbelt wrote:
> 
>> diff --git a/sysdeps/unix/sysv/linux/riscv/atomic-machine.h b/sysdeps/unix/sysv/linux/riscv/atomic-machine.h
> 
>> +#include <inttypes.h>
> 
> Do you really need inttypes.h here, or just stdint.h?
> 

This doesn't need inttypes.h, stdint.h should be sufficient.  I'll fix it.

>> +#define atomic_full_barrier() __sync_synchronize()
> 
> Missing space before '(' in call to __sync_synchronize.
> 

Thank, I'll fix this and the other formatting issues noted.

>> +# define asm_amo(which, ordering, mem, value) ({ 		\
>> +  __atomic_check_size(mem);					\
>> +  typeof(*mem) __tmp; 						\
>> +  if (sizeof(__tmp) == 4)					\
>> +    asm volatile (which ".w" ordering "\t%0, %z2, %1"		\
>> +		  : "=r"(__tmp), "+A"(*(mem))			\
>> +		  : "rJ"(value));				\
>> +  else if (sizeof(__tmp) == 8)					\
>> +    asm volatile (which ".d" ordering "\t%0, %z2, %1"		\
>> +		  : "=r"(__tmp), "+A"(*(mem))			\
>> +		  : "rJ"(value));				\
>> +  else								\
>> +    abort();							\
>> +  __tmp; })
> 
> Lots of missing spaces before '(' there, after __atomic_check_size, 
> typeof, sizeof, abort, strings in asms.
> 
>> +# define atomic_max(mem, value) asm_amo("amomaxu", ".aq", mem, value)
>> +# define atomic_min(mem, value) asm_amo("amominu", ".aq", mem, value)
> 
> Missing spaces in calls to asm_amo.
> 
>> +# define atomic_bit_test_set(mem, bit)                   \
>> +  ({ typeof(*mem) __mask = (typeof(*mem))1 << (bit);    \
>> +     asm_amo("amoor", ".aq", mem, __mask) & __mask; })
>> +
>> +# define catomic_exchange_and_add(mem, value)		\
>> +  atomic_exchange_and_add(mem, value)
>> +# define catomic_max(mem, value) atomic_max(mem, value)
> 
> More missing spaces in calls to typeof, asm_amo, atomic_exchange_and_add, 
> atomic_max.
> 

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

* Re: RISC-V glibc Port v3
  2018-01-04 14:16   ` Christoph Hellwig
  2018-01-04 15:12     ` Florian Weimer
@ 2018-01-04 19:49     ` Palmer Dabbelt
  1 sibling, 0 replies; 57+ messages in thread
From: Palmer Dabbelt @ 2018-01-04 19:49 UTC (permalink / raw)
  To: hch; +Cc: fweimer, libc-alpha, patches

On Thu, 04 Jan 2018 06:16:51 PST (-0800), hch@lst.de wrote:
> On Tue, Jan 02, 2018 at 02:01:45PM +0100, Florian Weimer wrote:
>> Is there some documentation of the assembler syntax?
>>
>> The assembler code uses some instructions which appear to have ABI-specific
>> defaults, and I can't find documentation for them, neither in the ISA
>> manual nor in the psABI supplement.
>
> Chapter 20 of the RISC-V ISA spec contains an assembly writers
> handbook that documents the ABI register aliases and pseudo-instructions
> if that is what you are looking for.

We're also writing an assembly programmer's manual, but it's more than a little 
bit lacking: https://github.com/riscv/riscv-asm-manual/blob/master/riscv-asm.md

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

* Re: [PATCH v3 07/19] RISC-V: Build Infastructure
  2018-01-01 13:09   ` Joseph Myers
@ 2018-01-05  3:25     ` Darius Rad
  2018-01-05 13:45       ` Joseph Myers
  0 siblings, 1 reply; 57+ messages in thread
From: Darius Rad @ 2018-01-05  3:25 UTC (permalink / raw)
  To: Joseph Myers, Palmer Dabbelt; +Cc: libc-alpha, patches

On 01/01/2018 08:09 AM, Joseph Myers wrote:
> On Tue, 26 Dec 2017, Palmer Dabbelt wrote:
> 
>> diff --git a/sysdeps/riscv/Versions b/sysdeps/riscv/Versions
>> new file mode 100644
>> index 000000000000..aafa348a2395
>> --- /dev/null
>> +++ b/sysdeps/riscv/Versions
>> @@ -0,0 +1,4 @@
>> +libc {
>> +  GLIBC_2.27 {
>> +  }
>> +}
> 
> I still don't see why this file should be needed.  You need more 
> explanation than "IIRC some test was depending on this." for such an empty 
> GLIBC_2.27 version here (and the explanation ought to go in a comment in 
> the file to justify why the file exists).
> 

It doesn't appear to be necessary (I just tried without it), so I'll
remove it.  Thanks.

>> diff --git a/sysdeps/riscv/preconfigure b/sysdeps/riscv/preconfigure
>> +    case "$float_abi" in
>> +    soft)
>> +    	abi_flen=0
>> +    	;;
>> +    single)
>> +    	abi_flen=32
>> +    	;;
> 
> I'd expect the "single" case to be removed or made into an error, given 
> the decision not to support the "f" ABIs.
> 

Indeed.  I'll remove references to the single precision ABIs here and
elsewhere.

>> +abi-ilp32-condition   := (__SIZEOF_INT__ == 4)
>> +abi-ilp32-condition   += && (__SIZEOF_LONG__ == 4)
>> +abi-ilp32-condition   += && (__SIZEOF_POINTER__ == 4)
>> +abi-ilp32-condition   += && (defined __riscv_float_abi_soft)
>> +abi-ilp32-condition   += && (!defined __riscv_float_abi_single)
>> +abi-ilp32-condition   += && (!defined __riscv_float_abi_double)
> 
> You don't need such long and redundant conditions.  I'd expect something 
> simpler like on other architectures (e.g. !defined __LP64__ && defined 
> __riscv_float_abi_soft in this case - in general, just checking one macro 
> for the ILP32/LP64 distinction, one for the floating-point ABI).
> 

I'll remove the extraneous checks for the floating point ABI.  However,
I think the other checks are necessary, as __LP64__/__ILP32__ are not
defined by gcc when -mabi is used.  That might be a gcc bug, but that
seems to be how it is now.  Alternatively, I could replace the check
with __riscv_xlen == 32 and == 64, but that doesn't seem like a good
approach, as it would break, if, for example, RISC-V ever supported
ILP32 on RV64.

>> diff --git a/sysdeps/unix/sysv/linux/riscv/configure.ac b/sysdeps/unix/sysv/linux/riscv/configure.ac
> 
>> +AC_EGREP_CPP(yes, [#ifdef __riscv_float_abi_single
>> +		   yes
>> +		   #endif
>> +  ],libc_cv_riscv_float_abi=f)
> 
> I'd expect this "f" ABI support to go away.
> 
>> diff --git a/sysdeps/unix/sysv/linux/riscv/shlib-versions b/sysdeps/unix/sysv/linux/riscv/shlib-versions
> 
>> +%elif RISCV_ABI_XLEN == 64 && RISCV_ABI_FLEN == 32
>> +ld=ld-linux-riscv64-lp64f.so.1
> 
>> +%elif RISCV_ABI_XLEN == 32 && RISCV_ABI_FLEN == 32
>> +ld=ld-linux-riscv32-ilp32f.so.1
> 
> Again, I'd expect the "f" ABI support to go away.
> 

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

* Re: [PATCH v3 07/19] RISC-V: Build Infastructure
  2018-01-05  3:25     ` Darius Rad
@ 2018-01-05 13:45       ` Joseph Myers
  2018-01-05 15:45         ` [patches] " Darius Rad
  0 siblings, 1 reply; 57+ messages in thread
From: Joseph Myers @ 2018-01-05 13:45 UTC (permalink / raw)
  To: Darius Rad; +Cc: Palmer Dabbelt, libc-alpha, patches

On Thu, 4 Jan 2018, Darius Rad wrote:

> > You don't need such long and redundant conditions.  I'd expect something 
> > simpler like on other architectures (e.g. !defined __LP64__ && defined 
> > __riscv_float_abi_soft in this case - in general, just checking one macro 
> > for the ILP32/LP64 distinction, one for the floating-point ABI).
> > 
> 
> I'll remove the extraneous checks for the floating point ABI.  However,
> I think the other checks are necessary, as __LP64__/__ILP32__ are not
> defined by gcc when -mabi is used.  That might be a gcc bug, but that

__LP64__ is defined in architecture-independent code (cppbuiltin.c), so 
should be fully suitable for this.  (__ILP32__ is indeed an 
architecture-specific macro on only some architectures.)

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 03/19] Add linux-4.15 VDSO hash for RISC-V
  2018-01-01 12:58   ` Joseph Myers
@ 2018-01-05 13:50     ` Joseph Myers
  0 siblings, 0 replies; 57+ messages in thread
From: Joseph Myers @ 2018-01-05 13:50 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: libc-alpha, patches

Reminder: there are some approved patches that still need to be committed.  
That is, committed during the slush, not afterwards, if you still want 
this port in 2.27, so there's time to discover any unexpected effects on 
other architectures from those changes to architecture-independent files.

Of course, where there were comments from other people on those patches 
you first need to respond to those comments and possibly adapt the patches 
until there's a version on which consensus is reached.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH v3 15/19] RISC-V: Linux Syscall Interface
  2017-12-27  6:06 ` [PATCH v3 15/19] RISC-V: Linux Syscall Interface Palmer Dabbelt
  2018-01-01 17:18   ` Joseph Myers
@ 2018-01-05 14:04   ` Adhemerval Zanella
  1 sibling, 0 replies; 57+ messages in thread
From: Adhemerval Zanella @ 2018-01-05 14:04 UTC (permalink / raw)
  To: libc-alpha



On 27/12/2017 04:05, Palmer Dabbelt wrote:
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/riscv/arch-fork.h
> @@ -0,0 +1,27 @@
> +/* Internal definitions for thread-friendly fork implementation.  Linux/i386.
> +   Copyright (C) 2002-2017 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
> +
> +   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 <sched.h>
> +#include <sysdep.h>
> +#include <tls.h>
> +
> +#define ARCH_FORK() \
> +  INLINE_SYSCALL (clone, 5,						      \
> +		  CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0,     \
> +		  NULL, NULL, &THREAD_SELF->tid)

Why did you choose CONFIG_CLONE_BACKWARDS for riscv? My understanding
reading kernel/fork.c is default for newer ports should be the one 
without any BACKWARDS* define, x86_64 for instance (and arch/Kconfig:824 
seems to put CLONE_BACKWARDS on the 'ABI hall of shame' as well).

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

* Re: [patches] Re: [PATCH v3 07/19] RISC-V: Build Infastructure
  2018-01-05 13:45       ` Joseph Myers
@ 2018-01-05 15:45         ` Darius Rad
  0 siblings, 0 replies; 57+ messages in thread
From: Darius Rad @ 2018-01-05 15:45 UTC (permalink / raw)
  To: patches, Joseph Myers; +Cc: Palmer Dabbelt, libc-alpha

On 01/05/2018 08:44 AM, Joseph Myers wrote:
> On Thu, 4 Jan 2018, Darius Rad wrote:
> 
>>> You don't need such long and redundant conditions.  I'd expect something 
>>> simpler like on other architectures (e.g. !defined __LP64__ && defined 
>>> __riscv_float_abi_soft in this case - in general, just checking one macro 
>>> for the ILP32/LP64 distinction, one for the floating-point ABI).
>>>
>>
>> I'll remove the extraneous checks for the floating point ABI.  However,
>> I think the other checks are necessary, as __LP64__/__ILP32__ are not
>> defined by gcc when -mabi is used.  That might be a gcc bug, but that
> 
> __LP64__ is defined in architecture-independent code (cppbuiltin.c), so 
> should be fully suitable for this.  (__ILP32__ is indeed an 
> architecture-specific macro on only some architectures.)
> 

Indeed, my mistake.  __ILP32__ is not present, but __LP64__ is defined
when appropriate.  So I'll use __LP64__ and !__LP64__, which are
sufficient to differentiate the currently supported ABIs (along with
soft/double float).

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

* Re: [PATCH v3 01/19] Avoid race conditions when rebuilding librt.so
  2018-01-01  9:26   ` Andreas Schwab
@ 2018-01-06  5:50     ` Palmer Dabbelt
       [not found]       ` <CAKCAbMiGjFkmMrY4M7te2jvCO+02zRWqZ6AKM13rYwGrWGJ-wA@mail.gmail.com>
  0 siblings, 1 reply; 57+ messages in thread
From: Palmer Dabbelt @ 2018-01-06  5:50 UTC (permalink / raw)
  To: schwab; +Cc: libc-alpha, patches

On Mon, 01 Jan 2018 01:26:34 PST (-0800), schwab@linux-m68k.org wrote:
> Who is racing with whom?  There should not be any parallelism involved
> here.

I guess "race condition" isn't quite the right term: the non-determinism comes 
from the ordering by which make decides to re-build targets during a "make 
check" that occurs after a GCC "make install".  I ended up running into a 
handful of other problems along these lines, so instead it seems like the sane 
thing to do is to just "make && make check" in glibc instead.

I'll drop this patch.

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

* Fwd: [PATCH v3 01/19] Avoid race conditions when rebuilding librt.so
       [not found]       ` <CAKCAbMiGjFkmMrY4M7te2jvCO+02zRWqZ6AKM13rYwGrWGJ-wA@mail.gmail.com>
@ 2018-01-06 14:51         ` Zack Weinberg
       [not found]         ` <mhng-82291af3-360e-4cd1-a211-5bfd55d1b11f@palmer-si-x1c4>
  1 sibling, 0 replies; 57+ messages in thread
From: Zack Weinberg @ 2018-01-06 14:51 UTC (permalink / raw)
  To: GNU C Library

On Sat, Jan 6, 2018 at 12:50 AM, Palmer Dabbelt <palmer@dabbelt.com> wrote:
> On Mon, 01 Jan 2018 01:26:34 PST (-0800), schwab@linux-m68k.org wrote:
>>
>> Who is racing with whom?  There should not be any parallelism involved
>> here.
>
>
> I guess "race condition" isn't quite the right term: the non-determinism
> comes from the ordering by which make decides to re-build targets during a
> "make check" that occurs after a GCC "make install".  I ended up running
> into a handful of other problems along these lines, so instead it seems like
> the sane thing to do is to just "make && make check" in glibc instead.
>
> I'll drop this patch.

I think you should install this patch.  Abstractly, "make check" is
supposed to work without further ceremony, regardless of whether "make
install" has just been run, and this particular missing dependency has
bitten me more than once myself.

zw

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

* Re: [PATCH v3 01/19] Avoid race conditions when rebuilding librt.so
       [not found]         ` <mhng-82291af3-360e-4cd1-a211-5bfd55d1b11f@palmer-si-x1c4>
@ 2018-01-07 16:01           ` Zack Weinberg
  2018-01-08 22:35             ` Palmer Dabbelt
  0 siblings, 1 reply; 57+ messages in thread
From: Zack Weinberg @ 2018-01-07 16:01 UTC (permalink / raw)
  To: Palmer Dabbelt, GNU C Library

On Sun, Jan 7, 2018 at 2:43 AM, Palmer Dabbelt <palmer@dabbelt.com> wrote:
> On Sat, 06 Jan 2018 06:51:20 PST (-0800), zackw@panix.com wrote:
>> I think you should install this patch.  Abstractly, "make check" is
>> supposed to work without further ceremony, regardless of whether "make
>> install" has just been run, and this particular missing dependency has
>> bitten me more than once myself.
>
> OK, I just committed it.  I've run into a few more of these, but I can't
> promise that I'll have time to fix them all as we're trying to make sure the
> RISC-V port is in good enough shape to land in 2.27.

Right, I didn't mean to imply that I wanted you to fix any more of
these.  However, if you do happen to find more and the fixes are as
simple as this one - adding a missing dependency that would have been
present if there were one makefile for the entire source tree - the
patches are pre-approved.  In fact, I think they would qualify as
"obvious bugfixes" not requiring review in the first place.

zw

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

* Re: [PATCH v3 01/19] Avoid race conditions when rebuilding librt.so
  2018-01-07 16:01           ` Zack Weinberg
@ 2018-01-08 22:35             ` Palmer Dabbelt
  0 siblings, 0 replies; 57+ messages in thread
From: Palmer Dabbelt @ 2018-01-08 22:35 UTC (permalink / raw)
  To: zackw; +Cc: libc-alpha

On Sun, 07 Jan 2018 08:01:03 PST (-0800), zackw@panix.com wrote:
> On Sun, Jan 7, 2018 at 2:43 AM, Palmer Dabbelt <palmer@dabbelt.com> wrote:
>> On Sat, 06 Jan 2018 06:51:20 PST (-0800), zackw@panix.com wrote:
>>> I think you should install this patch.  Abstractly, "make check" is
>>> supposed to work without further ceremony, regardless of whether "make
>>> install" has just been run, and this particular missing dependency has
>>> bitten me more than once myself.
>>
>> OK, I just committed it.  I've run into a few more of these, but I can't
>> promise that I'll have time to fix them all as we're trying to make sure the
>> RISC-V port is in good enough shape to land in 2.27.
>
> Right, I didn't mean to imply that I wanted you to fix any more of
> these.  However, if you do happen to find more and the fixes are as
> simple as this one - adding a missing dependency that would have been
> present if there were one makefile for the entire source tree - the
> patches are pre-approved.  In fact, I think they would qualify as
> "obvious bugfixes" not requiring review in the first place.

OK, sounds good!

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

end of thread, other threads:[~2018-01-08 22:35 UTC | newest]

Thread overview: 57+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-27  6:05 RISC-V glibc Port v3 Palmer Dabbelt
2017-12-27  6:05 ` [PATCH v3 02/19] Allow make-link-multidir to make subdirectories Palmer Dabbelt
2018-01-01  1:59   ` Joseph Myers
2018-01-01  9:35   ` Andreas Schwab
2017-12-27  6:06 ` [PATCH v3 19/19] Add RISC-V to build-many-glibcs.py Palmer Dabbelt
2018-01-01  1:55   ` Joseph Myers
2017-12-27  6:06 ` [PATCH v3 15/19] RISC-V: Linux Syscall Interface Palmer Dabbelt
2018-01-01 17:18   ` Joseph Myers
2018-01-05 14:04   ` Adhemerval Zanella
2017-12-27  6:06 ` [PATCH v3 12/19] RISC-V: RV32F Support Palmer Dabbelt
2018-01-01 16:51   ` Joseph Myers
2018-01-04 18:41     ` Darius Rad
2017-12-27  6:06 ` [PATCH v3 01/19] Avoid race conditions when rebuilding librt.so Palmer Dabbelt
2018-01-01  1:58   ` Joseph Myers
2018-01-01  9:26   ` Andreas Schwab
2018-01-06  5:50     ` Palmer Dabbelt
     [not found]       ` <CAKCAbMiGjFkmMrY4M7te2jvCO+02zRWqZ6AKM13rYwGrWGJ-wA@mail.gmail.com>
2018-01-06 14:51         ` Fwd: " Zack Weinberg
     [not found]         ` <mhng-82291af3-360e-4cd1-a211-5bfd55d1b11f@palmer-si-x1c4>
2018-01-07 16:01           ` Zack Weinberg
2018-01-08 22:35             ` Palmer Dabbelt
2017-12-27  6:06 ` [PATCH v3 11/19] RISC-V: Generic <math.h> and soft-fp Routines Palmer Dabbelt
2018-01-01 15:02   ` Joseph Myers
2018-01-04 18:36     ` Darius Rad
2017-12-27  6:06 ` [PATCH v3 03/19] Add linux-4.15 VDSO hash for RISC-V Palmer Dabbelt
2018-01-01 12:58   ` Joseph Myers
2018-01-05 13:50     ` Joseph Myers
2017-12-27  6:06 ` [PATCH v3 17/19] RISC-V: Linux Startup and Dynamic Loading Code Palmer Dabbelt
2018-01-01 17:35   ` Joseph Myers
2017-12-27  6:06 ` [PATCH v3 08/19] RISC-V: ABI Implementation Palmer Dabbelt
2018-01-01 13:29   ` Joseph Myers
2017-12-27  6:06 ` [PATCH v3 09/19] RISC-V: Startup and Dynamic Loading Code Palmer Dabbelt
2018-01-01 14:56   ` Joseph Myers
2018-01-04 18:34     ` Darius Rad
2017-12-27  6:06 ` [PATCH v3 13/19] RISC-V: RV32D, RV64F, and RV64D Support Palmer Dabbelt
2018-01-01 17:08   ` Joseph Myers
2018-01-04 18:50     ` Darius Rad
2017-12-27  6:06 ` [PATCH v3 16/19] RISC-V: Linux ABI Palmer Dabbelt
2018-01-01 17:35   ` Joseph Myers
2017-12-27  6:06 ` [PATCH v3 05/19] Add RISC-V dynamic relocations to elf.h Palmer Dabbelt
2018-01-01  2:00   ` Joseph Myers
2017-12-27  6:06 ` [PATCH v3 07/19] RISC-V: Build Infastructure Palmer Dabbelt
2018-01-01 13:09   ` Joseph Myers
2018-01-05  3:25     ` Darius Rad
2018-01-05 13:45       ` Joseph Myers
2018-01-05 15:45         ` [patches] " Darius Rad
2017-12-27  6:06 ` [PATCH v3 06/19] Add RISC-V entries to config.h.in Palmer Dabbelt
2017-12-27  6:06 ` [PATCH v3 10/19] RISC-V: Thread-Local Storage Support Palmer Dabbelt
2017-12-27  6:06 ` [PATCH v3 04/19] Skeleton documentation for the RISC-V port Palmer Dabbelt
2017-12-27  6:06 ` [PATCH v3 14/19] RISC-V: Atomic and Locking Routines Palmer Dabbelt
2018-01-01 17:12   ` Joseph Myers
2018-01-04 18:52     ` Darius Rad
2017-12-27  6:06 ` [PATCH v3 18/19] RISC-V: Add ABI Lists Palmer Dabbelt
2018-01-01 17:37   ` Joseph Myers
2018-01-01  1:48 ` RISC-V glibc Port v3 Joseph Myers
2018-01-02 13:01 ` Florian Weimer
2018-01-04 14:16   ` Christoph Hellwig
2018-01-04 15:12     ` Florian Weimer
2018-01-04 19:49     ` Palmer Dabbelt

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