Changes since v1: Fixed ptrace support by passing through high bits of WSTOPSIG. WEXITSTATUS is still masked (required by POSIX); WTERMSIG is also masked because bits 8-15 have nowhere to go. Added SYS_futex as an alias of SYS_futex_time64. Changed conditionals in patch 2. __wait4 is significantly reorganized and now uses a conditionally defined wrapper in src/internal/syscall.h. Duplication reduced in statx-using patches. Arnd Bergmann's comment about identical fcntl.h files has NOT been addressed. Rich Felker's suggestion (on IRC) to use a 0-instruction __get_tp was NOT implemented after discovering that it generates dramatically worse code on clang and cannot easily be conditionalized. Bug reports to come. Patches other than 2, 6, 7, 10 are unchanged. Testing: Smoke tested on riscv32, replacing the musl libc.so in an OpenEmbedded-generated VM with a dynamically linked systemd and verified boot. Smoke testing on i386 and x86_64 by replacing libc.so in an Alpine chroot and running build tools. libc-test was run on all three architectures. The errors on riscv32 are as follows: FAIL src/api/main.exe [status 1] FAIL src/functional/fcntl-static.exe [status 1] FAIL src/functional/fcntl.exe [status 1] FAIL src/functional/ipc_msg-static.exe [status 1] FAIL src/functional/ipc_msg.exe [status 1] FAIL src/functional/ipc_sem-static.exe [status 1] FAIL src/functional/ipc_sem.exe [status 1] FAIL src/functional/ipc_shm-static.exe [status 1] FAIL src/functional/ipc_shm.exe [status 1] FAIL src/functional/strptime-static.exe [status 1] FAIL src/functional/strptime.exe [status 1] FAIL src/math/fma.exe [status 1] FAIL src/math/fmaf.exe [status 1] FAIL src/math/powf.exe [status 1] FAIL src/regression/malloc-brk-fail-static.exe [status 1] FAIL src/regression/malloc-brk-fail.exe [status 1] FAIL src/regression/pthread_atfork-errno-clobber-static.exe [status 1] FAIL src/regression/pthread_atfork-errno-clobber.exe [status 1] The fcntl and sysvipc errors do not correspond to any error in x86_64 and potentially require investigation, although they could be kernel configuration issues. x86_64 has a different but overlapping set of math errors; qemu is known to not give bit-exact results for RISC-V floating point. The malloc, pthread, and src/api/main.exe failures match failures on x86_64. The test results are identical between master and my branch on x86_64. On i386, I saw a utime.exe and utime-static.exe error but have not managed to reproduce them. I was not able to run LTP on musl on any of the three architectures following the instructions in its README. make autotools && ./configure && make all -j16 eventually results in: confstr01.c:51:3: error: '_CS_XBS5_ILP32_OFF32_CFLAGS' undeclared here (not in a function) A cloneable repository with the present version is: git clone https://github.com/sorear/riscv-musl -b rv32_submit_v2