This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC v1 00/16] RISC-V glibc port for the 32-bit
- From: Alistair Francis <alistair dot francis at wdc dot com>
- To: libc-alpha at sourceware dot org
- Cc: alistair dot francis at wdc dot com, alistair23 at gmail dot com
- Date: Fri, 21 Jun 2019 21:37:12 -0700
- Subject: [RFC v1 00/16] RISC-V glibc port for the 32-bit
- Ironport-sdr: xvAYdCmNDS5iciorbvbl6p33J3C5ESK+454eJo0Ypr4avPQb5YZM03tkl+PhLsy9JDICzMJM+4 tOnCH/+Nacpw3SVNPvp7NwVXdyj6EMrT5+pdGDsQERAXwJZ7sLOU0B+jSpacr2KPMtk0W1oRn+ bb8+D0MzEDkTxO2S4HdgofaKOznRfdCrflPLdo2bDNrhVTRedmheKex2zac3G2UUA1V29shfbJ hNilth4tR6jaKeFTtUU4lD5c2dew/qVN7VYVqbfin3IWfc0pYvbUa4NwI/bucmvrBJvspZflwt 3gSb3hGH9AQTSxA/t276mviU
- Ironport-sdr: qvQ11wLe551NmMDg5rmnppvNAvvB3ptaX4xJdNak+majsSXrTh+agIpctehmXP87fFlLeCHOp+ JVmrIF6MsiGvrvOOCiUdpvDkX2UeywnAnw9STcLS1GEYO5qMDzCE7MJTpjQDTcWvqZwvYFWDSH drXLcIOYbwl0yd4i28Jcn81JgRtwTnP0LG6WO3V+tX9RIflxc3MWgcO9tzzMiezkPEKKZmSr3z EfoXGm0ceqfkQaIDNBg/iOT04/ZNUKsl/IGevf/KPlC39gW4CqlfJtIySyTMdqH/8O6oPp/Tyb AzU=
This patch set contains the glibc port for the 32-bit RISC-V.
This is based on all of the work that Zong Li has done [1].
I have taken the latest branch from Zong Li and rebased it onto master.
I added a single GCC8.2 fix into one of his patches, otherwise the
patches are the same as his but rebased on master.
Unfortunately the Linux ABI has changed since Zong Li's latest
submission. The RISC-V 32-bit (RV32) ABI no longer defines
__ARCH_WANT_TIME32_SYSCALLS which means there are no 32-bit versions of
time_t, off_t or any struct resource or system calls that use them.
To mitigate this I have set the RV32 port to use 64-bit time_t and off_t
(as is done in x86-32) and also changed the syscall imvocation to handle
the missing syscalls. Patches 1 to 5 are generic ways of handling the
missing syscall functions. Patch 7 changes all RISC-V implementations to
use 64-bit time_t and off_t.
I have tested this series by building a buildroot kernel and rootFS
using these glibc patches and an upstream 5.1.12 kernel for RV32.
Patch 4 (waitid) seems to cause hangs that I haven't debugged yet, it
seems like we aren't handing the wait() functions correctly.
The last patch is a hack to forcefully rename the remaining system calls
that are causing compiller failures to the 64-bit versions. This is
obviously not the correct way to do this. I would like some feedback on
this series to find the upstream approved way to use the 64-bit
versions.
Feedback on this series is very welcome!
1: https://sourceware.org/ml/libc-alpha/2018-07/msg00892.html
Alistair Francis (6):
sysdeps/nanosleep: Use clock_nanosleep_time64 instead of nanosleep
sysdeps/futex: Use __NR_futex_time64 if we don't have __NR_futex
sysdeps/gettimeofday: Use clock_gettime64 syscall for gettimeofday
sysdeps/wait: Use __NR_waitid if avaliable
sysdeps/getrlimit: Use __NR_prlimit64 if avaliable
RISC-V: Use 64-bit time_t and off_t for RV32 and RV64
Zong Li (10):
Documentation for the RISC-V 32-bit port
RISC-V: Support dynamic loader for the 32-bit
RISC-V: Add path of library directories for the 32-bit
RISC-V: The ABI implementation for the 32-bit
RISC-V: Hard float support for the 32 bit
RISC-V: Regenerate ULPs of RISC-V
RISC-V: Add ABI lists
RISC-V: Build Infastructure for the 32-bit
RISC-V: Fix llrint and llround missing exceptions on RV32
Add RISC-V 32-bit target to build-many-glibcs.py
ChangeLog | 116 +
NEWS | 6 +
README | 1 +
nptl/thrd_sleep.c | 3 +-
scripts/build-many-glibcs.py | 15 +
sysdeps/riscv/bits/wordsize.h | 4 +-
sysdeps/riscv/nofpu/libm-test-ulps | 16 +-
sysdeps/riscv/nptl/bits/pthreadtypes-arch.h | 25 +-
sysdeps/riscv/preconfigure | 6 +-
sysdeps/riscv/rv32/Implies-after | 1 +
.../riscv/rv32/fix-fp-int-convert-overflow.h | 38 +
sysdeps/riscv/rv32/rvd/Implies | 3 +
sysdeps/riscv/rv32/rvd/s_lrint.c | 31 +
sysdeps/riscv/rv32/rvd/s_lround.c | 31 +
sysdeps/riscv/rv32/rvf/Implies | 1 +
sysdeps/riscv/rv32/rvf/s_lrintf.c | 31 +
sysdeps/riscv/rv32/rvf/s_lroundf.c | 31 +
sysdeps/riscv/{rv64 => }/rvd/libm-test-ulps | 56 +-
.../riscv/{rv64 => }/rvd/libm-test-ulps-name | 0
sysdeps/riscv/sfp-machine.h | 27 +-
sysdeps/riscv/sys/asm.h | 5 +-
sysdeps/unix/sysv/linux/getrlimit.c | 4 +
sysdeps/unix/sysv/linux/gettimeofday.c | 14 +
sysdeps/unix/sysv/linux/lowlevellock-futex.h | 28 +-
sysdeps/unix/sysv/linux/nanosleep.c | 3 +-
sysdeps/unix/sysv/linux/nanosleep_nocancel.c | 3 +-
sysdeps/unix/sysv/linux/riscv/Makefile | 4 +-
.../unix/sysv/linux/riscv/bits/environments.h | 85 +
sysdeps/unix/sysv/linux/riscv/bits/time64.h | 36 +
sysdeps/unix/sysv/linux/riscv/bits/timesize.h | 22 +
.../unix/sysv/linux/riscv/bits/typesizes.h | 87 +
sysdeps/unix/sysv/linux/riscv/configure | 39 +
sysdeps/unix/sysv/linux/riscv/configure.ac | 8 +
sysdeps/unix/sysv/linux/riscv/dl-cache.h | 17 +-
sysdeps/unix/sysv/linux/riscv/ldconfig.h | 2 +-
sysdeps/unix/sysv/linux/riscv/rv32/Implies | 3 +
.../unix/sysv/linux/riscv/rv32/c++-types.data | 67 +
.../sysv/linux/riscv/rv32/jmp_buf-macros.h | 53 +
sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist | 9 +
.../linux/riscv/rv32/libBrokenLocale.abilist | 1 +
.../unix/sysv/linux/riscv/rv32/libanl.abilist | 4 +
.../unix/sysv/linux/riscv/rv32/libc.abilist | 2101 +++++++++++++++++
.../sysv/linux/riscv/rv32/libcrypt.abilist | 2 +
.../unix/sysv/linux/riscv/rv32/libdl.abilist | 9 +
.../unix/sysv/linux/riscv/rv32/libm.abilist | 1021 ++++++++
.../sysv/linux/riscv/rv32/libpthread.abilist | 235 ++
.../sysv/linux/riscv/rv32/libresolv.abilist | 79 +
.../unix/sysv/linux/riscv/rv32/librt.abilist | 35 +
.../linux/riscv/rv32/libthread_db.abilist | 40 +
.../sysv/linux/riscv/rv32/libutil.abilist | 6 +
sysdeps/unix/sysv/linux/riscv/rv32/lockf64.c | 70 +
sysdeps/unix/sysv/linux/riscv/shlib-versions | 10 +-
sysdeps/unix/sysv/linux/wait.c | 19 +-
sysdeps/unix/sysv/linux/waitpid.c | 33 +
sysdeps/unix/sysv/linux/waitpid_nocancel.c | 32 +
55 files changed, 4565 insertions(+), 63 deletions(-)
create mode 100644 sysdeps/riscv/rv32/Implies-after
create mode 100644 sysdeps/riscv/rv32/fix-fp-int-convert-overflow.h
create mode 100644 sysdeps/riscv/rv32/rvd/Implies
create mode 100644 sysdeps/riscv/rv32/rvd/s_lrint.c
create mode 100644 sysdeps/riscv/rv32/rvd/s_lround.c
create mode 100644 sysdeps/riscv/rv32/rvf/Implies
create mode 100644 sysdeps/riscv/rv32/rvf/s_lrintf.c
create mode 100644 sysdeps/riscv/rv32/rvf/s_lroundf.c
rename sysdeps/riscv/{rv64 => }/rvd/libm-test-ulps (98%)
rename sysdeps/riscv/{rv64 => }/rvd/libm-test-ulps-name (100%)
create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/environments.h
create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/time64.h
create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/timesize.h
create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/typesizes.h
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/Implies
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/c++-types.data
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libBrokenLocale.abilist
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libanl.abilist
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libcrypt.abilist
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libdl.abilist
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libm.abilist
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libresolv.abilist
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/librt.abilist
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libthread_db.abilist
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist
create mode 100644 sysdeps/unix/sysv/linux/riscv/rv32/lockf64.c
--
2.22.0