This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
RISC-V glibc port, v5
- From: Palmer Dabbelt <palmer at dabbelt dot com>
- To: libc-alpha at sourceware dot org, joseph at codesourcery dot com
- Cc: Andrew Waterman <andrew at sifive dot com>, Darius Rad <darius at bluespec dot com>, dj at redhat dot com, patches at groups dot riscv dot org
- Date: Wed, 24 Jan 2018 20:36:04 -0800
- Subject: RISC-V glibc port, v5
- Authentication-results: sourceware.org; auth=none
This v5 patch set contains what we hope is a viable RISC-V port for inclusion
into glibc-2.27. For sanity's sake, we'd like to only mark the rv64gc/lp64d
and rv64gc/lp64 ports as stable right now and leave the remaining ports a work
in progress -- the rv32 ports are blocked on Linux being a bit flaky, and the
rv64imac/lp64 port just flat out takes too long to run in simulation (or on an
FPGA, which is even slower). The rv64gc/lp64d port is the primary target of
interest: it will be the first target that distributions port to, and the chip
that SiFive announced will be rv64gc (so the natural ABI is lp64d).
I believe we've taken into account all the feedback, and are now below 20 test
suite failures on both of the ISA/ABI pairs we want to support assuming you get
the environment exactly correct. This means:
* A system that's fast enough to avoid a handful of timeouts.
* A handful of QEMU patches. Our QEMU port is also in the middle of being
submitted for upstream, but these patches will all be included as part of the
next submission.
* Some additional WIP GCC patches.
* The latest Linux kernel headers.
Here's our final list of failures for rv64gc/lp64d
FAIL: elf/tst-tls12
GCC patch in progress
FAIL: io/ftwtest
XFAIL on cross compile (path)
FAIL: localedata/mtrace-tst-leaks
FAIL: localedata/tst-leaks
timeout (passes on a re-run)
FAIL: malloc/tst-dynarray-fail
timeout (passes on a re-run)
FAIL: malloc/tst-malloc-tcache-leak
timeout (passes on a re-run)
FAIL: malloc/tst-malloc-usable-tunables
FAIL: malloc/tst-malloc_info
timeout
FAIL: misc/tst-tsearch
timeout (passes on a re-run)
FAIL: nptl/test-cond-printers
XFAIL on cross compile (python)
FAIL: nptl/test-condattr-printers
XFAIL on cross compile (python)
FAIL: nptl/test-mutex-printers
XFAIL on cross compile (python)
FAIL: nptl/test-mutexattr-printers
XFAIL on cross compile (python)
FAIL: nptl/test-rwlock-printers
XFAIL on cross compile (python)
FAIL: nptl/test-rwlockattr-printers
XFAIL on cross compile (python)
FAIL: nptl/tst-execstack
FAIL: nptl/tst-robust-fork
timeout
FAIL: nptl/tst-stack4
timeout
FAIL: nptl/tst-tls3-malloc
timeout
FAIL: nptl/tst-umask1
FAIL: nss/bug17079
timeout (passes on a re-run)
FAIL: resolv/mtrace-tst-resolv-res_ninit
FAIL: resolv/tst-resolv-basic
warning: could not become root outside namespace
FAIL: resolv/tst-resolv-res_ninit
timeout (passes on a re-run)
FAIL: resolv/tst-resolv-search
warning: could not become root outside namespace
FAIL: resolv/tst-resolv-threads
FAIL: rt/tst-mqueue2
FAIL: rt/tst-mqueue7
FAIL: stdio-common/bug22
XFAIL on limited memory
FAIL: support/tst-xreadlink
FAIL: sysvipc/test-sysvmsg
FAIL: sysvipc/test-sysvsem
FAIL: sysvipc/test-sysvshm
FAIL: timezone/tst-tzset
timeout (IIRC an XFAIL on disk space)
Which leaves a total of 15 archicture-specific failures. The test suite
results for rv64gc/lp64 are slightly better than this, Darius can provide links
to full results on his website like usual.
FAIL: localedata/mtrace-tst-leaks
FAIL: malloc/tst-malloc-usable-tunables
FAIL: nptl/tst-execstack
FAIL: nptl/tst-robust-fork
timeout
FAIL: nptl/tst-stack4
timeout
FAIL: nptl/tst-tls3-malloc
timeout
FAIL: nptl/tst-umask1
FAIL: resolv/mtrace-tst-resolv-res_ninit
FAIL: resolv/tst-resolv-threads
FAIL: rt/tst-mqueue2
FAIL: rt/tst-mqueue7
FAIL: support/tst-xreadlink
FAIL: sysvipc/test-sysvmsg
FAIL: sysvipc/test-sysvsem
FAIL: sysvipc/test-sysvshm
We'll work through automating this process a bit and getting results on the
wiki if the port as it stands is to everyone's satisfaciton. I'm sorry we're
very late in the release cycle, and while I can understand if we're not up to
stuff for this release I'd really like to get in if possible -- we have a bunch
of distributions (Fedora, Debian, OpenEmbedded, and OpenWRT) who are eagerly
waiting us to put a stake in the ground on ABI stability so they can get
started porting for real. I think we're at the point where we're not going to
work out any large issues in the port without distributions starting to come
up.
Thanks to everyone who has helped, specifically:
* Joseph Myers: for pointing out all the brain-dead stuff we've done.
* Jim Wilson: for pitching in at the last minute to help fix a few bugs.
* Darius Rad: for getting together an environment that can actually run the
test suite, fixing a bunch of test suite failures, and then testing it many
nights while I slept :).
* DJ, Andrew, and Darius: for co-maintaining the port.
A short log of the changes since our v5 includes
* A proper implementation of lroundf on rv64.
* Moving back to a nofpu directory, which got eaten by a previous patch set.
* Support for dl-cache.
* Many comment and whitespace fixes.
* Better documentation of __riscv_flush_icache, along with some namespace
cleanups.
* We now call the exit system call instead of _exit after a thread terminates.
* Correct handling of S1 and S2 in ucontext-related code.
* Correct SP handling when arguments are on the stack in ucontext-related code.
* Correctly saving sigmask on setcontext.
* We now test for floating-point exceptions.
[v4] A highlight of the changes since our v3 includes:
* Some ABI list cleanups, to match a few changes between when we last rebased
and now.
* ucontext.h namespace fixes.
* Copyright year has been updated to 2018, and "contributed by" lines have been
removed.
* int in specified in all places were optional.
* The floating-point support no longer uses ABI types, but uses explicit bit
widths.
* Some floating point test macros have been defined to inform the test suite
how our ISA operates.
* We now examine the ELF flags.
* I've added ChangeLog entries for all the commits except those that just add
new files.
[v3] 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.
[v2] 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 01/17] Skeleton documentation for the RISC-V port
[PATCH 02/17] Add RISC-V entries to config.h.in
[PATCH 03/17] Add support for the RISC-V-specific ELF flags
[PATCH 04/17] Add documentation for __riscv_flush_icache
[PATCH 05/17] RISC-V: ABI Implementation
[PATCH 06/17] RISC-V: Startup and Dynamic Loading Code
[PATCH 07/17] RISC-V: Thread-Local Storage Support
[PATCH 08/17] RISC-V: Generic <math.h> and soft-fp Routines
[PATCH 09/17] RISC-V: RV32F Support
[PATCH 10/17] RISC-V: RV32D, RV64F, and RV64D Support
[PATCH 11/17] RISC-V: Atomic and Locking Routines
[PATCH 12/17] RISC-V: Linux Syscall Interface
[PATCH 13/17] RISC-V: Linux ABI
[PATCH 14/17] RISC-V: Linux Startup and Dynamic Loading Code
[PATCH 15/17] RISC-V: Add ABI Lists
[PATCH 16/17] RISC-V: Build Infastructure
[PATCH 17/17] Add RISC-V to build-many-glibcs.py