From 575e1579a4ebaa6dccb884ca657188a92982af23 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 26 Feb 2020 08:56:59 -0800 Subject: [PATCH] Update to musl 1.2.0. See the WHATSNEW file for details. The biggest change in musl is the switch to 64-bit time_t for 32-bit targets, however WASI libc was already using 64-bit time_t. The main change affecting WASI is an update to Unicode 12.1.0. --- expected/wasm32-wasi/predefined-macros.txt | 20 +- libc-top-half/musl/.mailmap | 1 + libc-top-half/musl/COPYRIGHT | 4 +- libc-top-half/musl/Makefile | 5 +- libc-top-half/musl/VERSION | 2 +- libc-top-half/musl/WHATSNEW | 36 ++ .../musl/arch/aarch64/bits/alltypes.h.in | 20 +- libc-top-half/musl/arch/aarch64/bits/endian.h | 5 - libc-top-half/musl/arch/aarch64/bits/limits.h | 7 - libc-top-half/musl/arch/aarch64/bits/socket.h | 33 -- .../musl/arch/aarch64/bits/syscall.h.in | 2 + libc-top-half/musl/arch/aarch64/reloc.h | 2 - libc-top-half/musl/arch/arm/arch.mak | 1 + .../musl/arch/arm/bits/alltypes.h.in | 21 +- libc-top-half/musl/arch/arm/bits/endian.h | 5 - libc-top-half/musl/arch/arm/bits/ipcstat.h | 2 +- libc-top-half/musl/arch/arm/bits/limits.h | 7 - libc-top-half/musl/arch/arm/bits/msg.h | 15 +- libc-top-half/musl/arch/arm/bits/sem.h | 10 +- libc-top-half/musl/arch/arm/bits/shm.h | 16 +- libc-top-half/musl/arch/arm/bits/stat.h | 6 +- libc-top-half/musl/arch/arm/bits/syscall.h.in | 22 +- libc-top-half/musl/arch/arm/reloc.h | 2 - libc-top-half/musl/arch/arm/syscall_arch.h | 4 +- libc-top-half/musl/arch/generic/bits/dirent.h | 11 + libc-top-half/musl/arch/generic/bits/ioctl.h | 5 + libc-top-half/musl/arch/generic/bits/limits.h | 0 libc-top-half/musl/arch/generic/bits/socket.h | 15 - libc-top-half/musl/arch/i386/arch.mak | 1 + .../musl/arch/i386/bits/alltypes.h.in | 21 +- libc-top-half/musl/arch/i386/bits/endian.h | 1 - libc-top-half/musl/arch/i386/bits/ipcstat.h | 2 +- libc-top-half/musl/arch/i386/bits/limits.h | 7 - libc-top-half/musl/arch/i386/bits/msg.h | 15 +- libc-top-half/musl/arch/i386/bits/sem.h | 10 +- libc-top-half/musl/arch/i386/bits/shm.h | 16 +- libc-top-half/musl/arch/i386/bits/stat.h | 6 +- .../musl/arch/i386/bits/syscall.h.in | 22 +- libc-top-half/musl/arch/i386/syscall_arch.h | 4 +- libc-top-half/musl/arch/m68k/arch.mak | 1 + .../musl/arch/m68k/bits/alltypes.h.in | 16 +- libc-top-half/musl/arch/m68k/bits/endian.h | 1 - libc-top-half/musl/arch/m68k/bits/ipcstat.h | 2 +- libc-top-half/musl/arch/m68k/bits/limits.h | 7 - libc-top-half/musl/arch/m68k/bits/msg.h | 15 +- libc-top-half/musl/arch/m68k/bits/sem.h | 10 +- libc-top-half/musl/arch/m68k/bits/shm.h | 16 +- libc-top-half/musl/arch/m68k/bits/stat.h | 6 +- .../musl/arch/m68k/bits/syscall.h.in | 21 +- libc-top-half/musl/arch/m68k/bits/user.h | 5 + libc-top-half/musl/arch/microblaze/arch.mak | 1 + .../musl/arch/microblaze/bits/alltypes.h.in | 21 +- .../musl/arch/microblaze/bits/endian.h | 5 - .../musl/arch/microblaze/bits/ipcstat.h | 2 +- .../musl/arch/microblaze/bits/limits.h | 7 - libc-top-half/musl/arch/microblaze/bits/msg.h | 15 +- libc-top-half/musl/arch/microblaze/bits/sem.h | 10 +- libc-top-half/musl/arch/microblaze/bits/shm.h | 16 +- .../musl/arch/microblaze/bits/stat.h | 6 +- .../musl/arch/microblaze/bits/syscall.h.in | 22 +- libc-top-half/musl/arch/microblaze/reloc.h | 2 - libc-top-half/musl/arch/mips/arch.mak | 1 + .../musl/arch/mips/bits/alltypes.h.in | 21 +- libc-top-half/musl/arch/mips/bits/endian.h | 5 - libc-top-half/musl/arch/mips/bits/hwcap.h | 11 + libc-top-half/musl/arch/mips/bits/ioctl.h | 4 +- libc-top-half/musl/arch/mips/bits/ipcstat.h | 2 +- libc-top-half/musl/arch/mips/bits/limits.h | 7 - libc-top-half/musl/arch/mips/bits/msg.h | 27 +- libc-top-half/musl/arch/mips/bits/sem.h | 10 +- libc-top-half/musl/arch/mips/bits/shm.h | 15 +- libc-top-half/musl/arch/mips/bits/signal.h | 8 +- libc-top-half/musl/arch/mips/bits/socket.h | 18 - libc-top-half/musl/arch/mips/bits/stat.h | 12 +- .../musl/arch/mips/bits/syscall.h.in | 22 +- libc-top-half/musl/arch/mips/reloc.h | 2 - libc-top-half/musl/arch/mips/syscall_arch.h | 4 +- .../musl/arch/mips64/bits/alltypes.h.in | 20 +- libc-top-half/musl/arch/mips64/bits/endian.h | 5 - libc-top-half/musl/arch/mips64/bits/limits.h | 7 - libc-top-half/musl/arch/mips64/bits/socket.h | 34 -- .../musl/arch/mips64/bits/syscall.h.in | 2 + libc-top-half/musl/arch/mips64/reloc.h | 10 +- libc-top-half/musl/arch/mipsn32/arch.mak | 1 + .../musl/arch/mipsn32/bits/alltypes.h.in | 21 +- libc-top-half/musl/arch/mipsn32/bits/endian.h | 5 - libc-top-half/musl/arch/mipsn32/bits/ioctl.h | 4 +- .../musl/arch/mipsn32/bits/ipcstat.h | 2 +- libc-top-half/musl/arch/mipsn32/bits/limits.h | 7 - libc-top-half/musl/arch/mipsn32/bits/msg.h | 27 +- libc-top-half/musl/arch/mipsn32/bits/sem.h | 10 +- libc-top-half/musl/arch/mipsn32/bits/shm.h | 15 +- libc-top-half/musl/arch/mipsn32/bits/socket.h | 18 - libc-top-half/musl/arch/mipsn32/bits/stat.h | 12 +- .../musl/arch/mipsn32/bits/syscall.h.in | 22 +- libc-top-half/musl/arch/mipsn32/reloc.h | 2 - .../musl/arch/mipsn32/syscall_arch.h | 4 +- libc-top-half/musl/arch/or1k/arch.mak | 1 + .../musl/arch/or1k/bits/alltypes.h.in | 16 +- libc-top-half/musl/arch/or1k/bits/endian.h | 1 - libc-top-half/musl/arch/or1k/bits/ipcstat.h | 2 +- libc-top-half/musl/arch/or1k/bits/limits.h | 7 - libc-top-half/musl/arch/or1k/bits/msg.h | 15 +- libc-top-half/musl/arch/or1k/bits/sem.h | 10 +- libc-top-half/musl/arch/or1k/bits/shm.h | 16 +- libc-top-half/musl/arch/or1k/bits/stat.h | 10 +- .../musl/arch/or1k/bits/syscall.h.in | 22 +- libc-top-half/musl/arch/powerpc/arch.mak | 1 + .../musl/arch/powerpc/bits/alltypes.h.in | 16 +- libc-top-half/musl/arch/powerpc/bits/endian.h | 15 - libc-top-half/musl/arch/powerpc/bits/ioctl.h | 4 +- .../musl/arch/powerpc/bits/ipcstat.h | 2 +- libc-top-half/musl/arch/powerpc/bits/limits.h | 7 - libc-top-half/musl/arch/powerpc/bits/msg.h | 15 +- libc-top-half/musl/arch/powerpc/bits/sem.h | 10 +- libc-top-half/musl/arch/powerpc/bits/shm.h | 16 +- libc-top-half/musl/arch/powerpc/bits/signal.h | 2 +- libc-top-half/musl/arch/powerpc/bits/socket.h | 18 - libc-top-half/musl/arch/powerpc/bits/stat.h | 6 +- .../musl/arch/powerpc/bits/syscall.h.in | 22 +- .../musl/arch/powerpc64/bits/alltypes.h.in | 20 +- .../musl/arch/powerpc64/bits/endian.h | 5 - .../musl/arch/powerpc64/bits/limits.h | 7 - .../musl/arch/powerpc64/bits/signal.h | 8 +- .../musl/arch/powerpc64/bits/socket.h | 34 -- .../musl/arch/powerpc64/bits/syscall.h.in | 2 + libc-top-half/musl/arch/powerpc64/reloc.h | 2 - libc-top-half/musl/arch/riscv64/atomic_arch.h | 2 +- .../musl/arch/riscv64/bits/alltypes.h.in | 15 +- libc-top-half/musl/arch/riscv64/bits/endian.h | 1 - libc-top-half/musl/arch/riscv64/bits/limits.h | 7 - libc-top-half/musl/arch/riscv64/bits/reg.h | 6 - libc-top-half/musl/arch/riscv64/bits/signal.h | 9 + libc-top-half/musl/arch/riscv64/bits/socket.h | 19 - .../musl/arch/riscv64/bits/syscall.h.in | 2 + .../musl/arch/s390x/bits/alltypes.h.in | 15 +- libc-top-half/musl/arch/s390x/bits/endian.h | 1 - libc-top-half/musl/arch/s390x/bits/limits.h | 7 - libc-top-half/musl/arch/s390x/bits/socket.h | 17 - .../musl/arch/s390x/bits/syscall.h.in | 2 + libc-top-half/musl/arch/s390x/reloc.h | 2 - libc-top-half/musl/arch/sh/arch.mak | 1 + libc-top-half/musl/arch/sh/bits/alltypes.h.in | 21 +- libc-top-half/musl/arch/sh/bits/endian.h | 5 - libc-top-half/musl/arch/sh/bits/ioctl.h | 4 +- libc-top-half/musl/arch/sh/bits/ipcstat.h | 2 +- libc-top-half/musl/arch/sh/bits/limits.h | 7 - libc-top-half/musl/arch/sh/bits/msg.h | 15 +- libc-top-half/musl/arch/sh/bits/sem.h | 10 +- libc-top-half/musl/arch/sh/bits/shm.h | 16 +- libc-top-half/musl/arch/sh/bits/stat.h | 6 +- libc-top-half/musl/arch/sh/bits/syscall.h.in | 21 +- libc-top-half/musl/arch/sh/reloc.h | 2 - .../musl/arch/wasm32/bits/alltypes.h.in | 20 +- libc-top-half/musl/arch/wasm32/bits/dirent.h | 1 + libc-top-half/musl/arch/wasm32/bits/endian.h | 1 - libc-top-half/musl/arch/wasm32/bits/limits.h | 7 - libc-top-half/musl/arch/wasm32/bits/socket.h | 1 - .../musl/arch/x32/bits/alltypes.h.in | 15 +- libc-top-half/musl/arch/x32/bits/endian.h | 1 - libc-top-half/musl/arch/x32/bits/ioctl_fix.h | 4 + libc-top-half/musl/arch/x32/bits/limits.h | 7 - libc-top-half/musl/arch/x32/bits/socket.h | 21 +- libc-top-half/musl/arch/x32/bits/syscall.h.in | 3 + libc-top-half/musl/arch/x32/syscall_arch.h | 2 + .../musl/arch/x86_64/bits/alltypes.h.in | 15 +- libc-top-half/musl/arch/x86_64/bits/endian.h | 1 - libc-top-half/musl/arch/x86_64/bits/limits.h | 7 - libc-top-half/musl/arch/x86_64/bits/socket.h | 16 - .../musl/arch/x86_64/bits/syscall.h.in | 2 + libc-top-half/musl/compat/time32/__xstat.c | 24 ++ libc-top-half/musl/compat/time32/adjtime32.c | 21 ++ .../musl/compat/time32/adjtimex_time32.c | 10 + .../musl/compat/time32/aio_suspend_time32.c | 11 + .../musl/compat/time32/clock_adjtime32.c | 70 ++++ .../musl/compat/time32/clock_getres_time32.c | 13 + .../musl/compat/time32/clock_gettime32.c | 18 + .../compat/time32/clock_nanosleep_time32.c | 15 + .../musl/compat/time32/clock_settime32.c | 9 + .../musl/compat/time32/cnd_timedwait_time32.c | 9 + libc-top-half/musl/compat/time32/ctime32.c | 7 + libc-top-half/musl/compat/time32/ctime32_r.c | 7 + libc-top-half/musl/compat/time32/difftime32.c | 7 + .../musl/compat/time32/fstat_time32.c | 17 + .../musl/compat/time32/fstatat_time32.c | 17 + libc-top-half/musl/compat/time32/ftime32.c | 25 ++ .../musl/compat/time32/futimens_time32.c | 10 + .../musl/compat/time32/futimes_time32.c | 12 + .../musl/compat/time32/futimesat_time32.c | 12 + .../musl/compat/time32/getitimer_time32.c | 15 + .../musl/compat/time32/getrusage_time32.c | 39 ++ .../musl/compat/time32/gettimeofday_time32.c | 19 + libc-top-half/musl/compat/time32/gmtime32.c | 7 + libc-top-half/musl/compat/time32/gmtime32_r.c | 7 + .../musl/compat/time32/localtime32.c | 7 + .../musl/compat/time32/localtime32_r.c | 7 + .../musl/compat/time32/lstat_time32.c | 17 + .../musl/compat/time32/lutimes_time32.c | 12 + libc-top-half/musl/compat/time32/mktime32.c | 16 + .../compat/time32/mq_timedreceive_time32.c | 9 + .../musl/compat/time32/mq_timedsend_time32.c | 9 + .../musl/compat/time32/mtx_timedlock_time32.c | 9 + .../musl/compat/time32/nanosleep_time32.c | 15 + .../musl/compat/time32/ppoll_time32.c | 10 + .../musl/compat/time32/pselect_time32.c | 9 + .../time32/pthread_cond_timedwait_time32.c | 9 + .../time32/pthread_mutex_timedlock_time32.c | 9 + .../pthread_rwlock_timedrdlock_time32.c | 9 + .../pthread_rwlock_timedwrlock_time32.c | 9 + .../time32/pthread_timedjoin_np_time32.c | 10 + .../musl/compat/time32/recvmmsg_time32.c | 10 + .../time32/sched_rr_get_interval_time32.c | 13 + .../musl/compat/time32/select_time32.c | 10 + .../musl/compat/time32/sem_timedwait_time32.c | 9 + .../musl/compat/time32/semtimedop_time32.c | 10 + .../musl/compat/time32/setitimer_time32.c | 25 ++ .../musl/compat/time32/settimeofday_time32.c | 10 + .../musl/compat/time32/sigtimedwait_time32.c | 9 + .../musl/compat/time32/stat_time32.c | 17 + libc-top-half/musl/compat/time32/stime32.c | 8 + .../musl/compat/time32/thrd_sleep_time32.c | 16 + libc-top-half/musl/compat/time32/time32.c | 15 + libc-top-half/musl/compat/time32/time32.h | 91 +++++ libc-top-half/musl/compat/time32/time32gm.c | 15 + .../musl/compat/time32/timer_gettime32.c | 15 + .../musl/compat/time32/timer_settime32.c | 25 ++ .../musl/compat/time32/timerfd_gettime32.c | 16 + .../musl/compat/time32/timerfd_settime32.c | 26 ++ .../musl/compat/time32/timespec_get_time32.c | 18 + .../musl/compat/time32/utime_time32.c | 14 + .../musl/compat/time32/utimensat_time32.c | 11 + .../musl/compat/time32/utimes_time32.c | 11 + .../musl/compat/time32/wait3_time32.c | 40 ++ .../musl/compat/time32/wait4_time32.c | 40 ++ libc-top-half/musl/configure | 9 + libc-top-half/musl/include/aio.h | 4 + libc-top-half/musl/include/alloca.h | 2 - libc-top-half/musl/include/alltypes.h.in | 31 +- libc-top-half/musl/include/arpa/nameser.h | 1 - libc-top-half/musl/include/dirent.h | 18 +- libc-top-half/musl/include/dlfcn.h | 4 + libc-top-half/musl/include/endian.h | 44 ++- libc-top-half/musl/include/features.h | 2 + libc-top-half/musl/include/limits.h | 18 +- libc-top-half/musl/include/mqueue.h | 5 + libc-top-half/musl/include/netinet/icmp6.h | 1 - libc-top-half/musl/include/netinet/if_ether.h | 1 + libc-top-half/musl/include/netinet/ip.h | 3 +- libc-top-half/musl/include/netinet/ip6.h | 1 - libc-top-half/musl/include/netinet/tcp.h | 4 +- libc-top-half/musl/include/poll.h | 6 + libc-top-half/musl/include/pthread.h | 10 + libc-top-half/musl/include/sched.h | 8 + libc-top-half/musl/include/semaphore.h | 4 + libc-top-half/musl/include/signal.h | 8 + libc-top-half/musl/include/sys/acct.h | 1 - libc-top-half/musl/include/sys/ioctl.h | 1 + libc-top-half/musl/include/sys/mman.h | 2 + libc-top-half/musl/include/sys/prctl.h | 4 + libc-top-half/musl/include/sys/procfs.h | 7 +- libc-top-half/musl/include/sys/ptrace.h | 29 ++ libc-top-half/musl/include/sys/resource.h | 7 +- libc-top-half/musl/include/sys/select.h | 5 + libc-top-half/musl/include/sys/sem.h | 8 +- libc-top-half/musl/include/sys/socket.h | 73 +++- libc-top-half/musl/include/sys/stat.h | 9 + libc-top-half/musl/include/sys/statvfs.h | 2 - libc-top-half/musl/include/sys/time.h | 14 + libc-top-half/musl/include/sys/timeb.h | 6 + libc-top-half/musl/include/sys/timerfd.h | 5 + libc-top-half/musl/include/sys/timex.h | 5 + libc-top-half/musl/include/sys/ttydefaults.h | 7 +- libc-top-half/musl/include/sys/wait.h | 10 +- libc-top-half/musl/include/threads.h | 6 + libc-top-half/musl/include/time.h | 28 ++ libc-top-half/musl/include/utime.h | 6 + libc-top-half/musl/include/utmpx.h | 7 +- libc-top-half/musl/ldso/dynlink.c | 65 +++- libc-top-half/musl/src/aio/aio_suspend.c | 2 + libc-top-half/musl/src/complex/cacosh.c | 5 +- libc-top-half/musl/src/complex/cacoshf.c | 5 +- libc-top-half/musl/src/complex/cacoshl.c | 5 +- libc-top-half/musl/src/complex/catanf.c | 14 +- libc-top-half/musl/src/complex/catanl.c | 14 +- libc-top-half/musl/src/ctype/alpha.h | 159 ++++---- libc-top-half/musl/src/ctype/casemap.h | 297 +++++++++++++++ libc-top-half/musl/src/ctype/nonspacing.h | 88 +++-- libc-top-half/musl/src/ctype/punct.h | 160 ++++---- libc-top-half/musl/src/ctype/towctrans.c | 344 +++--------------- libc-top-half/musl/src/ctype/wcwidth.c | 2 +- libc-top-half/musl/src/ctype/wide.h | 26 +- libc-top-half/musl/src/fenv/riscv64/fenv.S | 5 +- libc-top-half/musl/src/internal/dynlink.h | 1 - libc-top-half/musl/src/internal/floatscan.c | 5 +- libc-top-half/musl/src/internal/syscall.h | 46 +++ libc-top-half/musl/src/ldso/__dlsym.c | 4 + .../musl/src/ldso/arm/dlsym_time64.S | 3 + .../musl/src/ldso/i386/dlsym_time64.S | 3 + .../musl/src/ldso/m68k/dlsym_time64.S | 3 + .../musl/src/ldso/microblaze/dlsym_time64.S | 3 + .../musl/src/ldso/mips/dlsym_time64.S | 3 + .../musl/src/ldso/mipsn32/dlsym_time64.S | 3 + .../musl/src/ldso/or1k/dlsym_time64.S | 3 + .../musl/src/ldso/powerpc/dlsym_time64.S | 3 + libc-top-half/musl/src/ldso/sh/dlsym_time64.S | 3 + libc-top-half/musl/src/linux/clock_adjtime.c | 57 ++- libc-top-half/musl/src/linux/wait4.c | 34 +- libc-top-half/musl/src/math/i386/acos.s | 16 +- libc-top-half/musl/src/math/i386/acosf.s | 17 +- libc-top-half/musl/src/math/i386/acosl.s | 15 +- libc-top-half/musl/src/math/i386/asin.s | 32 +- libc-top-half/musl/src/math/i386/asinf.s | 24 +- libc-top-half/musl/src/math/i386/asinl.s | 13 +- libc-top-half/musl/src/math/i386/atan.s | 2 + libc-top-half/musl/src/math/i386/atan2.s | 3 +- libc-top-half/musl/src/math/i386/atan2f.s | 3 +- libc-top-half/musl/src/math/i386/atanf.s | 2 + libc-top-half/musl/src/math/i386/exp2.s | 1 - libc-top-half/musl/src/math/i386/exp2f.s | 1 - libc-top-half/musl/src/math/i386/exp2l.s | 2 +- .../musl/src/math/i386/{exp.s => exp_ld.s} | 55 +-- libc-top-half/musl/src/math/i386/expf.s | 1 - libc-top-half/musl/src/math/i386/expm1.s | 1 - libc-top-half/musl/src/math/i386/expm1f.s | 1 - libc-top-half/musl/src/math/i386/expm1l.s | 2 +- libc-top-half/musl/src/math/i386/log.s | 2 + libc-top-half/musl/src/math/i386/log10.s | 2 + libc-top-half/musl/src/math/i386/log10f.s | 2 + libc-top-half/musl/src/math/i386/log1p.s | 4 + libc-top-half/musl/src/math/i386/log1pf.s | 4 + libc-top-half/musl/src/math/i386/log2.s | 2 + libc-top-half/musl/src/math/i386/log2f.s | 2 + libc-top-half/musl/src/math/i386/logf.s | 2 + libc-top-half/musl/src/math/mips/fabs.c | 16 + libc-top-half/musl/src/math/mips/fabsf.c | 16 + libc-top-half/musl/src/math/mips/sqrt.c | 16 + libc-top-half/musl/src/math/mips/sqrtf.c | 16 + libc-top-half/musl/src/math/powerpc/fabs.c | 2 +- libc-top-half/musl/src/math/powerpc/fma.c | 2 +- libc-top-half/musl/src/math/x32/lrintl.s | 4 +- libc-top-half/musl/src/misc/getrusage.c | 30 +- libc-top-half/musl/src/misc/ioctl.c | 136 ++++++- libc-top-half/musl/src/misc/pty.c | 4 +- libc-top-half/musl/src/network/getsockopt.c | 9 + libc-top-half/musl/src/network/recvmmsg.c | 14 +- libc-top-half/musl/src/network/recvmsg.c | 47 +++ libc-top-half/musl/src/network/setsockopt.c | 9 + libc-top-half/musl/src/signal/arm/sigsetjmp.s | 5 +- libc-top-half/musl/src/stat/__xstat.c | 4 + libc-top-half/musl/src/stat/fchmodat.c | 3 +- libc-top-half/musl/src/stat/fstat.c | 2 + libc-top-half/musl/src/stat/fstatat.c | 18 + libc-top-half/musl/src/stat/lstat.c | 2 + libc-top-half/musl/src/stat/stat.c | 2 + libc-top-half/musl/src/stdio/tempnam.c | 5 +- libc-top-half/musl/src/stdio/tmpnam.c | 5 +- libc-top-half/musl/src/stdio/ungetc.c | 2 +- libc-top-half/musl/src/string/arm/memcpy.c | 2 +- libc-top-half/musl/src/string/arm/memcpy_le.S | 13 +- libc-top-half/musl/src/time/__map_file.c | 3 +- libc-top-half/musl/tools/add-cfi.i386.awk | 2 +- libc-top-half/musl/tools/add-cfi.x86_64.awk | 2 +- 362 files changed, 3309 insertions(+), 1764 deletions(-) create mode 100644 libc-top-half/musl/.mailmap delete mode 100644 libc-top-half/musl/arch/aarch64/bits/endian.h delete mode 100644 libc-top-half/musl/arch/aarch64/bits/limits.h delete mode 100644 libc-top-half/musl/arch/aarch64/bits/socket.h create mode 100644 libc-top-half/musl/arch/arm/arch.mak delete mode 100644 libc-top-half/musl/arch/arm/bits/endian.h delete mode 100644 libc-top-half/musl/arch/arm/bits/limits.h create mode 100644 libc-top-half/musl/arch/generic/bits/dirent.h create mode 100644 libc-top-half/musl/arch/generic/bits/limits.h create mode 100644 libc-top-half/musl/arch/i386/arch.mak delete mode 100644 libc-top-half/musl/arch/i386/bits/endian.h create mode 100644 libc-top-half/musl/arch/m68k/arch.mak delete mode 100644 libc-top-half/musl/arch/m68k/bits/endian.h delete mode 100644 libc-top-half/musl/arch/m68k/bits/limits.h create mode 100644 libc-top-half/musl/arch/microblaze/arch.mak delete mode 100644 libc-top-half/musl/arch/microblaze/bits/endian.h delete mode 100644 libc-top-half/musl/arch/microblaze/bits/limits.h create mode 100644 libc-top-half/musl/arch/mips/arch.mak delete mode 100644 libc-top-half/musl/arch/mips/bits/endian.h delete mode 100644 libc-top-half/musl/arch/mips/bits/limits.h delete mode 100644 libc-top-half/musl/arch/mips64/bits/endian.h delete mode 100644 libc-top-half/musl/arch/mips64/bits/limits.h create mode 100644 libc-top-half/musl/arch/mipsn32/arch.mak delete mode 100644 libc-top-half/musl/arch/mipsn32/bits/endian.h delete mode 100644 libc-top-half/musl/arch/mipsn32/bits/limits.h create mode 100644 libc-top-half/musl/arch/or1k/arch.mak delete mode 100644 libc-top-half/musl/arch/or1k/bits/endian.h create mode 100644 libc-top-half/musl/arch/powerpc/arch.mak delete mode 100644 libc-top-half/musl/arch/powerpc/bits/endian.h delete mode 100644 libc-top-half/musl/arch/powerpc/bits/limits.h delete mode 100644 libc-top-half/musl/arch/powerpc64/bits/endian.h delete mode 100644 libc-top-half/musl/arch/powerpc64/bits/limits.h delete mode 100644 libc-top-half/musl/arch/riscv64/bits/endian.h delete mode 100644 libc-top-half/musl/arch/riscv64/bits/limits.h delete mode 100644 libc-top-half/musl/arch/riscv64/bits/socket.h delete mode 100644 libc-top-half/musl/arch/s390x/bits/endian.h delete mode 100644 libc-top-half/musl/arch/s390x/bits/socket.h create mode 100644 libc-top-half/musl/arch/sh/arch.mak delete mode 100644 libc-top-half/musl/arch/sh/bits/endian.h create mode 100644 libc-top-half/musl/arch/wasm32/bits/dirent.h delete mode 100644 libc-top-half/musl/arch/wasm32/bits/endian.h delete mode 100644 libc-top-half/musl/arch/wasm32/bits/socket.h delete mode 100644 libc-top-half/musl/arch/x32/bits/endian.h create mode 100644 libc-top-half/musl/arch/x32/bits/ioctl_fix.h delete mode 100644 libc-top-half/musl/arch/x86_64/bits/endian.h delete mode 100644 libc-top-half/musl/arch/x86_64/bits/socket.h create mode 100644 libc-top-half/musl/compat/time32/__xstat.c create mode 100644 libc-top-half/musl/compat/time32/adjtime32.c create mode 100644 libc-top-half/musl/compat/time32/adjtimex_time32.c create mode 100644 libc-top-half/musl/compat/time32/aio_suspend_time32.c create mode 100644 libc-top-half/musl/compat/time32/clock_adjtime32.c create mode 100644 libc-top-half/musl/compat/time32/clock_getres_time32.c create mode 100644 libc-top-half/musl/compat/time32/clock_gettime32.c create mode 100644 libc-top-half/musl/compat/time32/clock_nanosleep_time32.c create mode 100644 libc-top-half/musl/compat/time32/clock_settime32.c create mode 100644 libc-top-half/musl/compat/time32/cnd_timedwait_time32.c create mode 100644 libc-top-half/musl/compat/time32/ctime32.c create mode 100644 libc-top-half/musl/compat/time32/ctime32_r.c create mode 100644 libc-top-half/musl/compat/time32/difftime32.c create mode 100644 libc-top-half/musl/compat/time32/fstat_time32.c create mode 100644 libc-top-half/musl/compat/time32/fstatat_time32.c create mode 100644 libc-top-half/musl/compat/time32/ftime32.c create mode 100644 libc-top-half/musl/compat/time32/futimens_time32.c create mode 100644 libc-top-half/musl/compat/time32/futimes_time32.c create mode 100644 libc-top-half/musl/compat/time32/futimesat_time32.c create mode 100644 libc-top-half/musl/compat/time32/getitimer_time32.c create mode 100644 libc-top-half/musl/compat/time32/getrusage_time32.c create mode 100644 libc-top-half/musl/compat/time32/gettimeofday_time32.c create mode 100644 libc-top-half/musl/compat/time32/gmtime32.c create mode 100644 libc-top-half/musl/compat/time32/gmtime32_r.c create mode 100644 libc-top-half/musl/compat/time32/localtime32.c create mode 100644 libc-top-half/musl/compat/time32/localtime32_r.c create mode 100644 libc-top-half/musl/compat/time32/lstat_time32.c create mode 100644 libc-top-half/musl/compat/time32/lutimes_time32.c create mode 100644 libc-top-half/musl/compat/time32/mktime32.c create mode 100644 libc-top-half/musl/compat/time32/mq_timedreceive_time32.c create mode 100644 libc-top-half/musl/compat/time32/mq_timedsend_time32.c create mode 100644 libc-top-half/musl/compat/time32/mtx_timedlock_time32.c create mode 100644 libc-top-half/musl/compat/time32/nanosleep_time32.c create mode 100644 libc-top-half/musl/compat/time32/ppoll_time32.c create mode 100644 libc-top-half/musl/compat/time32/pselect_time32.c create mode 100644 libc-top-half/musl/compat/time32/pthread_cond_timedwait_time32.c create mode 100644 libc-top-half/musl/compat/time32/pthread_mutex_timedlock_time32.c create mode 100644 libc-top-half/musl/compat/time32/pthread_rwlock_timedrdlock_time32.c create mode 100644 libc-top-half/musl/compat/time32/pthread_rwlock_timedwrlock_time32.c create mode 100644 libc-top-half/musl/compat/time32/pthread_timedjoin_np_time32.c create mode 100644 libc-top-half/musl/compat/time32/recvmmsg_time32.c create mode 100644 libc-top-half/musl/compat/time32/sched_rr_get_interval_time32.c create mode 100644 libc-top-half/musl/compat/time32/select_time32.c create mode 100644 libc-top-half/musl/compat/time32/sem_timedwait_time32.c create mode 100644 libc-top-half/musl/compat/time32/semtimedop_time32.c create mode 100644 libc-top-half/musl/compat/time32/setitimer_time32.c create mode 100644 libc-top-half/musl/compat/time32/settimeofday_time32.c create mode 100644 libc-top-half/musl/compat/time32/sigtimedwait_time32.c create mode 100644 libc-top-half/musl/compat/time32/stat_time32.c create mode 100644 libc-top-half/musl/compat/time32/stime32.c create mode 100644 libc-top-half/musl/compat/time32/thrd_sleep_time32.c create mode 100644 libc-top-half/musl/compat/time32/time32.c create mode 100644 libc-top-half/musl/compat/time32/time32.h create mode 100644 libc-top-half/musl/compat/time32/time32gm.c create mode 100644 libc-top-half/musl/compat/time32/timer_gettime32.c create mode 100644 libc-top-half/musl/compat/time32/timer_settime32.c create mode 100644 libc-top-half/musl/compat/time32/timerfd_gettime32.c create mode 100644 libc-top-half/musl/compat/time32/timerfd_settime32.c create mode 100644 libc-top-half/musl/compat/time32/timespec_get_time32.c create mode 100644 libc-top-half/musl/compat/time32/utime_time32.c create mode 100644 libc-top-half/musl/compat/time32/utimensat_time32.c create mode 100644 libc-top-half/musl/compat/time32/utimes_time32.c create mode 100644 libc-top-half/musl/compat/time32/wait3_time32.c create mode 100644 libc-top-half/musl/compat/time32/wait4_time32.c create mode 100644 libc-top-half/musl/src/ctype/casemap.h create mode 100644 libc-top-half/musl/src/ldso/arm/dlsym_time64.S create mode 100644 libc-top-half/musl/src/ldso/i386/dlsym_time64.S create mode 100644 libc-top-half/musl/src/ldso/m68k/dlsym_time64.S create mode 100644 libc-top-half/musl/src/ldso/microblaze/dlsym_time64.S create mode 100644 libc-top-half/musl/src/ldso/mips/dlsym_time64.S create mode 100644 libc-top-half/musl/src/ldso/mipsn32/dlsym_time64.S create mode 100644 libc-top-half/musl/src/ldso/or1k/dlsym_time64.S create mode 100644 libc-top-half/musl/src/ldso/powerpc/dlsym_time64.S create mode 100644 libc-top-half/musl/src/ldso/sh/dlsym_time64.S delete mode 100644 libc-top-half/musl/src/math/i386/exp2.s delete mode 100644 libc-top-half/musl/src/math/i386/exp2f.s rename libc-top-half/musl/src/math/i386/{exp.s => exp_ld.s} (67%) delete mode 100644 libc-top-half/musl/src/math/i386/expf.s delete mode 100644 libc-top-half/musl/src/math/i386/expm1.s delete mode 100644 libc-top-half/musl/src/math/i386/expm1f.s create mode 100644 libc-top-half/musl/src/math/mips/fabs.c create mode 100644 libc-top-half/musl/src/math/mips/fabsf.c create mode 100644 libc-top-half/musl/src/math/mips/sqrt.c create mode 100644 libc-top-half/musl/src/math/mips/sqrtf.c diff --git a/expected/wasm32-wasi/predefined-macros.txt b/expected/wasm32-wasi/predefined-macros.txt index f7fa6e4..9510bf2 100644 --- a/expected/wasm32-wasi/predefined-macros.txt +++ b/expected/wasm32-wasi/predefined-macros.txt @@ -86,7 +86,7 @@ #define CDISCARD CTRL('o') #define CDSUSP CTRL('y') #define CEOF CTRL('d') -#define CEOL _POSIX_VDISABLE +#define CEOL '\0' #define CEOT CEOF #define CERASE 0177 #define CFLUSH CDISCARD @@ -124,11 +124,11 @@ #define CRNCYSTR 0x4000F #define CRPRNT CREPRINT #define CSTART CTRL('q') -#define CSTATUS _POSIX_VDISABLE +#define CSTATUS '\0' #define CSTOP CTRL('s') #define CSUSP CTRL('z') #define CTIME 0 -#define CTRL(x) (x&037) +#define CTRL(x) ((x)&037) #define CWERASE CTRL('w') #define C_ANY ns_c_any #define C_CHAOS ns_c_chaos @@ -996,7 +996,7 @@ #define LFLOW_RESTART_ANY 2 #define LFLOW_RESTART_XON 3 #define LITTLE_ENDIAN __LITTLE_ENDIAN -#define LLONG_MAX (0x7fffffffffffffffLL) +#define LLONG_MAX 0x7fffffffffffffffLL #define LLONG_MIN (-LLONG_MAX-1) #define LM_FORWARDMASK 2 #define LM_MODE 1 @@ -1007,8 +1007,8 @@ #define LOCK_SH 1 #define LOCK_UN 8 #define LONGBITS (sizeof(long) * 8) -#define LONG_BIT (32) -#define LONG_MAX (0x7fffffffL) +#define LONG_BIT 32 +#define LONG_MAX __LONG_MAX #define LONG_MIN (-LONG_MAX-1) #define L_INCR 1 #define L_SET 0 @@ -1825,6 +1825,7 @@ #define TCP_THIN_LINEAR_TIMEOUTS 16 #define TCP_TIMESTAMP 24 #define TCP_TIME_WAIT 6 +#define TCP_TX_DELAY 37 #define TCP_ULP 31 #define TCP_USER_TIMEOUT 18 #define TCP_WINDOW_CLAMP 10 @@ -2428,7 +2429,7 @@ #define __BIGGEST_ALIGNMENT__ 16 #define __BIG_ENDIAN 4321 #define __BIND 19950621 -#define __BYTE_ORDER __LITTLE_ENDIAN +#define __BYTE_ORDER __BYTE_ORDER__ #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __CHAR16_TYPE__ unsigned short #define __CHAR32_TYPE__ unsigned int @@ -2647,6 +2648,7 @@ #define __LITTLE_ENDIAN 1234 #define __LITTLE_ENDIAN__ 1 #define __LONG_LONG_MAX__ 9223372036854775807LL +#define __LONG_MAX __LONG_MAX__ #define __LONG_MAX__ 2147483647L #define __NAMESER 19991006 #define __NEED_FILE @@ -2735,6 +2737,7 @@ #define __PTRDIFF_MAX__ 2147483647L #define __PTRDIFF_TYPE__ long int #define __PTRDIFF_WIDTH__ 32 +#define __REDIR(x,y) __typeof__(x) x __asm__(#y) #define __RETCAST(x) #define __RETCAST_2(x,y) #define __RETCAST_3(x,y,z) @@ -2782,6 +2785,7 @@ #define __UAPI_DEF_IN_IPPROTO 0 #define __UAPI_DEF_IN_PKTINFO 0 #define __UAPI_DEF_IP6_MTUINFO 0 +#define __UAPI_DEF_IPHDR 0 #define __UAPI_DEF_IPPROTO_V6 0 #define __UAPI_DEF_IPV6_MREQ 0 #define __UAPI_DEF_IPV6_OPTIONS 0 @@ -2880,6 +2884,7 @@ #define __UINT_LEAST8_MAX__ 255 #define __UINT_LEAST8_TYPE__ unsigned char #define __USER_LABEL_PREFIX__ +#define __USE_TIME_BITS64 1 #define __WASI_ADVICE_DONTNEED (UINT8_C(4)) #define __WASI_ADVICE_NOREUSE (UINT8_C(5)) #define __WASI_ADVICE_NORMAL (UINT8_C(0)) @@ -3168,6 +3173,7 @@ #define acosh(x) __tg_real_complex(acosh, (x)) #define alignas _Alignas #define alignof _Alignof +#define alloca __builtin_alloca #define alphasort64 alphasort #define and && #define and_eq &= diff --git a/libc-top-half/musl/.mailmap b/libc-top-half/musl/.mailmap new file mode 100644 index 0000000..aede9ec --- /dev/null +++ b/libc-top-half/musl/.mailmap @@ -0,0 +1 @@ +Ada Worcester diff --git a/libc-top-half/musl/COPYRIGHT b/libc-top-half/musl/COPYRIGHT index 67802d1..e647237 100644 --- a/libc-top-half/musl/COPYRIGHT +++ b/libc-top-half/musl/COPYRIGHT @@ -1,7 +1,7 @@ musl as a whole is licensed under the following standard MIT license: ---------------------------------------------------------------------- -Copyright © 2005-2019 Rich Felker, et al. +Copyright © 2005-2020 Rich Felker, et al. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -26,6 +26,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Authors/contributors include: A. Wilcox +Ada Worcester Alex Dowad Alex Suykov Alexander Monakov @@ -65,7 +66,6 @@ Jeremy Huntwork Jo-Philipp Wich Joakim Sindholt John Spencer -Josiah Worcester Julien Ramseier Justin Cormack Kaarle Ritvanen diff --git a/libc-top-half/musl/Makefile b/libc-top-half/musl/Makefile index b46f8ca..bd8f5c3 100644 --- a/libc-top-half/musl/Makefile +++ b/libc-top-half/musl/Makefile @@ -17,7 +17,7 @@ includedir = $(prefix)/include libdir = $(prefix)/lib syslibdir = /lib -SRC_DIRS = $(addprefix $(srcdir)/,src/* crt ldso) +SRC_DIRS = $(addprefix $(srcdir)/,src/* crt ldso $(COMPAT_SRC_DIRS)) BASE_GLOBS = $(addsuffix /*.c,$(SRC_DIRS)) ARCH_GLOBS = $(addsuffix /$(ARCH)/*.[csS],$(SRC_DIRS)) BASE_SRCS = $(sort $(wildcard $(BASE_GLOBS))) @@ -27,7 +27,7 @@ ARCH_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(ARCH_SRCS))) REPLACED_OBJS = $(sort $(subst /$(ARCH)/,/,$(ARCH_OBJS))) ALL_OBJS = $(addprefix obj/, $(filter-out $(REPLACED_OBJS), $(sort $(BASE_OBJS) $(ARCH_OBJS)))) -LIBC_OBJS = $(filter obj/src/%,$(ALL_OBJS)) +LIBC_OBJS = $(filter obj/src/%,$(ALL_OBJS)) $(filter obj/compat/%,$(ALL_OBJS)) LDSO_OBJS = $(filter obj/ldso/%,$(ALL_OBJS:%.o=%.lo)) CRT_OBJS = $(filter obj/crt/%,$(ALL_OBJS)) @@ -75,6 +75,7 @@ WRAPCC_CLANG = clang LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH)$(SUBARCH).so.1 -include config.mak +-include $(srcdir)/arch/$(ARCH)/arch.mak ifeq ($(ARCH),) diff --git a/libc-top-half/musl/VERSION b/libc-top-half/musl/VERSION index 3fe3e58..26aaba0 100644 --- a/libc-top-half/musl/VERSION +++ b/libc-top-half/musl/VERSION @@ -1 +1 @@ -1.1.24 +1.2.0 diff --git a/libc-top-half/musl/WHATSNEW b/libc-top-half/musl/WHATSNEW index f9879bd..ecf0ceb 100644 --- a/libc-top-half/musl/WHATSNEW +++ b/libc-top-half/musl/WHATSNEW @@ -2164,3 +2164,39 @@ arch-specific bugs fixed: - riscv64 atomics had broken asm constraints (missing earlyclobber flag) - arm clone() was broken when compiled as thumb if start function returned - mipsr6 setjmp/longjmp did not preserve fpu register state correctly + + + +1.2.0 release notes + +new features: +- time_t is now 64-bit on all archs (not just 64-bit archs) +- character type & case mapping data updated to Unicode 12.1.0 +- header-level support for new linux features in 5.3 and 5.4 + +performance: +- new O(1) wchar_t case mapping implementation +- i386 now uses C math code for exp, faster than old asm +- mips math asm + +compatibility & conformance: +- endian.h now aims to conform to future POSIX definition +- support older compilers that don't accept powerpc math asm constraints +- fdpic code in ldso was incompatible with valid optimizations in gcc 9+ +- RLIMIT_RTTIME was missing from sys/resource.h + +bugs fixed: +- wcwidth wrongly returned 0 for most of planes 4 and up +- missing case mapping between U+03F3 and U+037F +- wrong cacosh results for arguments with negative imaginary part +- wrong catanf/catanl results for various classes of arguments +- wrong return value for ungetc with argument outside [0,UCHAR_MAX] +- posix_openpt with no ptys available produced wrong errno + +arch-specific bugs fixed: +- sigcontext/regset definition mistakes & omissions on m68k, powerpc64 +- fesetenv(FE_DFL_ENV) crashed on riscv64 +- sh2 dynamic linker was broken since 1.1.21 (crash in stage 2b) +- arm dynamic linker chose wrong tls/atomic variants since 1.1.21 +- some math library functions returned excess precision on i386 +- unconfirmed regression in fchmodat AT_SYMLINK_NOFOLLOW on mips* diff --git a/libc-top-half/musl/arch/aarch64/bits/alltypes.h.in b/libc-top-half/musl/arch/aarch64/bits/alltypes.h.in index d56abda..c547ca0 100644 --- a/libc-top-half/musl/arch/aarch64/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/aarch64/bits/alltypes.h.in @@ -2,8 +2,13 @@ #define _Int64 long #define _Reg long -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#if __AARCH64EB__ +#define __BYTE_ORDER 4321 +#else +#define __BYTE_ORDER 1234 +#endif + +#define __LONG_MAX 0x7fffffffffffffffL #ifndef __cplusplus TYPEDEF unsigned wchar_t; @@ -17,14 +22,3 @@ TYPEDEF float float_t; TYPEDEF double double_t; TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/aarch64/bits/endian.h b/libc-top-half/musl/arch/aarch64/bits/endian.h deleted file mode 100644 index 7a74d2f..0000000 --- a/libc-top-half/musl/arch/aarch64/bits/endian.h +++ /dev/null @@ -1,5 +0,0 @@ -#if __AARCH64EB__ -#define __BYTE_ORDER __BIG_ENDIAN -#else -#define __BYTE_ORDER __LITTLE_ENDIAN -#endif diff --git a/libc-top-half/musl/arch/aarch64/bits/limits.h b/libc-top-half/musl/arch/aarch64/bits/limits.h deleted file mode 100644 index 0226588..0000000 --- a/libc-top-half/musl/arch/aarch64/bits/limits.h +++ /dev/null @@ -1,7 +0,0 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define LONG_BIT 64 -#endif - -#define LONG_MAX 0x7fffffffffffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/aarch64/bits/socket.h b/libc-top-half/musl/arch/aarch64/bits/socket.h deleted file mode 100644 index c11677e..0000000 --- a/libc-top-half/musl/arch/aarch64/bits/socket.h +++ /dev/null @@ -1,33 +0,0 @@ -#include - -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; -#if __BYTE_ORDER == __BIG_ENDIAN - int __pad1, msg_iovlen; -#else - int msg_iovlen, __pad1; -#endif - void *msg_control; -#if __BYTE_ORDER == __BIG_ENDIAN - int __pad2; - socklen_t msg_controllen; -#else - socklen_t msg_controllen; - int __pad2; -#endif - int msg_flags; -}; - -struct cmsghdr { -#if __BYTE_ORDER == __BIG_ENDIAN - int __pad1; - socklen_t cmsg_len; -#else - socklen_t cmsg_len; - int __pad1; -#endif - int cmsg_level; - int cmsg_type; -}; diff --git a/libc-top-half/musl/arch/aarch64/bits/syscall.h.in b/libc-top-half/musl/arch/aarch64/bits/syscall.h.in index 955e2ca..93648af 100644 --- a/libc-top-half/musl/arch/aarch64/bits/syscall.h.in +++ b/libc-top-half/musl/arch/aarch64/bits/syscall.h.in @@ -287,4 +287,6 @@ #define __NR_fsconfig 431 #define __NR_fsmount 432 #define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 diff --git a/libc-top-half/musl/arch/aarch64/reloc.h b/libc-top-half/musl/arch/aarch64/reloc.h index 40cf0b2..b1b68c7 100644 --- a/libc-top-half/musl/arch/aarch64/reloc.h +++ b/libc-top-half/musl/arch/aarch64/reloc.h @@ -1,5 +1,3 @@ -#include - #if __BYTE_ORDER == __BIG_ENDIAN #define ENDIAN_SUFFIX "_be" #else diff --git a/libc-top-half/musl/arch/arm/arch.mak b/libc-top-half/musl/arch/arm/arch.mak new file mode 100644 index 0000000..aa4d05c --- /dev/null +++ b/libc-top-half/musl/arch/arm/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/libc-top-half/musl/arch/arm/bits/alltypes.h.in b/libc-top-half/musl/arch/arm/bits/alltypes.h.in index 667963c..d62bd7b 100644 --- a/libc-top-half/musl/arch/arm/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/arm/bits/alltypes.h.in @@ -1,9 +1,15 @@ +#define _REDIR_TIME64 1 #define _Addr int #define _Int64 long long #define _Reg int -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#if __ARMEB__ +#define __BYTE_ORDER 4321 +#else +#define __BYTE_ORDER 1234 +#endif + +#define __LONG_MAX 0x7fffffffL #ifndef __cplusplus TYPEDEF unsigned wchar_t; @@ -13,14 +19,3 @@ TYPEDEF float float_t; TYPEDEF double double_t; TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/arm/bits/endian.h b/libc-top-half/musl/arch/arm/bits/endian.h deleted file mode 100644 index 5953724..0000000 --- a/libc-top-half/musl/arch/arm/bits/endian.h +++ /dev/null @@ -1,5 +0,0 @@ -#if __ARMEB__ -#define __BYTE_ORDER __BIG_ENDIAN -#else -#define __BYTE_ORDER __LITTLE_ENDIAN -#endif diff --git a/libc-top-half/musl/arch/arm/bits/ipcstat.h b/libc-top-half/musl/arch/arm/bits/ipcstat.h index 0018ad1..4f4fcb0 100644 --- a/libc-top-half/musl/arch/arm/bits/ipcstat.h +++ b/libc-top-half/musl/arch/arm/bits/ipcstat.h @@ -1 +1 @@ -#define IPC_STAT 2 +#define IPC_STAT 0x102 diff --git a/libc-top-half/musl/arch/arm/bits/limits.h b/libc-top-half/musl/arch/arm/bits/limits.h deleted file mode 100644 index fbc6d23..0000000 --- a/libc-top-half/musl/arch/arm/bits/limits.h +++ /dev/null @@ -1,7 +0,0 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define LONG_BIT 32 -#endif - -#define LONG_MAX 0x7fffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/arm/bits/msg.h b/libc-top-half/musl/arch/arm/bits/msg.h index bc8436c..7bbbb2b 100644 --- a/libc-top-half/musl/arch/arm/bits/msg.h +++ b/libc-top-half/musl/arch/arm/bits/msg.h @@ -1,15 +1,18 @@ struct msqid_ds { struct ipc_perm msg_perm; - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; + unsigned long __msg_stime_lo; + unsigned long __msg_stime_hi; + unsigned long __msg_rtime_lo; + unsigned long __msg_rtime_hi; + unsigned long __msg_ctime_lo; + unsigned long __msg_ctime_hi; unsigned long msg_cbytes; msgqnum_t msg_qnum; msglen_t msg_qbytes; pid_t msg_lspid; pid_t msg_lrpid; unsigned long __unused[2]; + time_t msg_stime; + time_t msg_rtime; + time_t msg_ctime; }; diff --git a/libc-top-half/musl/arch/arm/bits/sem.h b/libc-top-half/musl/arch/arm/bits/sem.h index d383d4e..544e3d2 100644 --- a/libc-top-half/musl/arch/arm/bits/sem.h +++ b/libc-top-half/musl/arch/arm/bits/sem.h @@ -1,9 +1,9 @@ struct semid_ds { struct ipc_perm sem_perm; - time_t sem_otime; - long __unused1; - time_t sem_ctime; - long __unused2; + unsigned long __sem_otime_lo; + unsigned long __sem_otime_hi; + unsigned long __sem_ctime_lo; + unsigned long __sem_ctime_hi; #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned short sem_nsems; char __sem_nsems_pad[sizeof(long)-sizeof(short)]; @@ -13,4 +13,6 @@ struct semid_ds { #endif long __unused3; long __unused4; + time_t sem_otime; + time_t sem_ctime; }; diff --git a/libc-top-half/musl/arch/arm/bits/shm.h b/libc-top-half/musl/arch/arm/bits/shm.h index 81b2a29..725fb46 100644 --- a/libc-top-half/musl/arch/arm/bits/shm.h +++ b/libc-top-half/musl/arch/arm/bits/shm.h @@ -3,17 +3,21 @@ struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; - time_t shm_atime; - int __unused1; - time_t shm_dtime; - int __unused2; - time_t shm_ctime; - int __unused3; + unsigned long __shm_atime_lo; + unsigned long __shm_atime_hi; + unsigned long __shm_dtime_lo; + unsigned long __shm_dtime_hi; + unsigned long __shm_ctime_lo; + unsigned long __shm_ctime_hi; pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; unsigned long __pad1; unsigned long __pad2; + unsigned long __pad3; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; }; struct shminfo { diff --git a/libc-top-half/musl/arch/arm/bits/stat.h b/libc-top-half/musl/arch/arm/bits/stat.h index 22b19bb..5d7828c 100644 --- a/libc-top-half/musl/arch/arm/bits/stat.h +++ b/libc-top-half/musl/arch/arm/bits/stat.h @@ -14,8 +14,12 @@ struct stat { off_t st_size; blksize_t st_blksize; blkcnt_t st_blocks; + struct { + long tv_sec; + long tv_nsec; + } __st_atim32, __st_mtim32, __st_ctim32; + ino_t st_ino; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; - ino_t st_ino; }; diff --git a/libc-top-half/musl/arch/arm/bits/syscall.h.in b/libc-top-half/musl/arch/arm/bits/syscall.h.in index a565a4e..11d6776 100644 --- a/libc-top-half/musl/arch/arm/bits/syscall.h.in +++ b/libc-top-half/musl/arch/arm/bits/syscall.h.in @@ -55,8 +55,8 @@ #define __NR_sethostname 74 #define __NR_setrlimit 75 #define __NR_getrusage 77 -#define __NR_gettimeofday 78 -#define __NR_settimeofday 79 +#define __NR_gettimeofday_time32 78 +#define __NR_settimeofday_time32 79 #define __NR_getgroups 80 #define __NR_setgroups 81 #define __NR_symlink 83 @@ -211,14 +211,14 @@ #define __NR_remap_file_pages 253 #define __NR_set_tid_address 256 #define __NR_timer_create 257 -#define __NR_timer_settime 258 -#define __NR_timer_gettime 259 +#define __NR_timer_settime32 258 +#define __NR_timer_gettime32 259 #define __NR_timer_getoverrun 260 #define __NR_timer_delete 261 -#define __NR_clock_settime 262 -#define __NR_clock_gettime 263 -#define __NR_clock_getres 264 -#define __NR_clock_nanosleep 265 +#define __NR_clock_settime32 262 +#define __NR_clock_gettime32 263 +#define __NR_clock_getres_time32 264 +#define __NR_clock_nanosleep_time32 265 #define __NR_statfs64 266 #define __NR_fstatfs64 267 #define __NR_tgkill 268 @@ -308,8 +308,8 @@ #define __NR_timerfd_create 350 #define __NR_eventfd 351 #define __NR_fallocate 352 -#define __NR_timerfd_settime 353 -#define __NR_timerfd_gettime 354 +#define __NR_timerfd_settime32 353 +#define __NR_timerfd_gettime32 354 #define __NR_signalfd4 355 #define __NR_eventfd2 356 #define __NR_epoll_create1 357 @@ -387,6 +387,8 @@ #define __NR_fsconfig 431 #define __NR_fsmount 432 #define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 #define __ARM_NR_breakpoint 0x0f0001 #define __ARM_NR_cacheflush 0x0f0002 diff --git a/libc-top-half/musl/arch/arm/reloc.h b/libc-top-half/musl/arch/arm/reloc.h index 2c2e7f5..d091d2a 100644 --- a/libc-top-half/musl/arch/arm/reloc.h +++ b/libc-top-half/musl/arch/arm/reloc.h @@ -1,5 +1,3 @@ -#include - #if __BYTE_ORDER == __BIG_ENDIAN #define ENDIAN_SUFFIX "eb" #else diff --git a/libc-top-half/musl/arch/arm/syscall_arch.h b/libc-top-half/musl/arch/arm/syscall_arch.h index 53fb155..4b08762 100644 --- a/libc-top-half/musl/arch/arm/syscall_arch.h +++ b/libc-top-half/musl/arch/arm/syscall_arch.h @@ -99,7 +99,9 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo } #define VDSO_USEFUL -#define VDSO_CGT_SYM "__vdso_clock_gettime" +#define VDSO_CGT32_SYM "__vdso_clock_gettime" +#define VDSO_CGT32_VER "LINUX_2.6" +#define VDSO_CGT_SYM "__vdso_clock_gettime64" #define VDSO_CGT_VER "LINUX_2.6" #define SYSCALL_FADVISE_6_ARG diff --git a/libc-top-half/musl/arch/generic/bits/dirent.h b/libc-top-half/musl/arch/generic/bits/dirent.h new file mode 100644 index 0000000..c845fe8 --- /dev/null +++ b/libc-top-half/musl/arch/generic/bits/dirent.h @@ -0,0 +1,11 @@ +#define _DIRENT_HAVE_D_RECLEN +#define _DIRENT_HAVE_D_OFF +#define _DIRENT_HAVE_D_TYPE + +struct dirent { + ino_t d_ino; + off_t d_off; + unsigned short d_reclen; + unsigned char d_type; + char d_name[256]; +}; diff --git a/libc-top-half/musl/arch/generic/bits/ioctl.h b/libc-top-half/musl/arch/generic/bits/ioctl.h index d1a6c03..60ae8b8 100644 --- a/libc-top-half/musl/arch/generic/bits/ioctl.h +++ b/libc-top-half/musl/arch/generic/bits/ioctl.h @@ -104,7 +104,12 @@ #define FIOGETOWN 0x8903 #define SIOCGPGRP 0x8904 #define SIOCATMARK 0x8905 +#if __LONG_MAX == 0x7fffffff +#define SIOCGSTAMP _IOR(0x89, 6, char[16]) +#define SIOCGSTAMPNS _IOR(0x89, 7, char[16]) +#else #define SIOCGSTAMP 0x8906 #define SIOCGSTAMPNS 0x8907 +#endif #include diff --git a/libc-top-half/musl/arch/generic/bits/limits.h b/libc-top-half/musl/arch/generic/bits/limits.h new file mode 100644 index 0000000..e69de29 diff --git a/libc-top-half/musl/arch/generic/bits/socket.h b/libc-top-half/musl/arch/generic/bits/socket.h index 1f73b99..e69de29 100644 --- a/libc-top-half/musl/arch/generic/bits/socket.h +++ b/libc-top-half/musl/arch/generic/bits/socket.h @@ -1,15 +0,0 @@ -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen; - void *msg_control; - socklen_t msg_controllen; - int msg_flags; -}; - -struct cmsghdr { - socklen_t cmsg_len; - int cmsg_level; - int cmsg_type; -}; diff --git a/libc-top-half/musl/arch/i386/arch.mak b/libc-top-half/musl/arch/i386/arch.mak new file mode 100644 index 0000000..aa4d05c --- /dev/null +++ b/libc-top-half/musl/arch/i386/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/libc-top-half/musl/arch/i386/bits/alltypes.h.in b/libc-top-half/musl/arch/i386/bits/alltypes.h.in index 1a8432d..6feb03a 100644 --- a/libc-top-half/musl/arch/i386/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/i386/bits/alltypes.h.in @@ -1,14 +1,10 @@ +#define _REDIR_TIME64 1 #define _Addr int #define _Int64 long long #define _Reg int -#if __GNUC__ >= 3 -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; -#else -TYPEDEF struct __va_list * va_list; -TYPEDEF struct __va_list * __isoc_va_list; -#endif +#define __BYTE_ORDER 1234 +#define __LONG_MAX 0x7fffffffL #ifndef __cplusplus #ifdef __WCHAR_TYPE__ @@ -33,14 +29,3 @@ TYPEDEF struct { __attribute__((__aligned__(8))) long long __ll; long double __l #else TYPEDEF struct { alignas(8) long long __ll; long double __ld; } max_align_t; #endif - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/i386/bits/endian.h b/libc-top-half/musl/arch/i386/bits/endian.h deleted file mode 100644 index 172c338..0000000 --- a/libc-top-half/musl/arch/i386/bits/endian.h +++ /dev/null @@ -1 +0,0 @@ -#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/libc-top-half/musl/arch/i386/bits/ipcstat.h b/libc-top-half/musl/arch/i386/bits/ipcstat.h index 0018ad1..4f4fcb0 100644 --- a/libc-top-half/musl/arch/i386/bits/ipcstat.h +++ b/libc-top-half/musl/arch/i386/bits/ipcstat.h @@ -1 +1 @@ -#define IPC_STAT 2 +#define IPC_STAT 0x102 diff --git a/libc-top-half/musl/arch/i386/bits/limits.h b/libc-top-half/musl/arch/i386/bits/limits.h index c340ceb..07743b6 100644 --- a/libc-top-half/musl/arch/i386/bits/limits.h +++ b/libc-top-half/musl/arch/i386/bits/limits.h @@ -1,8 +1 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define PAGESIZE 4096 -#define LONG_BIT 32 -#endif - -#define LONG_MAX 0x7fffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/i386/bits/msg.h b/libc-top-half/musl/arch/i386/bits/msg.h index bc8436c..7bbbb2b 100644 --- a/libc-top-half/musl/arch/i386/bits/msg.h +++ b/libc-top-half/musl/arch/i386/bits/msg.h @@ -1,15 +1,18 @@ struct msqid_ds { struct ipc_perm msg_perm; - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; + unsigned long __msg_stime_lo; + unsigned long __msg_stime_hi; + unsigned long __msg_rtime_lo; + unsigned long __msg_rtime_hi; + unsigned long __msg_ctime_lo; + unsigned long __msg_ctime_hi; unsigned long msg_cbytes; msgqnum_t msg_qnum; msglen_t msg_qbytes; pid_t msg_lspid; pid_t msg_lrpid; unsigned long __unused[2]; + time_t msg_stime; + time_t msg_rtime; + time_t msg_ctime; }; diff --git a/libc-top-half/musl/arch/i386/bits/sem.h b/libc-top-half/musl/arch/i386/bits/sem.h index e61571c..6566154 100644 --- a/libc-top-half/musl/arch/i386/bits/sem.h +++ b/libc-top-half/musl/arch/i386/bits/sem.h @@ -1,11 +1,13 @@ struct semid_ds { struct ipc_perm sem_perm; - time_t sem_otime; - long __unused1; - time_t sem_ctime; - long __unused2; + unsigned long __sem_otime_lo; + unsigned long __sem_otime_hi; + unsigned long __sem_ctime_lo; + unsigned long __sem_ctime_hi; unsigned short sem_nsems; char __sem_nsems_pad[sizeof(long)-sizeof(short)]; long __unused3; long __unused4; + time_t sem_otime; + time_t sem_ctime; }; diff --git a/libc-top-half/musl/arch/i386/bits/shm.h b/libc-top-half/musl/arch/i386/bits/shm.h index 81b2a29..725fb46 100644 --- a/libc-top-half/musl/arch/i386/bits/shm.h +++ b/libc-top-half/musl/arch/i386/bits/shm.h @@ -3,17 +3,21 @@ struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; - time_t shm_atime; - int __unused1; - time_t shm_dtime; - int __unused2; - time_t shm_ctime; - int __unused3; + unsigned long __shm_atime_lo; + unsigned long __shm_atime_hi; + unsigned long __shm_dtime_lo; + unsigned long __shm_dtime_hi; + unsigned long __shm_ctime_lo; + unsigned long __shm_ctime_hi; pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; unsigned long __pad1; unsigned long __pad2; + unsigned long __pad3; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; }; struct shminfo { diff --git a/libc-top-half/musl/arch/i386/bits/stat.h b/libc-top-half/musl/arch/i386/bits/stat.h index 22b19bb..5d7828c 100644 --- a/libc-top-half/musl/arch/i386/bits/stat.h +++ b/libc-top-half/musl/arch/i386/bits/stat.h @@ -14,8 +14,12 @@ struct stat { off_t st_size; blksize_t st_blksize; blkcnt_t st_blocks; + struct { + long tv_sec; + long tv_nsec; + } __st_atim32, __st_mtim32, __st_ctim32; + ino_t st_ino; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; - ino_t st_ino; }; diff --git a/libc-top-half/musl/arch/i386/bits/syscall.h.in b/libc-top-half/musl/arch/i386/bits/syscall.h.in index c95e108..1ae4e48 100644 --- a/libc-top-half/musl/arch/i386/bits/syscall.h.in +++ b/libc-top-half/musl/arch/i386/bits/syscall.h.in @@ -76,8 +76,8 @@ #define __NR_setrlimit 75 #define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */ #define __NR_getrusage 77 -#define __NR_gettimeofday 78 -#define __NR_settimeofday 79 +#define __NR_gettimeofday_time32 78 +#define __NR_settimeofday_time32 79 #define __NR_getgroups 80 #define __NR_setgroups 81 #define __NR_select 82 @@ -257,14 +257,14 @@ #define __NR_remap_file_pages 257 #define __NR_set_tid_address 258 #define __NR_timer_create 259 -#define __NR_timer_settime (__NR_timer_create+1) -#define __NR_timer_gettime (__NR_timer_create+2) +#define __NR_timer_settime32 (__NR_timer_create+1) +#define __NR_timer_gettime32 (__NR_timer_create+2) #define __NR_timer_getoverrun (__NR_timer_create+3) #define __NR_timer_delete (__NR_timer_create+4) -#define __NR_clock_settime (__NR_timer_create+5) -#define __NR_clock_gettime (__NR_timer_create+6) -#define __NR_clock_getres (__NR_timer_create+7) -#define __NR_clock_nanosleep (__NR_timer_create+8) +#define __NR_clock_settime32 (__NR_timer_create+5) +#define __NR_clock_gettime32 (__NR_timer_create+6) +#define __NR_clock_getres_time32 (__NR_timer_create+7) +#define __NR_clock_nanosleep_time32 (__NR_timer_create+8) #define __NR_statfs64 268 #define __NR_fstatfs64 269 #define __NR_tgkill 270 @@ -322,8 +322,8 @@ #define __NR_timerfd_create 322 #define __NR_eventfd 323 #define __NR_fallocate 324 -#define __NR_timerfd_settime 325 -#define __NR_timerfd_gettime 326 +#define __NR_timerfd_settime32 325 +#define __NR_timerfd_gettime32 326 #define __NR_signalfd4 327 #define __NR_eventfd2 328 #define __NR_epoll_create1 329 @@ -424,4 +424,6 @@ #define __NR_fsconfig 431 #define __NR_fsmount 432 #define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 diff --git a/libc-top-half/musl/arch/i386/syscall_arch.h b/libc-top-half/musl/arch/i386/syscall_arch.h index 22b0b28..69642e5 100644 --- a/libc-top-half/musl/arch/i386/syscall_arch.h +++ b/libc-top-half/musl/arch/i386/syscall_arch.h @@ -83,7 +83,9 @@ static inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a } #define VDSO_USEFUL -#define VDSO_CGT_SYM "__vdso_clock_gettime" +#define VDSO_CGT32_SYM "__vdso_clock_gettime" +#define VDSO_CGT32_VER "LINUX_2.6" +#define VDSO_CGT_SYM "__vdso_clock_gettime64" #define VDSO_CGT_VER "LINUX_2.6" #define SYSCALL_USE_SOCKETCALL diff --git a/libc-top-half/musl/arch/m68k/arch.mak b/libc-top-half/musl/arch/m68k/arch.mak new file mode 100644 index 0000000..aa4d05c --- /dev/null +++ b/libc-top-half/musl/arch/m68k/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/libc-top-half/musl/arch/m68k/bits/alltypes.h.in b/libc-top-half/musl/arch/m68k/bits/alltypes.h.in index bd37a63..f564690 100644 --- a/libc-top-half/musl/arch/m68k/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/m68k/bits/alltypes.h.in @@ -1,9 +1,10 @@ +#define _REDIR_TIME64 1 #define _Addr int #define _Int64 long long #define _Reg int -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#define __BYTE_ORDER 4321 +#define __LONG_MAX 0x7fffffffL #ifndef __cplusplus #ifdef __WCHAR_TYPE__ @@ -22,14 +23,3 @@ TYPEDEF long double double_t; #endif TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/m68k/bits/endian.h b/libc-top-half/musl/arch/m68k/bits/endian.h deleted file mode 100644 index ef074b7..0000000 --- a/libc-top-half/musl/arch/m68k/bits/endian.h +++ /dev/null @@ -1 +0,0 @@ -#define __BYTE_ORDER __BIG_ENDIAN diff --git a/libc-top-half/musl/arch/m68k/bits/ipcstat.h b/libc-top-half/musl/arch/m68k/bits/ipcstat.h index 0018ad1..4f4fcb0 100644 --- a/libc-top-half/musl/arch/m68k/bits/ipcstat.h +++ b/libc-top-half/musl/arch/m68k/bits/ipcstat.h @@ -1 +1 @@ -#define IPC_STAT 2 +#define IPC_STAT 0x102 diff --git a/libc-top-half/musl/arch/m68k/bits/limits.h b/libc-top-half/musl/arch/m68k/bits/limits.h deleted file mode 100644 index fbc6d23..0000000 --- a/libc-top-half/musl/arch/m68k/bits/limits.h +++ /dev/null @@ -1,7 +0,0 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define LONG_BIT 32 -#endif - -#define LONG_MAX 0x7fffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/m68k/bits/msg.h b/libc-top-half/musl/arch/m68k/bits/msg.h index bc8436c..7bbbb2b 100644 --- a/libc-top-half/musl/arch/m68k/bits/msg.h +++ b/libc-top-half/musl/arch/m68k/bits/msg.h @@ -1,15 +1,18 @@ struct msqid_ds { struct ipc_perm msg_perm; - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; + unsigned long __msg_stime_lo; + unsigned long __msg_stime_hi; + unsigned long __msg_rtime_lo; + unsigned long __msg_rtime_hi; + unsigned long __msg_ctime_lo; + unsigned long __msg_ctime_hi; unsigned long msg_cbytes; msgqnum_t msg_qnum; msglen_t msg_qbytes; pid_t msg_lspid; pid_t msg_lrpid; unsigned long __unused[2]; + time_t msg_stime; + time_t msg_rtime; + time_t msg_ctime; }; diff --git a/libc-top-half/musl/arch/m68k/bits/sem.h b/libc-top-half/musl/arch/m68k/bits/sem.h index 08faafe..d88338e 100644 --- a/libc-top-half/musl/arch/m68k/bits/sem.h +++ b/libc-top-half/musl/arch/m68k/bits/sem.h @@ -1,11 +1,13 @@ struct semid_ds { struct ipc_perm sem_perm; - time_t sem_otime; - long __unused1; - time_t sem_ctime; - long __unused2; + unsigned long __sem_otime_lo; + unsigned long __sem_otime_hi; + unsigned long __sem_ctime_lo; + unsigned long __sem_ctime_hi; char __sem_nsems_pad[sizeof(long)-sizeof(short)]; unsigned short sem_nsems; long __unused3; long __unused4; + time_t sem_otime; + time_t sem_ctime; }; diff --git a/libc-top-half/musl/arch/m68k/bits/shm.h b/libc-top-half/musl/arch/m68k/bits/shm.h index 81b2a29..725fb46 100644 --- a/libc-top-half/musl/arch/m68k/bits/shm.h +++ b/libc-top-half/musl/arch/m68k/bits/shm.h @@ -3,17 +3,21 @@ struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; - time_t shm_atime; - int __unused1; - time_t shm_dtime; - int __unused2; - time_t shm_ctime; - int __unused3; + unsigned long __shm_atime_lo; + unsigned long __shm_atime_hi; + unsigned long __shm_dtime_lo; + unsigned long __shm_dtime_hi; + unsigned long __shm_ctime_lo; + unsigned long __shm_ctime_hi; pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; unsigned long __pad1; unsigned long __pad2; + unsigned long __pad3; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; }; struct shminfo { diff --git a/libc-top-half/musl/arch/m68k/bits/stat.h b/libc-top-half/musl/arch/m68k/bits/stat.h index 0f7b66a..f876814 100644 --- a/libc-top-half/musl/arch/m68k/bits/stat.h +++ b/libc-top-half/musl/arch/m68k/bits/stat.h @@ -14,8 +14,12 @@ struct stat { off_t st_size; blksize_t st_blksize; blkcnt_t st_blocks; + struct { + long tv_sec; + long tv_nsec; + } __st_atim32, __st_mtim32, __st_ctim32; + ino_t st_ino; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; - ino_t st_ino; }; diff --git a/libc-top-half/musl/arch/m68k/bits/syscall.h.in b/libc-top-half/musl/arch/m68k/bits/syscall.h.in index fb522b4..ddfa72e 100644 --- a/libc-top-half/musl/arch/m68k/bits/syscall.h.in +++ b/libc-top-half/musl/arch/m68k/bits/syscall.h.in @@ -67,8 +67,8 @@ #define __NR_setrlimit 75 #define __NR_getrlimit 76 #define __NR_getrusage 77 -#define __NR_gettimeofday 78 -#define __NR_settimeofday 79 +#define __NR_gettimeofday_time32 78 +#define __NR_settimeofday_time32 79 #define __NR_getgroups 80 #define __NR_setgroups 81 #define __NR_select 82 @@ -235,14 +235,14 @@ #define __NR_remap_file_pages 252 #define __NR_set_tid_address 253 #define __NR_timer_create 254 -#define __NR_timer_settime 255 -#define __NR_timer_gettime 256 +#define __NR_timer_settime32 255 +#define __NR_timer_gettime32 256 #define __NR_timer_getoverrun 257 #define __NR_timer_delete 258 -#define __NR_clock_settime 259 -#define __NR_clock_gettime 260 -#define __NR_clock_getres 261 -#define __NR_clock_nanosleep 262 +#define __NR_clock_settime32 259 +#define __NR_clock_gettime32 260 +#define __NR_clock_getres_time32 261 +#define __NR_clock_nanosleep_time32 262 #define __NR_statfs64 263 #define __NR_fstatfs64 264 #define __NR_tgkill 265 @@ -300,8 +300,8 @@ #define __NR_timerfd_create 318 #define __NR_eventfd 319 #define __NR_fallocate 320 -#define __NR_timerfd_settime 321 -#define __NR_timerfd_gettime 322 +#define __NR_timerfd_settime32 321 +#define __NR_timerfd_gettime32 322 #define __NR_signalfd4 323 #define __NR_eventfd2 324 #define __NR_epoll_create1 325 @@ -404,3 +404,4 @@ #define __NR_fsconfig 431 #define __NR_fsmount 432 #define __NR_fspick 433 +#define __NR_pidfd_open 434 diff --git a/libc-top-half/musl/arch/m68k/bits/user.h b/libc-top-half/musl/arch/m68k/bits/user.h index 9a4ca12..6a44391 100644 --- a/libc-top-half/musl/arch/m68k/bits/user.h +++ b/libc-top-half/musl/arch/m68k/bits/user.h @@ -27,6 +27,11 @@ struct user { char u_comm[32]; }; +#define ELF_NGREG 20 +typedef unsigned long elf_greg_t; +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; +typedef struct user_m68kfp_struct elf_fpregset_t; + #define NBPG 4096 #define UPAGES 1 #define HOST_TEXT_START_ADDR (u.start_code) diff --git a/libc-top-half/musl/arch/microblaze/arch.mak b/libc-top-half/musl/arch/microblaze/arch.mak new file mode 100644 index 0000000..aa4d05c --- /dev/null +++ b/libc-top-half/musl/arch/microblaze/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/libc-top-half/musl/arch/microblaze/bits/alltypes.h.in b/libc-top-half/musl/arch/microblaze/bits/alltypes.h.in index 66ca18a..9a4ce29 100644 --- a/libc-top-half/musl/arch/microblaze/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/microblaze/bits/alltypes.h.in @@ -1,9 +1,15 @@ +#define _REDIR_TIME64 1 #define _Addr int #define _Int64 long long #define _Reg int -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#if __MICROBLAZEEL__ +#define __BYTE_ORDER 1234 +#else +#define __BYTE_ORDER 4321 +#endif + +#define __LONG_MAX 0x7fffffffL #ifndef __cplusplus TYPEDEF int wchar_t; @@ -13,14 +19,3 @@ TYPEDEF float float_t; TYPEDEF double double_t; TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/microblaze/bits/endian.h b/libc-top-half/musl/arch/microblaze/bits/endian.h deleted file mode 100644 index d82a92a..0000000 --- a/libc-top-half/musl/arch/microblaze/bits/endian.h +++ /dev/null @@ -1,5 +0,0 @@ -#if __MICROBLAZEEL__ -#define __BYTE_ORDER __LITTLE_ENDIAN -#else -#define __BYTE_ORDER __BIG_ENDIAN -#endif diff --git a/libc-top-half/musl/arch/microblaze/bits/ipcstat.h b/libc-top-half/musl/arch/microblaze/bits/ipcstat.h index 0018ad1..4f4fcb0 100644 --- a/libc-top-half/musl/arch/microblaze/bits/ipcstat.h +++ b/libc-top-half/musl/arch/microblaze/bits/ipcstat.h @@ -1 +1 @@ -#define IPC_STAT 2 +#define IPC_STAT 0x102 diff --git a/libc-top-half/musl/arch/microblaze/bits/limits.h b/libc-top-half/musl/arch/microblaze/bits/limits.h deleted file mode 100644 index fbc6d23..0000000 --- a/libc-top-half/musl/arch/microblaze/bits/limits.h +++ /dev/null @@ -1,7 +0,0 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define LONG_BIT 32 -#endif - -#define LONG_MAX 0x7fffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/microblaze/bits/msg.h b/libc-top-half/musl/arch/microblaze/bits/msg.h index bc8436c..7bbbb2b 100644 --- a/libc-top-half/musl/arch/microblaze/bits/msg.h +++ b/libc-top-half/musl/arch/microblaze/bits/msg.h @@ -1,15 +1,18 @@ struct msqid_ds { struct ipc_perm msg_perm; - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; + unsigned long __msg_stime_lo; + unsigned long __msg_stime_hi; + unsigned long __msg_rtime_lo; + unsigned long __msg_rtime_hi; + unsigned long __msg_ctime_lo; + unsigned long __msg_ctime_hi; unsigned long msg_cbytes; msgqnum_t msg_qnum; msglen_t msg_qbytes; pid_t msg_lspid; pid_t msg_lrpid; unsigned long __unused[2]; + time_t msg_stime; + time_t msg_rtime; + time_t msg_ctime; }; diff --git a/libc-top-half/musl/arch/microblaze/bits/sem.h b/libc-top-half/musl/arch/microblaze/bits/sem.h index d383d4e..544e3d2 100644 --- a/libc-top-half/musl/arch/microblaze/bits/sem.h +++ b/libc-top-half/musl/arch/microblaze/bits/sem.h @@ -1,9 +1,9 @@ struct semid_ds { struct ipc_perm sem_perm; - time_t sem_otime; - long __unused1; - time_t sem_ctime; - long __unused2; + unsigned long __sem_otime_lo; + unsigned long __sem_otime_hi; + unsigned long __sem_ctime_lo; + unsigned long __sem_ctime_hi; #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned short sem_nsems; char __sem_nsems_pad[sizeof(long)-sizeof(short)]; @@ -13,4 +13,6 @@ struct semid_ds { #endif long __unused3; long __unused4; + time_t sem_otime; + time_t sem_ctime; }; diff --git a/libc-top-half/musl/arch/microblaze/bits/shm.h b/libc-top-half/musl/arch/microblaze/bits/shm.h index 81b2a29..725fb46 100644 --- a/libc-top-half/musl/arch/microblaze/bits/shm.h +++ b/libc-top-half/musl/arch/microblaze/bits/shm.h @@ -3,17 +3,21 @@ struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; - time_t shm_atime; - int __unused1; - time_t shm_dtime; - int __unused2; - time_t shm_ctime; - int __unused3; + unsigned long __shm_atime_lo; + unsigned long __shm_atime_hi; + unsigned long __shm_dtime_lo; + unsigned long __shm_dtime_hi; + unsigned long __shm_ctime_lo; + unsigned long __shm_ctime_hi; pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; unsigned long __pad1; unsigned long __pad2; + unsigned long __pad3; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; }; struct shminfo { diff --git a/libc-top-half/musl/arch/microblaze/bits/stat.h b/libc-top-half/musl/arch/microblaze/bits/stat.h index ce6a6bd..8a4d509 100644 --- a/libc-top-half/musl/arch/microblaze/bits/stat.h +++ b/libc-top-half/musl/arch/microblaze/bits/stat.h @@ -14,8 +14,12 @@ struct stat { blksize_t st_blksize; int __st_blksize_padding; blkcnt_t st_blocks; + struct { + long tv_sec; + long tv_nsec; + } __st_atim32, __st_mtim32, __st_ctim32; + unsigned __unused[2]; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; - unsigned __unused[2]; }; diff --git a/libc-top-half/musl/arch/microblaze/bits/syscall.h.in b/libc-top-half/musl/arch/microblaze/bits/syscall.h.in index 59f8623..963386a 100644 --- a/libc-top-half/musl/arch/microblaze/bits/syscall.h.in +++ b/libc-top-half/musl/arch/microblaze/bits/syscall.h.in @@ -76,8 +76,8 @@ #define __NR_setrlimit 75 #define __NR_getrlimit 76 #define __NR_getrusage 77 -#define __NR_gettimeofday 78 -#define __NR_settimeofday 79 +#define __NR_gettimeofday_time32 78 +#define __NR_settimeofday_time32 79 #define __NR_getgroups 80 #define __NR_setgroups 81 #define __NR_select 82 @@ -255,14 +255,14 @@ #define __NR_remap_file_pages 257 #define __NR_set_tid_address 258 #define __NR_timer_create 259 -#define __NR_timer_settime 260 -#define __NR_timer_gettime 261 +#define __NR_timer_settime32 260 +#define __NR_timer_gettime32 261 #define __NR_timer_getoverrun 262 #define __NR_timer_delete 263 -#define __NR_clock_settime 264 -#define __NR_clock_gettime 265 -#define __NR_clock_getres 266 -#define __NR_clock_nanosleep 267 +#define __NR_clock_settime32 264 +#define __NR_clock_gettime32 265 +#define __NR_clock_getres_time32 266 +#define __NR_clock_nanosleep_time32 267 #define __NR_statfs64 268 #define __NR_fstatfs64 269 #define __NR_tgkill 270 @@ -320,8 +320,8 @@ #define __NR_eventfd 323 #define __NR_fallocate 324 #define __NR_semtimedop 325 -#define __NR_timerfd_settime 326 -#define __NR_timerfd_gettime 327 +#define __NR_timerfd_settime32 326 +#define __NR_timerfd_gettime32 327 #define __NR_semctl 328 #define __NR_semget 329 #define __NR_semop 330 @@ -425,4 +425,6 @@ #define __NR_fsconfig 431 #define __NR_fsmount 432 #define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 diff --git a/libc-top-half/musl/arch/microblaze/reloc.h b/libc-top-half/musl/arch/microblaze/reloc.h index 0a030c7..6302c6e 100644 --- a/libc-top-half/musl/arch/microblaze/reloc.h +++ b/libc-top-half/musl/arch/microblaze/reloc.h @@ -1,5 +1,3 @@ -#include - #if __BYTE_ORDER == __LITTLE_ENDIAN #define ENDIAN_SUFFIX "el" #else diff --git a/libc-top-half/musl/arch/mips/arch.mak b/libc-top-half/musl/arch/mips/arch.mak new file mode 100644 index 0000000..aa4d05c --- /dev/null +++ b/libc-top-half/musl/arch/mips/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/libc-top-half/musl/arch/mips/bits/alltypes.h.in b/libc-top-half/musl/arch/mips/bits/alltypes.h.in index 66ca18a..ff934a4 100644 --- a/libc-top-half/musl/arch/mips/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/mips/bits/alltypes.h.in @@ -1,9 +1,15 @@ +#define _REDIR_TIME64 1 #define _Addr int #define _Int64 long long #define _Reg int -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#if _MIPSEL || __MIPSEL || __MIPSEL__ +#define __BYTE_ORDER 1234 +#else +#define __BYTE_ORDER 4321 +#endif + +#define __LONG_MAX 0x7fffffffL #ifndef __cplusplus TYPEDEF int wchar_t; @@ -13,14 +19,3 @@ TYPEDEF float float_t; TYPEDEF double double_t; TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/mips/bits/endian.h b/libc-top-half/musl/arch/mips/bits/endian.h deleted file mode 100644 index 5399dcb..0000000 --- a/libc-top-half/musl/arch/mips/bits/endian.h +++ /dev/null @@ -1,5 +0,0 @@ -#if _MIPSEL || __MIPSEL || __MIPSEL__ -#define __BYTE_ORDER __LITTLE_ENDIAN -#else -#define __BYTE_ORDER __BIG_ENDIAN -#endif diff --git a/libc-top-half/musl/arch/mips/bits/hwcap.h b/libc-top-half/musl/arch/mips/bits/hwcap.h index 13e86fe..7986deb 100644 --- a/libc-top-half/musl/arch/mips/bits/hwcap.h +++ b/libc-top-half/musl/arch/mips/bits/hwcap.h @@ -1,3 +1,14 @@ #define HWCAP_MIPS_R6 (1 << 0) #define HWCAP_MIPS_MSA (1 << 1) #define HWCAP_MIPS_CRC32 (1 << 2) +#define HWCAP_MIPS_MIPS16 (1 << 3) +#define HWCAP_MIPS_MDMX (1 << 4) +#define HWCAP_MIPS_MIPS3D (1 << 5) +#define HWCAP_MIPS_SMARTMIPS (1 << 6) +#define HWCAP_MIPS_DSP (1 << 7) +#define HWCAP_MIPS_DSP2 (1 << 8) +#define HWCAP_MIPS_DSP3 (1 << 9) +#define HWCAP_MIPS_MIPS16E2 (1 << 10) +#define HWCAP_LOONGSON_MMI (1 << 11) +#define HWCAP_LOONGSON_EXT (1 << 12) +#define HWCAP_LOONGSON_EXT2 (1 << 13) diff --git a/libc-top-half/musl/arch/mips/bits/ioctl.h b/libc-top-half/musl/arch/mips/bits/ioctl.h index e277c3f..e20bf19 100644 --- a/libc-top-half/musl/arch/mips/bits/ioctl.h +++ b/libc-top-half/musl/arch/mips/bits/ioctl.h @@ -110,5 +110,5 @@ #define SIOCATMARK _IOR('s', 7, int) #define SIOCSPGRP _IOW('s', 8, pid_t) #define SIOCGPGRP _IOR('s', 9, pid_t) -#define SIOCGSTAMP 0x8906 -#define SIOCGSTAMPNS 0x8907 +#define SIOCGSTAMP _IOR(0x89, 6, char[16]) +#define SIOCGSTAMPNS _IOR(0x89, 7, char[16]) diff --git a/libc-top-half/musl/arch/mips/bits/ipcstat.h b/libc-top-half/musl/arch/mips/bits/ipcstat.h index 0018ad1..4f4fcb0 100644 --- a/libc-top-half/musl/arch/mips/bits/ipcstat.h +++ b/libc-top-half/musl/arch/mips/bits/ipcstat.h @@ -1 +1 @@ -#define IPC_STAT 2 +#define IPC_STAT 0x102 diff --git a/libc-top-half/musl/arch/mips/bits/limits.h b/libc-top-half/musl/arch/mips/bits/limits.h deleted file mode 100644 index fbc6d23..0000000 --- a/libc-top-half/musl/arch/mips/bits/limits.h +++ /dev/null @@ -1,7 +0,0 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define LONG_BIT 32 -#endif - -#define LONG_MAX 0x7fffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/mips/bits/msg.h b/libc-top-half/musl/arch/mips/bits/msg.h index f28aece..c734dbb 100644 --- a/libc-top-half/musl/arch/mips/bits/msg.h +++ b/libc-top-half/musl/arch/mips/bits/msg.h @@ -1,19 +1,19 @@ struct msqid_ds { struct ipc_perm msg_perm; #if _MIPSEL || __MIPSEL || __MIPSEL__ - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; + unsigned long __msg_stime_lo; + unsigned long __msg_stime_hi; + unsigned long __msg_rtime_lo; + unsigned long __msg_rtime_hi; + unsigned long __msg_ctime_lo; + unsigned long __msg_ctime_hi; #else - int __unused1; - time_t msg_stime; - int __unused2; - time_t msg_rtime; - int __unused3; - time_t msg_ctime; + unsigned long __msg_stime_hi; + unsigned long __msg_stime_lo; + unsigned long __msg_rtime_hi; + unsigned long __msg_rtime_lo; + unsigned long __msg_ctime_hi; + unsigned long __msg_ctime_lo; #endif unsigned long msg_cbytes; msgqnum_t msg_qnum; @@ -21,4 +21,7 @@ struct msqid_ds { pid_t msg_lspid; pid_t msg_lrpid; unsigned long __unused[2]; + time_t msg_stime; + time_t msg_rtime; + time_t msg_ctime; }; diff --git a/libc-top-half/musl/arch/mips/bits/sem.h b/libc-top-half/musl/arch/mips/bits/sem.h index 5184eb5..fe6f094 100644 --- a/libc-top-half/musl/arch/mips/bits/sem.h +++ b/libc-top-half/musl/arch/mips/bits/sem.h @@ -1,7 +1,7 @@ struct semid_ds { struct ipc_perm sem_perm; - time_t sem_otime; - time_t sem_ctime; + unsigned long __sem_otime_lo; + unsigned long __sem_ctime_lo; #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned short sem_nsems; char __sem_nsems_pad[sizeof(long)-sizeof(short)]; @@ -9,6 +9,8 @@ struct semid_ds { char __sem_nsems_pad[sizeof(long)-sizeof(short)]; unsigned short sem_nsems; #endif - long __unused3; - long __unused4; + unsigned long __sem_otime_hi; + unsigned long __sem_ctime_hi; + time_t sem_otime; + time_t sem_ctime; }; diff --git a/libc-top-half/musl/arch/mips/bits/shm.h b/libc-top-half/musl/arch/mips/bits/shm.h index 8d19378..ab8c642 100644 --- a/libc-top-half/musl/arch/mips/bits/shm.h +++ b/libc-top-half/musl/arch/mips/bits/shm.h @@ -3,14 +3,19 @@ struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; - time_t shm_atime; - time_t shm_dtime; - time_t shm_ctime; + unsigned long __shm_atime_lo; + unsigned long __shm_dtime_lo; + unsigned long __shm_ctime_lo; pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; - unsigned long __pad1; - unsigned long __pad2; + unsigned short __shm_atime_hi; + unsigned short __shm_dtime_hi; + unsigned short __shm_ctime_hi; + unsigned short __pad1; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; }; struct shminfo { diff --git a/libc-top-half/musl/arch/mips/bits/signal.h b/libc-top-half/musl/arch/mips/bits/signal.h index 1a84de5..e1d97ac 100644 --- a/libc-top-half/musl/arch/mips/bits/signal.h +++ b/libc-top-half/musl/arch/mips/bits/signal.h @@ -19,14 +19,18 @@ typedef struct { } fpregset_t; struct sigcontext { unsigned sc_regmask, sc_status; - unsigned long long sc_pc, sc_regs[32], sc_fpregs[32]; + unsigned long long sc_pc; + gregset_t sc_regs; + fpregset_t sc_fpregs; unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp; unsigned long long sc_mdhi, sc_mdlo; unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3; }; typedef struct { unsigned regmask, status; - unsigned long long pc, gregs[32], fpregs[32]; + unsigned long long pc; + gregset_t gregs; + fpregset_t fpregs; unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp; unsigned long long mdhi, mdlo; unsigned long hi1, lo1, hi2, lo2, hi3, lo3; diff --git a/libc-top-half/musl/arch/mips/bits/socket.h b/libc-top-half/musl/arch/mips/bits/socket.h index b82c7d3..02fbb88 100644 --- a/libc-top-half/musl/arch/mips/bits/socket.h +++ b/libc-top-half/musl/arch/mips/bits/socket.h @@ -1,19 +1,3 @@ -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen; - void *msg_control; - socklen_t msg_controllen; - int msg_flags; -}; - -struct cmsghdr { - socklen_t cmsg_len; - int cmsg_level; - int cmsg_type; -}; - #define SOCK_STREAM 2 #define SOCK_DGRAM 1 @@ -32,8 +16,6 @@ struct cmsghdr { #define SO_RCVBUF 0x1002 #define SO_SNDLOWAT 0x1003 #define SO_RCVLOWAT 0x1004 -#define SO_RCVTIMEO 0x1006 -#define SO_SNDTIMEO 0x1005 #define SO_ERROR 0x1007 #define SO_TYPE 0x1008 #define SO_ACCEPTCONN 0x1009 diff --git a/libc-top-half/musl/arch/mips/bits/stat.h b/libc-top-half/musl/arch/mips/bits/stat.h index 3291a63..48d4ac8 100644 --- a/libc-top-half/musl/arch/mips/bits/stat.h +++ b/libc-top-half/musl/arch/mips/bits/stat.h @@ -12,11 +12,15 @@ struct stat { dev_t st_rdev; long __st_padding2[2]; off_t st_size; - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; + struct { + long tv_sec; + long tv_nsec; + } __st_atim32, __st_mtim32, __st_ctim32; blksize_t st_blksize; long __st_padding3; blkcnt_t st_blocks; - long __st_padding4[14]; + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + long __st_padding4[2]; }; diff --git a/libc-top-half/musl/arch/mips/bits/syscall.h.in b/libc-top-half/musl/arch/mips/bits/syscall.h.in index 582fa3b..86251bf 100644 --- a/libc-top-half/musl/arch/mips/bits/syscall.h.in +++ b/libc-top-half/musl/arch/mips/bits/syscall.h.in @@ -76,8 +76,8 @@ #define __NR_setrlimit 4075 #define __NR_getrlimit 4076 #define __NR_getrusage 4077 -#define __NR_gettimeofday 4078 -#define __NR_settimeofday 4079 +#define __NR_gettimeofday_time32 4078 +#define __NR_settimeofday_time32 4079 #define __NR_getgroups 4080 #define __NR_setgroups 4081 #define __NR_reserved82 4082 @@ -256,14 +256,14 @@ #define __NR_statfs64 4255 #define __NR_fstatfs64 4256 #define __NR_timer_create 4257 -#define __NR_timer_settime 4258 -#define __NR_timer_gettime 4259 +#define __NR_timer_settime32 4258 +#define __NR_timer_gettime32 4259 #define __NR_timer_getoverrun 4260 #define __NR_timer_delete 4261 -#define __NR_clock_settime 4262 -#define __NR_clock_gettime 4263 -#define __NR_clock_getres 4264 -#define __NR_clock_nanosleep 4265 +#define __NR_clock_settime32 4262 +#define __NR_clock_gettime32 4263 +#define __NR_clock_getres_time32 4264 +#define __NR_clock_nanosleep_time32 4265 #define __NR_tgkill 4266 #define __NR_utimes 4267 #define __NR_mbind 4268 @@ -319,8 +319,8 @@ #define __NR_eventfd 4319 #define __NR_fallocate 4320 #define __NR_timerfd_create 4321 -#define __NR_timerfd_gettime 4322 -#define __NR_timerfd_settime 4323 +#define __NR_timerfd_gettime32 4322 +#define __NR_timerfd_settime32 4323 #define __NR_signalfd4 4324 #define __NR_eventfd2 4325 #define __NR_epoll_create1 4326 @@ -406,4 +406,6 @@ #define __NR_fsconfig 4431 #define __NR_fsmount 4432 #define __NR_fspick 4433 +#define __NR_pidfd_open 4434 +#define __NR_clone3 4435 diff --git a/libc-top-half/musl/arch/mips/reloc.h b/libc-top-half/musl/arch/mips/reloc.h index b3d59a4..88d2363 100644 --- a/libc-top-half/musl/arch/mips/reloc.h +++ b/libc-top-half/musl/arch/mips/reloc.h @@ -1,5 +1,3 @@ -#include - #if __mips_isa_rev >= 6 #define ISA_SUFFIX "r6" #else diff --git a/libc-top-half/musl/arch/mips/syscall_arch.h b/libc-top-half/musl/arch/mips/syscall_arch.h index 6ea7343..f821e73 100644 --- a/libc-top-half/musl/arch/mips/syscall_arch.h +++ b/libc-top-half/musl/arch/mips/syscall_arch.h @@ -142,7 +142,9 @@ static inline long __syscall7(long n, long a, long b, long c, long d, long e, lo } #define VDSO_USEFUL -#define VDSO_CGT_SYM "__vdso_clock_gettime" +#define VDSO_CGT32_SYM "__vdso_clock_gettime" +#define VDSO_CGT32_VER "LINUX_2.6" +#define VDSO_CGT_SYM "__vdso_clock_gettime64" #define VDSO_CGT_VER "LINUX_2.6" #define SO_SNDTIMEO_OLD 0x1005 diff --git a/libc-top-half/musl/arch/mips64/bits/alltypes.h.in b/libc-top-half/musl/arch/mips64/bits/alltypes.h.in index 2b2e34a..fcd61ee 100644 --- a/libc-top-half/musl/arch/mips64/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/mips64/bits/alltypes.h.in @@ -2,8 +2,13 @@ #define _Int64 long #define _Reg long -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#if _MIPSEL || __MIPSEL || __MIPSEL__ +#define __BYTE_ORDER 1234 +#else +#define __BYTE_ORDER 4321 +#endif + +#define __LONG_MAX 0x7fffffffffffffffL #ifndef __cplusplus TYPEDEF int wchar_t; @@ -14,15 +19,4 @@ TYPEDEF double double_t; TYPEDEF struct { long long __ll; long double __ld; } max_align_t; -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - TYPEDEF unsigned nlink_t; - -TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/mips64/bits/endian.h b/libc-top-half/musl/arch/mips64/bits/endian.h deleted file mode 100644 index 5399dcb..0000000 --- a/libc-top-half/musl/arch/mips64/bits/endian.h +++ /dev/null @@ -1,5 +0,0 @@ -#if _MIPSEL || __MIPSEL || __MIPSEL__ -#define __BYTE_ORDER __LITTLE_ENDIAN -#else -#define __BYTE_ORDER __BIG_ENDIAN -#endif diff --git a/libc-top-half/musl/arch/mips64/bits/limits.h b/libc-top-half/musl/arch/mips64/bits/limits.h deleted file mode 100644 index 58698c6..0000000 --- a/libc-top-half/musl/arch/mips64/bits/limits.h +++ /dev/null @@ -1,7 +0,0 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define LONG_BIT 64 -#endif - -#define LONG_MAX 0x7fffffffffffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/mips64/bits/socket.h b/libc-top-half/musl/arch/mips64/bits/socket.h index 5aff0d9..519b9c8 100644 --- a/libc-top-half/musl/arch/mips64/bits/socket.h +++ b/libc-top-half/musl/arch/mips64/bits/socket.h @@ -1,37 +1,3 @@ -#include - -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; -#if __BYTE_ORDER == __BIG_ENDIAN - int __pad1, msg_iovlen; -#else - int msg_iovlen, __pad1; -#endif - void *msg_control; -#if __BYTE_ORDER == __BIG_ENDIAN - int __pad2; - socklen_t msg_controllen; -#else - socklen_t msg_controllen; - int __pad2; -#endif - int msg_flags; -}; - -struct cmsghdr { -#if __BYTE_ORDER == __BIG_ENDIAN - int __pad1; - socklen_t cmsg_len; -#else - socklen_t cmsg_len; - int __pad1; -#endif - int cmsg_level; - int cmsg_type; -}; - #define SOCK_STREAM 2 #define SOCK_DGRAM 1 #define SOL_SOCKET 65535 diff --git a/libc-top-half/musl/arch/mips64/bits/syscall.h.in b/libc-top-half/musl/arch/mips64/bits/syscall.h.in index 34b9752..9b406e9 100644 --- a/libc-top-half/musl/arch/mips64/bits/syscall.h.in +++ b/libc-top-half/musl/arch/mips64/bits/syscall.h.in @@ -336,4 +336,6 @@ #define __NR_fsconfig 5431 #define __NR_fsmount 5432 #define __NR_fspick 5433 +#define __NR_pidfd_open 5434 +#define __NR_clone3 5435 diff --git a/libc-top-half/musl/arch/mips64/reloc.h b/libc-top-half/musl/arch/mips64/reloc.h index bbd9bd9..fdb5edc 100644 --- a/libc-top-half/musl/arch/mips64/reloc.h +++ b/libc-top-half/musl/arch/mips64/reloc.h @@ -1,9 +1,3 @@ -#ifndef __RELOC_H__ -#define __RELOC_H__ - -#define _GNU_SOURCE -#include - #if __mips_isa_rev >= 6 #define ISA_SUFFIX "r6" #else @@ -33,6 +27,8 @@ #define REL_DTPOFF R_MIPS_TLS_DTPREL64 #define REL_TPOFF R_MIPS_TLS_TPREL64 +#include + #undef R_TYPE #undef R_SYM #undef R_INFO @@ -62,5 +58,3 @@ " daddu %0, %0, $ra \n" \ ".set pop \n" \ : "=r"(*(fp)) : : "memory", "ra" ) - -#endif diff --git a/libc-top-half/musl/arch/mipsn32/arch.mak b/libc-top-half/musl/arch/mipsn32/arch.mak new file mode 100644 index 0000000..aa4d05c --- /dev/null +++ b/libc-top-half/musl/arch/mipsn32/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/libc-top-half/musl/arch/mipsn32/bits/alltypes.h.in b/libc-top-half/musl/arch/mipsn32/bits/alltypes.h.in index 66ca18a..ff934a4 100644 --- a/libc-top-half/musl/arch/mipsn32/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/mipsn32/bits/alltypes.h.in @@ -1,9 +1,15 @@ +#define _REDIR_TIME64 1 #define _Addr int #define _Int64 long long #define _Reg int -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#if _MIPSEL || __MIPSEL || __MIPSEL__ +#define __BYTE_ORDER 1234 +#else +#define __BYTE_ORDER 4321 +#endif + +#define __LONG_MAX 0x7fffffffL #ifndef __cplusplus TYPEDEF int wchar_t; @@ -13,14 +19,3 @@ TYPEDEF float float_t; TYPEDEF double double_t; TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/mipsn32/bits/endian.h b/libc-top-half/musl/arch/mipsn32/bits/endian.h deleted file mode 100644 index 5399dcb..0000000 --- a/libc-top-half/musl/arch/mipsn32/bits/endian.h +++ /dev/null @@ -1,5 +0,0 @@ -#if _MIPSEL || __MIPSEL || __MIPSEL__ -#define __BYTE_ORDER __LITTLE_ENDIAN -#else -#define __BYTE_ORDER __BIG_ENDIAN -#endif diff --git a/libc-top-half/musl/arch/mipsn32/bits/ioctl.h b/libc-top-half/musl/arch/mipsn32/bits/ioctl.h index e277c3f..e20bf19 100644 --- a/libc-top-half/musl/arch/mipsn32/bits/ioctl.h +++ b/libc-top-half/musl/arch/mipsn32/bits/ioctl.h @@ -110,5 +110,5 @@ #define SIOCATMARK _IOR('s', 7, int) #define SIOCSPGRP _IOW('s', 8, pid_t) #define SIOCGPGRP _IOR('s', 9, pid_t) -#define SIOCGSTAMP 0x8906 -#define SIOCGSTAMPNS 0x8907 +#define SIOCGSTAMP _IOR(0x89, 6, char[16]) +#define SIOCGSTAMPNS _IOR(0x89, 7, char[16]) diff --git a/libc-top-half/musl/arch/mipsn32/bits/ipcstat.h b/libc-top-half/musl/arch/mipsn32/bits/ipcstat.h index 0018ad1..4f4fcb0 100644 --- a/libc-top-half/musl/arch/mipsn32/bits/ipcstat.h +++ b/libc-top-half/musl/arch/mipsn32/bits/ipcstat.h @@ -1 +1 @@ -#define IPC_STAT 2 +#define IPC_STAT 0x102 diff --git a/libc-top-half/musl/arch/mipsn32/bits/limits.h b/libc-top-half/musl/arch/mipsn32/bits/limits.h deleted file mode 100644 index fbc6d23..0000000 --- a/libc-top-half/musl/arch/mipsn32/bits/limits.h +++ /dev/null @@ -1,7 +0,0 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define LONG_BIT 32 -#endif - -#define LONG_MAX 0x7fffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/mipsn32/bits/msg.h b/libc-top-half/musl/arch/mipsn32/bits/msg.h index f28aece..c734dbb 100644 --- a/libc-top-half/musl/arch/mipsn32/bits/msg.h +++ b/libc-top-half/musl/arch/mipsn32/bits/msg.h @@ -1,19 +1,19 @@ struct msqid_ds { struct ipc_perm msg_perm; #if _MIPSEL || __MIPSEL || __MIPSEL__ - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; + unsigned long __msg_stime_lo; + unsigned long __msg_stime_hi; + unsigned long __msg_rtime_lo; + unsigned long __msg_rtime_hi; + unsigned long __msg_ctime_lo; + unsigned long __msg_ctime_hi; #else - int __unused1; - time_t msg_stime; - int __unused2; - time_t msg_rtime; - int __unused3; - time_t msg_ctime; + unsigned long __msg_stime_hi; + unsigned long __msg_stime_lo; + unsigned long __msg_rtime_hi; + unsigned long __msg_rtime_lo; + unsigned long __msg_ctime_hi; + unsigned long __msg_ctime_lo; #endif unsigned long msg_cbytes; msgqnum_t msg_qnum; @@ -21,4 +21,7 @@ struct msqid_ds { pid_t msg_lspid; pid_t msg_lrpid; unsigned long __unused[2]; + time_t msg_stime; + time_t msg_rtime; + time_t msg_ctime; }; diff --git a/libc-top-half/musl/arch/mipsn32/bits/sem.h b/libc-top-half/musl/arch/mipsn32/bits/sem.h index 5184eb5..fe6f094 100644 --- a/libc-top-half/musl/arch/mipsn32/bits/sem.h +++ b/libc-top-half/musl/arch/mipsn32/bits/sem.h @@ -1,7 +1,7 @@ struct semid_ds { struct ipc_perm sem_perm; - time_t sem_otime; - time_t sem_ctime; + unsigned long __sem_otime_lo; + unsigned long __sem_ctime_lo; #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned short sem_nsems; char __sem_nsems_pad[sizeof(long)-sizeof(short)]; @@ -9,6 +9,8 @@ struct semid_ds { char __sem_nsems_pad[sizeof(long)-sizeof(short)]; unsigned short sem_nsems; #endif - long __unused3; - long __unused4; + unsigned long __sem_otime_hi; + unsigned long __sem_ctime_hi; + time_t sem_otime; + time_t sem_ctime; }; diff --git a/libc-top-half/musl/arch/mipsn32/bits/shm.h b/libc-top-half/musl/arch/mipsn32/bits/shm.h index 8d19378..ab8c642 100644 --- a/libc-top-half/musl/arch/mipsn32/bits/shm.h +++ b/libc-top-half/musl/arch/mipsn32/bits/shm.h @@ -3,14 +3,19 @@ struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; - time_t shm_atime; - time_t shm_dtime; - time_t shm_ctime; + unsigned long __shm_atime_lo; + unsigned long __shm_dtime_lo; + unsigned long __shm_ctime_lo; pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; - unsigned long __pad1; - unsigned long __pad2; + unsigned short __shm_atime_hi; + unsigned short __shm_dtime_hi; + unsigned short __shm_ctime_hi; + unsigned short __pad1; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; }; struct shminfo { diff --git a/libc-top-half/musl/arch/mipsn32/bits/socket.h b/libc-top-half/musl/arch/mipsn32/bits/socket.h index b82c7d3..02fbb88 100644 --- a/libc-top-half/musl/arch/mipsn32/bits/socket.h +++ b/libc-top-half/musl/arch/mipsn32/bits/socket.h @@ -1,19 +1,3 @@ -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen; - void *msg_control; - socklen_t msg_controllen; - int msg_flags; -}; - -struct cmsghdr { - socklen_t cmsg_len; - int cmsg_level; - int cmsg_type; -}; - #define SOCK_STREAM 2 #define SOCK_DGRAM 1 @@ -32,8 +16,6 @@ struct cmsghdr { #define SO_RCVBUF 0x1002 #define SO_SNDLOWAT 0x1003 #define SO_RCVLOWAT 0x1004 -#define SO_RCVTIMEO 0x1006 -#define SO_SNDTIMEO 0x1005 #define SO_ERROR 0x1007 #define SO_TYPE 0x1008 #define SO_ACCEPTCONN 0x1009 diff --git a/libc-top-half/musl/arch/mipsn32/bits/stat.h b/libc-top-half/musl/arch/mipsn32/bits/stat.h index 27d36b5..6e2f280 100644 --- a/libc-top-half/musl/arch/mipsn32/bits/stat.h +++ b/libc-top-half/musl/arch/mipsn32/bits/stat.h @@ -9,11 +9,15 @@ struct stat { dev_t st_rdev; long __pad2[2]; off_t st_size; - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; + struct { + long tv_sec; + long tv_nsec; + } __st_atim32, __st_mtim32, __st_ctim32; blksize_t st_blksize; long __pad3; blkcnt_t st_blocks; - long __pad4[14]; + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + long __pad4[2]; }; diff --git a/libc-top-half/musl/arch/mipsn32/bits/syscall.h.in b/libc-top-half/musl/arch/mipsn32/bits/syscall.h.in index d80cafa..2ad48d1 100644 --- a/libc-top-half/musl/arch/mipsn32/bits/syscall.h.in +++ b/libc-top-half/musl/arch/mipsn32/bits/syscall.h.in @@ -92,7 +92,7 @@ #define __NR_fchown 6091 #define __NR_lchown 6092 #define __NR_umask 6093 -#define __NR_gettimeofday 6094 +#define __NR_gettimeofday_time32 6094 #define __NR_getrlimit 6095 #define __NR_getrusage 6096 #define __NR_sysinfo 6097 @@ -157,7 +157,7 @@ #define __NR_chroot 6156 #define __NR_sync 6157 #define __NR_acct 6158 -#define __NR_settimeofday 6159 +#define __NR_settimeofday_time32 6159 #define __NR_mount 6160 #define __NR_umount2 6161 #define __NR_swapon 6162 @@ -219,14 +219,14 @@ #define __NR_fstatfs64 6218 #define __NR_sendfile64 6219 #define __NR_timer_create 6220 -#define __NR_timer_settime 6221 -#define __NR_timer_gettime 6222 +#define __NR_timer_settime32 6221 +#define __NR_timer_gettime32 6222 #define __NR_timer_getoverrun 6223 #define __NR_timer_delete 6224 -#define __NR_clock_settime 6225 -#define __NR_clock_gettime 6226 -#define __NR_clock_getres 6227 -#define __NR_clock_nanosleep 6228 +#define __NR_clock_settime32 6225 +#define __NR_clock_gettime32 6226 +#define __NR_clock_getres_time32 6227 +#define __NR_clock_nanosleep_time32 6228 #define __NR_tgkill 6229 #define __NR_utimes 6230 #define __NR_mbind 6231 @@ -282,8 +282,8 @@ #define __NR_eventfd 6282 #define __NR_fallocate 6283 #define __NR_timerfd_create 6284 -#define __NR_timerfd_gettime 6285 -#define __NR_timerfd_settime 6286 +#define __NR_timerfd_gettime32 6285 +#define __NR_timerfd_settime32 6286 #define __NR_signalfd4 6287 #define __NR_eventfd2 6288 #define __NR_epoll_create1 6289 @@ -360,4 +360,6 @@ #define __NR_fsconfig 6431 #define __NR_fsmount 6432 #define __NR_fspick 6433 +#define __NR_pidfd_open 6434 +#define __NR_clone3 6435 diff --git a/libc-top-half/musl/arch/mipsn32/reloc.h b/libc-top-half/musl/arch/mipsn32/reloc.h index 728aaab..47c6e59 100644 --- a/libc-top-half/musl/arch/mipsn32/reloc.h +++ b/libc-top-half/musl/arch/mipsn32/reloc.h @@ -1,5 +1,3 @@ -#include - #if __mips_isa_rev >= 6 #define ISA_SUFFIX "r6" #else diff --git a/libc-top-half/musl/arch/mipsn32/syscall_arch.h b/libc-top-half/musl/arch/mipsn32/syscall_arch.h index 5ff43bb..c1a4b7d 100644 --- a/libc-top-half/musl/arch/mipsn32/syscall_arch.h +++ b/libc-top-half/musl/arch/mipsn32/syscall_arch.h @@ -116,7 +116,9 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo } #define VDSO_USEFUL -#define VDSO_CGT_SYM "__vdso_clock_gettime" +#define VDSO_CGT32_SYM "__vdso_clock_gettime" +#define VDSO_CGT32_VER "LINUX_2.6" +#define VDSO_CGT_SYM "__vdso_clock_gettime64" #define VDSO_CGT_VER "LINUX_2.6" #define SO_SNDTIMEO_OLD 0x1005 diff --git a/libc-top-half/musl/arch/or1k/arch.mak b/libc-top-half/musl/arch/or1k/arch.mak new file mode 100644 index 0000000..aa4d05c --- /dev/null +++ b/libc-top-half/musl/arch/or1k/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/libc-top-half/musl/arch/or1k/bits/alltypes.h.in b/libc-top-half/musl/arch/or1k/bits/alltypes.h.in index 667963c..7d3e291 100644 --- a/libc-top-half/musl/arch/or1k/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/or1k/bits/alltypes.h.in @@ -1,9 +1,10 @@ +#define _REDIR_TIME64 1 #define _Addr int #define _Int64 long long #define _Reg int -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#define __BYTE_ORDER 4321 +#define __LONG_MAX 0x7fffffffL #ifndef __cplusplus TYPEDEF unsigned wchar_t; @@ -13,14 +14,3 @@ TYPEDEF float float_t; TYPEDEF double double_t; TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/or1k/bits/endian.h b/libc-top-half/musl/arch/or1k/bits/endian.h deleted file mode 100644 index ef074b7..0000000 --- a/libc-top-half/musl/arch/or1k/bits/endian.h +++ /dev/null @@ -1 +0,0 @@ -#define __BYTE_ORDER __BIG_ENDIAN diff --git a/libc-top-half/musl/arch/or1k/bits/ipcstat.h b/libc-top-half/musl/arch/or1k/bits/ipcstat.h index 0018ad1..4f4fcb0 100644 --- a/libc-top-half/musl/arch/or1k/bits/ipcstat.h +++ b/libc-top-half/musl/arch/or1k/bits/ipcstat.h @@ -1 +1 @@ -#define IPC_STAT 2 +#define IPC_STAT 0x102 diff --git a/libc-top-half/musl/arch/or1k/bits/limits.h b/libc-top-half/musl/arch/or1k/bits/limits.h index 3a811c9..fac47aa 100644 --- a/libc-top-half/musl/arch/or1k/bits/limits.h +++ b/libc-top-half/musl/arch/or1k/bits/limits.h @@ -1,8 +1 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define PAGESIZE 8192 -#define LONG_BIT 32 -#endif - -#define LONG_MAX 0x7fffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/or1k/bits/msg.h b/libc-top-half/musl/arch/or1k/bits/msg.h index bc8436c..7bbbb2b 100644 --- a/libc-top-half/musl/arch/or1k/bits/msg.h +++ b/libc-top-half/musl/arch/or1k/bits/msg.h @@ -1,15 +1,18 @@ struct msqid_ds { struct ipc_perm msg_perm; - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; + unsigned long __msg_stime_lo; + unsigned long __msg_stime_hi; + unsigned long __msg_rtime_lo; + unsigned long __msg_rtime_hi; + unsigned long __msg_ctime_lo; + unsigned long __msg_ctime_hi; unsigned long msg_cbytes; msgqnum_t msg_qnum; msglen_t msg_qbytes; pid_t msg_lspid; pid_t msg_lrpid; unsigned long __unused[2]; + time_t msg_stime; + time_t msg_rtime; + time_t msg_ctime; }; diff --git a/libc-top-half/musl/arch/or1k/bits/sem.h b/libc-top-half/musl/arch/or1k/bits/sem.h index 08faafe..d88338e 100644 --- a/libc-top-half/musl/arch/or1k/bits/sem.h +++ b/libc-top-half/musl/arch/or1k/bits/sem.h @@ -1,11 +1,13 @@ struct semid_ds { struct ipc_perm sem_perm; - time_t sem_otime; - long __unused1; - time_t sem_ctime; - long __unused2; + unsigned long __sem_otime_lo; + unsigned long __sem_otime_hi; + unsigned long __sem_ctime_lo; + unsigned long __sem_ctime_hi; char __sem_nsems_pad[sizeof(long)-sizeof(short)]; unsigned short sem_nsems; long __unused3; long __unused4; + time_t sem_otime; + time_t sem_ctime; }; diff --git a/libc-top-half/musl/arch/or1k/bits/shm.h b/libc-top-half/musl/arch/or1k/bits/shm.h index 81b2a29..725fb46 100644 --- a/libc-top-half/musl/arch/or1k/bits/shm.h +++ b/libc-top-half/musl/arch/or1k/bits/shm.h @@ -3,17 +3,21 @@ struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; - time_t shm_atime; - int __unused1; - time_t shm_dtime; - int __unused2; - time_t shm_ctime; - int __unused3; + unsigned long __shm_atime_lo; + unsigned long __shm_atime_hi; + unsigned long __shm_dtime_lo; + unsigned long __shm_dtime_hi; + unsigned long __shm_ctime_lo; + unsigned long __shm_ctime_hi; pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; unsigned long __pad1; unsigned long __pad2; + unsigned long __pad3; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; }; struct shminfo { diff --git a/libc-top-half/musl/arch/or1k/bits/stat.h b/libc-top-half/musl/arch/or1k/bits/stat.h index ce6a6bd..cde3fd0 100644 --- a/libc-top-half/musl/arch/or1k/bits/stat.h +++ b/libc-top-half/musl/arch/or1k/bits/stat.h @@ -14,8 +14,12 @@ struct stat { blksize_t st_blksize; int __st_blksize_padding; blkcnt_t st_blocks; - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; + struct { + long tv_sec; + long tv_nsec; + } __st_atim32, __st_mtim32, __st_ctim32; unsigned __unused[2]; + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; }; diff --git a/libc-top-half/musl/arch/or1k/bits/syscall.h.in b/libc-top-half/musl/arch/or1k/bits/syscall.h.in index 8ffcfae..e9c925e 100644 --- a/libc-top-half/musl/arch/or1k/bits/syscall.h.in +++ b/libc-top-half/musl/arch/or1k/bits/syscall.h.in @@ -85,8 +85,8 @@ #define __NR_fdatasync 83 #define __NR_sync_file_range 84 #define __NR_timerfd_create 85 -#define __NR_timerfd_settime 86 -#define __NR_timerfd_gettime 87 +#define __NR_timerfd_settime32 86 +#define __NR_timerfd_gettime32 87 #define __NR_utimensat 88 #define __NR_acct 89 #define __NR_capget 90 @@ -107,14 +107,14 @@ #define __NR_init_module 105 #define __NR_delete_module 106 #define __NR_timer_create 107 -#define __NR_timer_gettime 108 +#define __NR_timer_gettime32 108 #define __NR_timer_getoverrun 109 -#define __NR_timer_settime 110 +#define __NR_timer_settime32 110 #define __NR_timer_delete 111 -#define __NR_clock_settime 112 -#define __NR_clock_gettime 113 -#define __NR_clock_getres 114 -#define __NR_clock_nanosleep 115 +#define __NR_clock_settime32 112 +#define __NR_clock_gettime32 113 +#define __NR_clock_getres_time32 114 +#define __NR_clock_nanosleep_time32 115 #define __NR_syslog 116 #define __NR_ptrace 117 #define __NR_sched_setparam 118 @@ -168,8 +168,8 @@ #define __NR_umask 166 #define __NR_prctl 167 #define __NR_getcpu 168 -#define __NR_gettimeofday 169 -#define __NR_settimeofday 170 +#define __NR_gettimeofday_time32 169 +#define __NR_settimeofday_time32 170 #define __NR_adjtimex 171 #define __NR_getpid 172 #define __NR_getppid 173 @@ -309,4 +309,6 @@ #define __NR_fsconfig 431 #define __NR_fsmount 432 #define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 diff --git a/libc-top-half/musl/arch/powerpc/arch.mak b/libc-top-half/musl/arch/powerpc/arch.mak new file mode 100644 index 0000000..aa4d05c --- /dev/null +++ b/libc-top-half/musl/arch/powerpc/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/libc-top-half/musl/arch/powerpc/bits/alltypes.h.in b/libc-top-half/musl/arch/powerpc/bits/alltypes.h.in index 8e687ef..b48df6a 100644 --- a/libc-top-half/musl/arch/powerpc/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/powerpc/bits/alltypes.h.in @@ -1,9 +1,10 @@ +#define _REDIR_TIME64 1 #define _Addr int #define _Int64 long long #define _Reg int -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#define __BYTE_ORDER 4321 +#define __LONG_MAX 0x7fffffffL #ifndef __cplusplus #ifdef __WCHAR_TYPE__ @@ -17,14 +18,3 @@ TYPEDEF float float_t; TYPEDEF double double_t; TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/powerpc/bits/endian.h b/libc-top-half/musl/arch/powerpc/bits/endian.h deleted file mode 100644 index 4442abf..0000000 --- a/libc-top-half/musl/arch/powerpc/bits/endian.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifdef __BIG_ENDIAN__ - #if __BIG_ENDIAN__ - #define __BYTE_ORDER __BIG_ENDIAN - #endif -#endif /* __BIG_ENDIAN__ */ - -#ifdef __LITTLE_ENDIAN__ - #if __LITTLE_ENDIAN__ - #define __BYTE_ORDER __LITTLE_ENDIAN - #endif -#endif /* __LITTLE_ENDIAN__ */ - -#ifndef __BYTE_ORDER - #define __BYTE_ORDER __BIG_ENDIAN -#endif diff --git a/libc-top-half/musl/arch/powerpc/bits/ioctl.h b/libc-top-half/musl/arch/powerpc/bits/ioctl.h index b6cbb18..ac9bfd2 100644 --- a/libc-top-half/musl/arch/powerpc/bits/ioctl.h +++ b/libc-top-half/musl/arch/powerpc/bits/ioctl.h @@ -116,5 +116,5 @@ #define FIOGETOWN 0x8903 #define SIOCGPGRP 0x8904 #define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 -#define SIOCGSTAMPNS 0x8907 +#define SIOCGSTAMP _IOR(0x89, 6, char[16]) +#define SIOCGSTAMPNS _IOR(0x89, 7, char[16]) diff --git a/libc-top-half/musl/arch/powerpc/bits/ipcstat.h b/libc-top-half/musl/arch/powerpc/bits/ipcstat.h index 0018ad1..4f4fcb0 100644 --- a/libc-top-half/musl/arch/powerpc/bits/ipcstat.h +++ b/libc-top-half/musl/arch/powerpc/bits/ipcstat.h @@ -1 +1 @@ -#define IPC_STAT 2 +#define IPC_STAT 0x102 diff --git a/libc-top-half/musl/arch/powerpc/bits/limits.h b/libc-top-half/musl/arch/powerpc/bits/limits.h deleted file mode 100644 index fbc6d23..0000000 --- a/libc-top-half/musl/arch/powerpc/bits/limits.h +++ /dev/null @@ -1,7 +0,0 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define LONG_BIT 32 -#endif - -#define LONG_MAX 0x7fffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/powerpc/bits/msg.h b/libc-top-half/musl/arch/powerpc/bits/msg.h index 171c11a..9fb15dc 100644 --- a/libc-top-half/musl/arch/powerpc/bits/msg.h +++ b/libc-top-half/musl/arch/powerpc/bits/msg.h @@ -1,15 +1,18 @@ struct msqid_ds { struct ipc_perm msg_perm; - int __unused1; - time_t msg_stime; - int __unused2; - time_t msg_rtime; - int __unused3; - time_t msg_ctime; + unsigned long __msg_stime_hi; + unsigned long __msg_stime_lo; + unsigned long __msg_rtime_hi; + unsigned long __msg_rtime_lo; + unsigned long __msg_ctime_hi; + unsigned long __msg_ctime_lo; unsigned long msg_cbytes; msgqnum_t msg_qnum; msglen_t msg_qbytes; pid_t msg_lspid; pid_t msg_lrpid; unsigned long __unused[2]; + time_t msg_stime; + time_t msg_rtime; + time_t msg_ctime; }; diff --git a/libc-top-half/musl/arch/powerpc/bits/sem.h b/libc-top-half/musl/arch/powerpc/bits/sem.h index bc2d6d1..28be484 100644 --- a/libc-top-half/musl/arch/powerpc/bits/sem.h +++ b/libc-top-half/musl/arch/powerpc/bits/sem.h @@ -1,10 +1,12 @@ struct semid_ds { struct ipc_perm sem_perm; - int __unused1; - time_t sem_otime; - int __unused2; - time_t sem_ctime; + unsigned long __sem_otime_hi; + unsigned long __sem_otime_lo; + unsigned long __sem_ctime_hi; + unsigned long __sem_ctime_lo; unsigned short __sem_nsems_pad, sem_nsems; long __unused3; long __unused4; + time_t sem_otime; + time_t sem_ctime; }; diff --git a/libc-top-half/musl/arch/powerpc/bits/shm.h b/libc-top-half/musl/arch/powerpc/bits/shm.h index b19801d..fb1d402 100644 --- a/libc-top-half/musl/arch/powerpc/bits/shm.h +++ b/libc-top-half/musl/arch/powerpc/bits/shm.h @@ -2,19 +2,21 @@ struct shmid_ds { struct ipc_perm shm_perm; - int __unused1; - time_t shm_atime; - int __unused2; - time_t shm_dtime; - int __unused3; - time_t shm_ctime; - int __unused4; + unsigned long __shm_atime_hi; + unsigned long __shm_atime_lo; + unsigned long __shm_dtime_hi; + unsigned long __shm_dtime_lo; + unsigned long __shm_ctime_hi; + unsigned long __shm_ctime_lo; size_t shm_segsz; pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; unsigned long __pad1; unsigned long __pad2; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; }; struct shminfo { diff --git a/libc-top-half/musl/arch/powerpc/bits/signal.h b/libc-top-half/musl/arch/powerpc/bits/signal.h index 06efb11..c1bf3ca 100644 --- a/libc-top-half/musl/arch/powerpc/bits/signal.h +++ b/libc-top-half/musl/arch/powerpc/bits/signal.h @@ -28,7 +28,7 @@ struct sigcontext { int signal; unsigned long handler; unsigned long oldmask; - void *regs; + struct pt_regs *regs; }; typedef struct { diff --git a/libc-top-half/musl/arch/powerpc/bits/socket.h b/libc-top-half/musl/arch/powerpc/bits/socket.h index a94b8bd..b19ed42 100644 --- a/libc-top-half/musl/arch/powerpc/bits/socket.h +++ b/libc-top-half/musl/arch/powerpc/bits/socket.h @@ -1,19 +1,3 @@ -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen; - void *msg_control; - socklen_t msg_controllen; - int msg_flags; -}; - -struct cmsghdr { - socklen_t cmsg_len; - int cmsg_level; - int cmsg_type; -}; - #define SO_DEBUG 1 #define SO_REUSEADDR 2 #define SO_TYPE 3 @@ -31,8 +15,6 @@ struct cmsghdr { #define SO_REUSEPORT 15 #define SO_RCVLOWAT 16 #define SO_SNDLOWAT 17 -#define SO_RCVTIMEO 18 -#define SO_SNDTIMEO 19 #define SO_PASSCRED 20 #define SO_PEERCRED 21 #define SO_ACCEPTCONN 30 diff --git a/libc-top-half/musl/arch/powerpc/bits/stat.h b/libc-top-half/musl/arch/powerpc/bits/stat.h index dcb896f..585d98e 100644 --- a/libc-top-half/musl/arch/powerpc/bits/stat.h +++ b/libc-top-half/musl/arch/powerpc/bits/stat.h @@ -13,8 +13,12 @@ struct stat { off_t st_size; blksize_t st_blksize; blkcnt_t st_blocks; + struct { + long tv_sec; + long tv_nsec; + } __st_atim32, __st_mtim32, __st_ctim32; + unsigned __unused[2]; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; - unsigned __unused[2]; }; diff --git a/libc-top-half/musl/arch/powerpc/bits/syscall.h.in b/libc-top-half/musl/arch/powerpc/bits/syscall.h.in index adcf63d..8d4f79b 100644 --- a/libc-top-half/musl/arch/powerpc/bits/syscall.h.in +++ b/libc-top-half/musl/arch/powerpc/bits/syscall.h.in @@ -76,8 +76,8 @@ #define __NR_setrlimit 75 #define __NR_getrlimit 76 #define __NR_getrusage 77 -#define __NR_gettimeofday 78 -#define __NR_settimeofday 79 +#define __NR_gettimeofday_time32 78 +#define __NR_settimeofday_time32 79 #define __NR_getgroups 80 #define __NR_setgroups 81 #define __NR_select 82 @@ -238,14 +238,14 @@ #define __NR_epoll_wait 238 #define __NR_remap_file_pages 239 #define __NR_timer_create 240 -#define __NR_timer_settime 241 -#define __NR_timer_gettime 242 +#define __NR_timer_settime32 241 +#define __NR_timer_gettime32 242 #define __NR_timer_getoverrun 243 #define __NR_timer_delete 244 -#define __NR_clock_settime 245 -#define __NR_clock_gettime 246 -#define __NR_clock_getres 247 -#define __NR_clock_nanosleep 248 +#define __NR_clock_settime32 245 +#define __NR_clock_gettime32 246 +#define __NR_clock_getres_time32 247 +#define __NR_clock_nanosleep_time32 248 #define __NR_swapcontext 249 #define __NR_tgkill 250 #define __NR_utimes 251 @@ -307,8 +307,8 @@ #define __NR_sync_file_range2 308 #define __NR_fallocate 309 #define __NR_subpage_prot 310 -#define __NR_timerfd_settime 311 -#define __NR_timerfd_gettime 312 +#define __NR_timerfd_settime32 311 +#define __NR_timerfd_gettime32 312 #define __NR_signalfd4 313 #define __NR_eventfd2 314 #define __NR_epoll_create1 315 @@ -413,4 +413,6 @@ #define __NR_fsconfig 431 #define __NR_fsmount 432 #define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 diff --git a/libc-top-half/musl/arch/powerpc64/bits/alltypes.h.in b/libc-top-half/musl/arch/powerpc64/bits/alltypes.h.in index 5b20585..143ffa8 100644 --- a/libc-top-half/musl/arch/powerpc64/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/powerpc64/bits/alltypes.h.in @@ -2,8 +2,13 @@ #define _Int64 long #define _Reg long -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#if __BIG_ENDIAN__ +#define __BYTE_ORDER 4321 +#else +#define __BYTE_ORDER 1234 +#endif + +#define __LONG_MAX 0x7fffffffffffffffL #ifndef __cplusplus TYPEDEF int wchar_t; @@ -13,14 +18,3 @@ TYPEDEF float float_t; TYPEDEF double double_t; TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/powerpc64/bits/endian.h b/libc-top-half/musl/arch/powerpc64/bits/endian.h deleted file mode 100644 index 2016cb2..0000000 --- a/libc-top-half/musl/arch/powerpc64/bits/endian.h +++ /dev/null @@ -1,5 +0,0 @@ -#if __BIG_ENDIAN__ -#define __BYTE_ORDER __BIG_ENDIAN -#else -#define __BYTE_ORDER __LITTLE_ENDIAN -#endif diff --git a/libc-top-half/musl/arch/powerpc64/bits/limits.h b/libc-top-half/musl/arch/powerpc64/bits/limits.h deleted file mode 100644 index 0226588..0000000 --- a/libc-top-half/musl/arch/powerpc64/bits/limits.h +++ /dev/null @@ -1,7 +0,0 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define LONG_BIT 64 -#endif - -#define LONG_MAX 0x7fffffffffffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/powerpc64/bits/signal.h b/libc-top-half/musl/arch/powerpc64/bits/signal.h index 2cc0604..d5493b1 100644 --- a/libc-top-half/musl/arch/powerpc64/bits/signal.h +++ b/libc-top-half/musl/arch/powerpc64/bits/signal.h @@ -9,11 +9,7 @@ #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) typedef unsigned long greg_t, gregset_t[48]; - -typedef struct { - double fpregs[32]; - double fpscr; -} fpregset_t; +typedef double fpregset_t[33]; typedef struct { #ifdef __GNUC__ @@ -36,7 +32,7 @@ typedef struct sigcontext { int _pad0; unsigned long handler; unsigned long oldmask; - void *regs; + struct pt_regs *regs; gregset_t gp_regs; fpregset_t fp_regs; vrregset_t *v_regs; diff --git a/libc-top-half/musl/arch/powerpc64/bits/socket.h b/libc-top-half/musl/arch/powerpc64/bits/socket.h index 0f3c9aa..557e324 100644 --- a/libc-top-half/musl/arch/powerpc64/bits/socket.h +++ b/libc-top-half/musl/arch/powerpc64/bits/socket.h @@ -1,37 +1,3 @@ -#include - -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; -#if __BYTE_ORDER == __BIG_ENDIAN - int __pad1, msg_iovlen; -#else - int msg_iovlen, __pad1; -#endif - void *msg_control; -#if __BYTE_ORDER == __BIG_ENDIAN - int __pad2; - socklen_t msg_controllen; -#else - socklen_t msg_controllen; - int __pad2; -#endif - int msg_flags; -}; - -struct cmsghdr { -#if __BYTE_ORDER == __BIG_ENDIAN - int __pad1; - socklen_t cmsg_len; -#else - socklen_t cmsg_len; - int __pad1; -#endif - int cmsg_level; - int cmsg_type; -}; - #define SO_DEBUG 1 #define SO_REUSEADDR 2 #define SO_TYPE 3 diff --git a/libc-top-half/musl/arch/powerpc64/bits/syscall.h.in b/libc-top-half/musl/arch/powerpc64/bits/syscall.h.in index 32545b3..b935864 100644 --- a/libc-top-half/musl/arch/powerpc64/bits/syscall.h.in +++ b/libc-top-half/musl/arch/powerpc64/bits/syscall.h.in @@ -385,4 +385,6 @@ #define __NR_fsconfig 431 #define __NR_fsmount 432 #define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 diff --git a/libc-top-half/musl/arch/powerpc64/reloc.h b/libc-top-half/musl/arch/powerpc64/reloc.h index 5bdaeed..2f1bba0 100644 --- a/libc-top-half/musl/arch/powerpc64/reloc.h +++ b/libc-top-half/musl/arch/powerpc64/reloc.h @@ -1,5 +1,3 @@ -#include - #if __BYTE_ORDER == __LITTLE_ENDIAN #define ENDIAN_SUFFIX "le" #else diff --git a/libc-top-half/musl/arch/riscv64/atomic_arch.h b/libc-top-half/musl/arch/riscv64/atomic_arch.h index 41ad4d0..0c38258 100644 --- a/libc-top-half/musl/arch/riscv64/atomic_arch.h +++ b/libc-top-half/musl/arch/riscv64/atomic_arch.h @@ -15,7 +15,7 @@ static inline int a_cas(volatile int *p, int t, int s) " bnez %1, 1b\n" "1:" : "=&r"(old), "=&r"(tmp) - : "r"(p), "r"(t), "r"(s) + : "r"(p), "r"((long)t), "r"((long)s) : "memory"); return old; } diff --git a/libc-top-half/musl/arch/riscv64/bits/alltypes.h.in b/libc-top-half/musl/arch/riscv64/bits/alltypes.h.in index ae9ba41..4579d17 100644 --- a/libc-top-half/musl/arch/riscv64/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/riscv64/bits/alltypes.h.in @@ -2,8 +2,8 @@ #define _Int64 long #define _Reg long -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#define __BYTE_ORDER 1234 +#define __LONG_MAX 0x7fffffffffffffffL #ifndef __cplusplus TYPEDEF int wchar_t; @@ -16,14 +16,3 @@ TYPEDEF float float_t; TYPEDEF double double_t; TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/riscv64/bits/endian.h b/libc-top-half/musl/arch/riscv64/bits/endian.h deleted file mode 100644 index 172c338..0000000 --- a/libc-top-half/musl/arch/riscv64/bits/endian.h +++ /dev/null @@ -1 +0,0 @@ -#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/libc-top-half/musl/arch/riscv64/bits/limits.h b/libc-top-half/musl/arch/riscv64/bits/limits.h deleted file mode 100644 index 0226588..0000000 --- a/libc-top-half/musl/arch/riscv64/bits/limits.h +++ /dev/null @@ -1,7 +0,0 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define LONG_BIT 64 -#endif - -#define LONG_MAX 0x7fffffffffffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/riscv64/bits/reg.h b/libc-top-half/musl/arch/riscv64/bits/reg.h index c800788..2633f39 100644 --- a/libc-top-half/musl/arch/riscv64/bits/reg.h +++ b/libc-top-half/musl/arch/riscv64/bits/reg.h @@ -1,8 +1,2 @@ #undef __WORDSIZE #define __WORDSIZE 64 -#define REG_PC 0 -#define REG_RA 1 -#define REG_SP 2 -#define REG_TP 4 -#define REG_S0 8 -#define REG_A0 10 diff --git a/libc-top-half/musl/arch/riscv64/bits/signal.h b/libc-top-half/musl/arch/riscv64/bits/signal.h index 2ff4be3..b006334 100644 --- a/libc-top-half/musl/arch/riscv64/bits/signal.h +++ b/libc-top-half/musl/arch/riscv64/bits/signal.h @@ -35,6 +35,15 @@ typedef struct mcontext_t { union __riscv_mc_fp_state __fpregs; } mcontext_t; +#if defined(_GNU_SOURCE) +#define REG_PC 0 +#define REG_RA 1 +#define REG_SP 2 +#define REG_TP 4 +#define REG_S0 8 +#define REG_A0 10 +#endif + #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) typedef unsigned long greg_t; typedef unsigned long gregset_t[32]; diff --git a/libc-top-half/musl/arch/riscv64/bits/socket.h b/libc-top-half/musl/arch/riscv64/bits/socket.h deleted file mode 100644 index aae537d..0000000 --- a/libc-top-half/musl/arch/riscv64/bits/socket.h +++ /dev/null @@ -1,19 +0,0 @@ -#include - -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen, __pad1; - void *msg_control; - socklen_t msg_controllen; - int __pad2; - int msg_flags; -}; - -struct cmsghdr { - socklen_t cmsg_len; - int __pad1; - int cmsg_level; - int cmsg_type; -}; diff --git a/libc-top-half/musl/arch/riscv64/bits/syscall.h.in b/libc-top-half/musl/arch/riscv64/bits/syscall.h.in index 1db70cf..0043eeb 100644 --- a/libc-top-half/musl/arch/riscv64/bits/syscall.h.in +++ b/libc-top-half/musl/arch/riscv64/bits/syscall.h.in @@ -287,6 +287,8 @@ #define __NR_fsconfig 431 #define __NR_fsmount 432 #define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 #define __NR_sysriscv __NR_arch_specific_syscall #define __NR_riscv_flush_icache (__NR_sysriscv + 15) diff --git a/libc-top-half/musl/arch/s390x/bits/alltypes.h.in b/libc-top-half/musl/arch/s390x/bits/alltypes.h.in index 1a83846..15d18c8 100644 --- a/libc-top-half/musl/arch/s390x/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/s390x/bits/alltypes.h.in @@ -2,8 +2,8 @@ #define _Int64 long #define _Reg long -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#define __BYTE_ORDER 4321 +#define __LONG_MAX 0x7fffffffffffffffL #ifndef __cplusplus TYPEDEF int wchar_t; @@ -13,14 +13,3 @@ TYPEDEF double float_t; TYPEDEF double double_t; TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/s390x/bits/endian.h b/libc-top-half/musl/arch/s390x/bits/endian.h deleted file mode 100644 index ef074b7..0000000 --- a/libc-top-half/musl/arch/s390x/bits/endian.h +++ /dev/null @@ -1 +0,0 @@ -#define __BYTE_ORDER __BIG_ENDIAN diff --git a/libc-top-half/musl/arch/s390x/bits/limits.h b/libc-top-half/musl/arch/s390x/bits/limits.h index 86ef766..07743b6 100644 --- a/libc-top-half/musl/arch/s390x/bits/limits.h +++ b/libc-top-half/musl/arch/s390x/bits/limits.h @@ -1,8 +1 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define PAGESIZE 4096 -#define LONG_BIT 64 -#endif - -#define LONG_MAX 0x7fffffffffffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/s390x/bits/socket.h b/libc-top-half/musl/arch/s390x/bits/socket.h deleted file mode 100644 index bd4b20c..0000000 --- a/libc-top-half/musl/arch/s390x/bits/socket.h +++ /dev/null @@ -1,17 +0,0 @@ -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int __pad1, msg_iovlen; - void *msg_control; - int __pad2; - socklen_t msg_controllen; - int msg_flags; -}; - -struct cmsghdr { - int __pad1; - socklen_t cmsg_len; - int cmsg_level; - int cmsg_type; -}; diff --git a/libc-top-half/musl/arch/s390x/bits/syscall.h.in b/libc-top-half/musl/arch/s390x/bits/syscall.h.in index c4c7047..e89f378 100644 --- a/libc-top-half/musl/arch/s390x/bits/syscall.h.in +++ b/libc-top-half/musl/arch/s390x/bits/syscall.h.in @@ -350,4 +350,6 @@ #define __NR_fsconfig 431 #define __NR_fsmount 432 #define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 diff --git a/libc-top-half/musl/arch/s390x/reloc.h b/libc-top-half/musl/arch/s390x/reloc.h index a238dc6..6e5c1fb 100644 --- a/libc-top-half/musl/arch/s390x/reloc.h +++ b/libc-top-half/musl/arch/s390x/reloc.h @@ -1,5 +1,3 @@ -#include - #define LDSO_ARCH "s390x" #define REL_SYMBOLIC R_390_64 diff --git a/libc-top-half/musl/arch/sh/arch.mak b/libc-top-half/musl/arch/sh/arch.mak new file mode 100644 index 0000000..aa4d05c --- /dev/null +++ b/libc-top-half/musl/arch/sh/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/libc-top-half/musl/arch/sh/bits/alltypes.h.in b/libc-top-half/musl/arch/sh/bits/alltypes.h.in index 8e687ef..6a53835 100644 --- a/libc-top-half/musl/arch/sh/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/sh/bits/alltypes.h.in @@ -1,9 +1,15 @@ +#define _REDIR_TIME64 1 #define _Addr int #define _Int64 long long #define _Reg int -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#if __BIG_ENDIAN__ +#define __BYTE_ORDER 4321 +#else +#define __BYTE_ORDER 1234 +#endif + +#define __LONG_MAX 0x7fffffffL #ifndef __cplusplus #ifdef __WCHAR_TYPE__ @@ -17,14 +23,3 @@ TYPEDEF float float_t; TYPEDEF double double_t; TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/sh/bits/endian.h b/libc-top-half/musl/arch/sh/bits/endian.h deleted file mode 100644 index 2016cb2..0000000 --- a/libc-top-half/musl/arch/sh/bits/endian.h +++ /dev/null @@ -1,5 +0,0 @@ -#if __BIG_ENDIAN__ -#define __BYTE_ORDER __BIG_ENDIAN -#else -#define __BYTE_ORDER __LITTLE_ENDIAN -#endif diff --git a/libc-top-half/musl/arch/sh/bits/ioctl.h b/libc-top-half/musl/arch/sh/bits/ioctl.h index c430565..370b690 100644 --- a/libc-top-half/musl/arch/sh/bits/ioctl.h +++ b/libc-top-half/musl/arch/sh/bits/ioctl.h @@ -108,5 +108,5 @@ #define SIOCATMARK _IOR('s', 7, int) #define SIOCSPGRP _IOW('s', 8, int) #define SIOCGPGRP _IOW('s', 9, int) -#define SIOCGSTAMP _IOR('s', 100, char[8]) -#define SIOCGSTAMPNS _IOR('s', 101, char[8]) +#define SIOCGSTAMP _IOR(0x89, 6, char[16]) +#define SIOCGSTAMPNS _IOR(0x89, 7, char[16]) diff --git a/libc-top-half/musl/arch/sh/bits/ipcstat.h b/libc-top-half/musl/arch/sh/bits/ipcstat.h index 0018ad1..4f4fcb0 100644 --- a/libc-top-half/musl/arch/sh/bits/ipcstat.h +++ b/libc-top-half/musl/arch/sh/bits/ipcstat.h @@ -1 +1 @@ -#define IPC_STAT 2 +#define IPC_STAT 0x102 diff --git a/libc-top-half/musl/arch/sh/bits/limits.h b/libc-top-half/musl/arch/sh/bits/limits.h index c340ceb..07743b6 100644 --- a/libc-top-half/musl/arch/sh/bits/limits.h +++ b/libc-top-half/musl/arch/sh/bits/limits.h @@ -1,8 +1 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define PAGESIZE 4096 -#define LONG_BIT 32 -#endif - -#define LONG_MAX 0x7fffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/sh/bits/msg.h b/libc-top-half/musl/arch/sh/bits/msg.h index bc8436c..7bbbb2b 100644 --- a/libc-top-half/musl/arch/sh/bits/msg.h +++ b/libc-top-half/musl/arch/sh/bits/msg.h @@ -1,15 +1,18 @@ struct msqid_ds { struct ipc_perm msg_perm; - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; + unsigned long __msg_stime_lo; + unsigned long __msg_stime_hi; + unsigned long __msg_rtime_lo; + unsigned long __msg_rtime_hi; + unsigned long __msg_ctime_lo; + unsigned long __msg_ctime_hi; unsigned long msg_cbytes; msgqnum_t msg_qnum; msglen_t msg_qbytes; pid_t msg_lspid; pid_t msg_lrpid; unsigned long __unused[2]; + time_t msg_stime; + time_t msg_rtime; + time_t msg_ctime; }; diff --git a/libc-top-half/musl/arch/sh/bits/sem.h b/libc-top-half/musl/arch/sh/bits/sem.h index d383d4e..544e3d2 100644 --- a/libc-top-half/musl/arch/sh/bits/sem.h +++ b/libc-top-half/musl/arch/sh/bits/sem.h @@ -1,9 +1,9 @@ struct semid_ds { struct ipc_perm sem_perm; - time_t sem_otime; - long __unused1; - time_t sem_ctime; - long __unused2; + unsigned long __sem_otime_lo; + unsigned long __sem_otime_hi; + unsigned long __sem_ctime_lo; + unsigned long __sem_ctime_hi; #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned short sem_nsems; char __sem_nsems_pad[sizeof(long)-sizeof(short)]; @@ -13,4 +13,6 @@ struct semid_ds { #endif long __unused3; long __unused4; + time_t sem_otime; + time_t sem_ctime; }; diff --git a/libc-top-half/musl/arch/sh/bits/shm.h b/libc-top-half/musl/arch/sh/bits/shm.h index 6cdac13..adc01e3 100644 --- a/libc-top-half/musl/arch/sh/bits/shm.h +++ b/libc-top-half/musl/arch/sh/bits/shm.h @@ -3,17 +3,21 @@ struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; - time_t shm_atime; - int __unused1; - time_t shm_dtime; - int __unused2; - time_t shm_ctime; - int __unused3; + unsigned long __shm_atime_lo; + unsigned long __shm_atime_hi; + unsigned long __shm_dtime_lo; + unsigned long __shm_dtime_hi; + unsigned long __shm_ctime_lo; + unsigned long __shm_ctime_hi; pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; unsigned long __pad1; unsigned long __pad2; + unsigned long __pad3; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; }; struct shminfo { diff --git a/libc-top-half/musl/arch/sh/bits/stat.h b/libc-top-half/musl/arch/sh/bits/stat.h index 22b19bb..5d7828c 100644 --- a/libc-top-half/musl/arch/sh/bits/stat.h +++ b/libc-top-half/musl/arch/sh/bits/stat.h @@ -14,8 +14,12 @@ struct stat { off_t st_size; blksize_t st_blksize; blkcnt_t st_blocks; + struct { + long tv_sec; + long tv_nsec; + } __st_atim32, __st_mtim32, __st_ctim32; + ino_t st_ino; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; - ino_t st_ino; }; diff --git a/libc-top-half/musl/arch/sh/bits/syscall.h.in b/libc-top-half/musl/arch/sh/bits/syscall.h.in index 4705ef9..0102dda 100644 --- a/libc-top-half/musl/arch/sh/bits/syscall.h.in +++ b/libc-top-half/musl/arch/sh/bits/syscall.h.in @@ -67,8 +67,8 @@ #define __NR_setrlimit 75 #define __NR_getrlimit 76 #define __NR_getrusage 77 -#define __NR_gettimeofday 78 -#define __NR_settimeofday 79 +#define __NR_gettimeofday_time32 78 +#define __NR_settimeofday_time32 79 #define __NR_getgroups 80 #define __NR_setgroups 81 #define __NR_symlink 83 @@ -231,14 +231,14 @@ #define __NR_remap_file_pages 257 #define __NR_set_tid_address 258 #define __NR_timer_create 259 -#define __NR_timer_settime 260 -#define __NR_timer_gettime 261 +#define __NR_timer_settime32 260 +#define __NR_timer_gettime32 261 #define __NR_timer_getoverrun 262 #define __NR_timer_delete 263 -#define __NR_clock_settime 264 -#define __NR_clock_gettime 265 -#define __NR_clock_getres 266 -#define __NR_clock_nanosleep 267 +#define __NR_clock_settime32 264 +#define __NR_clock_gettime32 265 +#define __NR_clock_getres_time32 266 +#define __NR_clock_nanosleep_time32 267 #define __NR_statfs64 268 #define __NR_fstatfs64 269 #define __NR_tgkill 270 @@ -294,8 +294,8 @@ #define __NR_timerfd_create 322 #define __NR_eventfd 323 #define __NR_fallocate 324 -#define __NR_timerfd_settime 325 -#define __NR_timerfd_gettime 326 +#define __NR_timerfd_settime32 325 +#define __NR_timerfd_gettime32 326 #define __NR_signalfd4 327 #define __NR_eventfd2 328 #define __NR_epoll_create1 329 @@ -397,4 +397,5 @@ #define __NR_fsconfig 431 #define __NR_fsmount 432 #define __NR_fspick 433 +#define __NR_pidfd_open 434 diff --git a/libc-top-half/musl/arch/sh/reloc.h b/libc-top-half/musl/arch/sh/reloc.h index a1f16cb..17b1a9a 100644 --- a/libc-top-half/musl/arch/sh/reloc.h +++ b/libc-top-half/musl/arch/sh/reloc.h @@ -1,5 +1,3 @@ -#include - #if __BYTE_ORDER == __BIG_ENDIAN #define ENDIAN_SUFFIX "eb" #else diff --git a/libc-top-half/musl/arch/wasm32/bits/alltypes.h.in b/libc-top-half/musl/arch/wasm32/bits/alltypes.h.in index 1b4fe67..5dcfc9a 100644 --- a/libc-top-half/musl/arch/wasm32/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/wasm32/bits/alltypes.h.in @@ -2,18 +2,15 @@ #define _Int64 long long #define _Reg long long +#define __BYTE_ORDER __BYTE_ORDER__ + +#define __LONG_MAX __LONG_MAX__ + /* * Rather than define everything ourselves here in the musl layer, for * WASI, reference the definitions in the lower layers. */ -#if defined(__NEED_va_list) && !defined(__DEFINED_va_list) -#include -#define __DEFINED_va_list -#endif - -TYPEDEF __builtin_va_list __isoc_va_list; - #if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) #define __need_wchar_t #include @@ -59,12 +56,3 @@ TYPEDEF double double_t; #include <__typedef_clock_t.h> #define __DEFINED_clock_t #endif - -/* TODO: Threads support. */ -TYPEDEF unsigned char pthread_attr_t; -TYPEDEF unsigned char pthread_mutex_t; -TYPEDEF unsigned char mtx_t; -TYPEDEF unsigned char pthread_cond_t; -TYPEDEF unsigned char cnd_t; -TYPEDEF unsigned char pthread_rwlock_t; -TYPEDEF unsigned char pthread_barrier_t; diff --git a/libc-top-half/musl/arch/wasm32/bits/dirent.h b/libc-top-half/musl/arch/wasm32/bits/dirent.h new file mode 100644 index 0000000..55f2bc9 --- /dev/null +++ b/libc-top-half/musl/arch/wasm32/bits/dirent.h @@ -0,0 +1 @@ +#include <__struct_dirent.h> diff --git a/libc-top-half/musl/arch/wasm32/bits/endian.h b/libc-top-half/musl/arch/wasm32/bits/endian.h deleted file mode 100644 index 172c338..0000000 --- a/libc-top-half/musl/arch/wasm32/bits/endian.h +++ /dev/null @@ -1 +0,0 @@ -#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/libc-top-half/musl/arch/wasm32/bits/limits.h b/libc-top-half/musl/arch/wasm32/bits/limits.h index 0589f25..801bc48 100644 --- a/libc-top-half/musl/arch/wasm32/bits/limits.h +++ b/libc-top-half/musl/arch/wasm32/bits/limits.h @@ -1,8 +1 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #include <__macro_PAGESIZE.h> -#define LONG_BIT (32) -#endif - -#define LONG_MAX (0x7fffffffL) -#define LLONG_MAX (0x7fffffffffffffffLL) diff --git a/libc-top-half/musl/arch/wasm32/bits/socket.h b/libc-top-half/musl/arch/wasm32/bits/socket.h deleted file mode 100644 index d8ea454..0000000 --- a/libc-top-half/musl/arch/wasm32/bits/socket.h +++ /dev/null @@ -1 +0,0 @@ -#include <__struct_msghdr.h> diff --git a/libc-top-half/musl/arch/x32/bits/alltypes.h.in b/libc-top-half/musl/arch/x32/bits/alltypes.h.in index c612eec..9f9d241 100644 --- a/libc-top-half/musl/arch/x32/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/x32/bits/alltypes.h.in @@ -2,8 +2,8 @@ #define _Int64 long long #define _Reg long long -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#define __BYTE_ORDER 1234 +#define __LONG_MAX 0x7fffffffL #ifndef __cplusplus #ifdef __WCHAR_TYPE__ @@ -22,14 +22,3 @@ TYPEDEF double double_t; #endif TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long long time_t; -TYPEDEF long long suseconds_t; - -TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/x32/bits/endian.h b/libc-top-half/musl/arch/x32/bits/endian.h deleted file mode 100644 index 172c338..0000000 --- a/libc-top-half/musl/arch/x32/bits/endian.h +++ /dev/null @@ -1 +0,0 @@ -#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/libc-top-half/musl/arch/x32/bits/ioctl_fix.h b/libc-top-half/musl/arch/x32/bits/ioctl_fix.h new file mode 100644 index 0000000..83b957b --- /dev/null +++ b/libc-top-half/musl/arch/x32/bits/ioctl_fix.h @@ -0,0 +1,4 @@ +#undef SIOCGSTAMP +#undef SIOCGSTAMPNS +#define SIOCGSTAMP 0x8906 +#define SIOCGSTAMPNS 0x8907 diff --git a/libc-top-half/musl/arch/x32/bits/limits.h b/libc-top-half/musl/arch/x32/bits/limits.h index c340ceb..07743b6 100644 --- a/libc-top-half/musl/arch/x32/bits/limits.h +++ b/libc-top-half/musl/arch/x32/bits/limits.h @@ -1,8 +1 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define PAGESIZE 4096 -#define LONG_BIT 32 -#endif - -#define LONG_MAX 0x7fffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/x32/bits/socket.h b/libc-top-half/musl/arch/x32/bits/socket.h index a4c89f3..8d83001 100644 --- a/libc-top-half/musl/arch/x32/bits/socket.h +++ b/libc-top-half/musl/arch/x32/bits/socket.h @@ -1,16 +1,5 @@ -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen, __pad1; - void *msg_control; - socklen_t msg_controllen, __pad2; - int msg_flags; -}; - -struct cmsghdr { - socklen_t cmsg_len; - int __pad1; - int cmsg_level; - int cmsg_type; -}; +#define SO_RCVTIMEO 20 +#define SO_SNDTIMEO 21 +#define SO_TIMESTAMP 29 +#define SO_TIMESTAMPNS 35 +#define SO_TIMESTAMPING 37 diff --git a/libc-top-half/musl/arch/x32/bits/syscall.h.in b/libc-top-half/musl/arch/x32/bits/syscall.h.in index 4d72852..f47bdee 100644 --- a/libc-top-half/musl/arch/x32/bits/syscall.h.in +++ b/libc-top-half/musl/arch/x32/bits/syscall.h.in @@ -296,6 +296,9 @@ #define __NR_fsconfig (0x40000000 + 431) #define __NR_fsmount (0x40000000 + 432) #define __NR_fspick (0x40000000 + 433) +#define __NR_pidfd_open (0x40000000 + 434) +#define __NR_clone3 (0x40000000 + 435) + #define __NR_rt_sigaction (0x40000000 + 512) #define __NR_rt_sigreturn (0x40000000 + 513) diff --git a/libc-top-half/musl/arch/x32/syscall_arch.h b/libc-top-half/musl/arch/x32/syscall_arch.h index e0a2216..e0111cc 100644 --- a/libc-top-half/musl/arch/x32/syscall_arch.h +++ b/libc-top-half/musl/arch/x32/syscall_arch.h @@ -87,5 +87,7 @@ static __inline long __syscall6(long long n, long long a1, long long a2, long lo #define SYS_rt_sigtimedwait_time64 SYS_rt_sigtimedwait #define SYS_futex_time64 SYS_futex #define SYS_sched_rr_get_interval_time64 SYS_sched_rr_get_interval +#define SYS_getrusage_time64 SYS_getrusage +#define SYS_wait4_time64 SYS_wait4 #define IPC_64 0 diff --git a/libc-top-half/musl/arch/x86_64/bits/alltypes.h.in b/libc-top-half/musl/arch/x86_64/bits/alltypes.h.in index dc551d4..5cd8a29 100644 --- a/libc-top-half/musl/arch/x86_64/bits/alltypes.h.in +++ b/libc-top-half/musl/arch/x86_64/bits/alltypes.h.in @@ -2,8 +2,8 @@ #define _Int64 long #define _Reg long -TYPEDEF __builtin_va_list va_list; -TYPEDEF __builtin_va_list __isoc_va_list; +#define __BYTE_ORDER 1234 +#define __LONG_MAX 0x7fffffffffffffffL #ifndef __cplusplus TYPEDEF int wchar_t; @@ -18,14 +18,3 @@ TYPEDEF double double_t; #endif TYPEDEF struct { long long __ll; long double __ld; } max_align_t; - -TYPEDEF long time_t; -TYPEDEF long suseconds_t; - -TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; -TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; -TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; -TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; -TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; -TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; diff --git a/libc-top-half/musl/arch/x86_64/bits/endian.h b/libc-top-half/musl/arch/x86_64/bits/endian.h deleted file mode 100644 index 172c338..0000000 --- a/libc-top-half/musl/arch/x86_64/bits/endian.h +++ /dev/null @@ -1 +0,0 @@ -#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/libc-top-half/musl/arch/x86_64/bits/limits.h b/libc-top-half/musl/arch/x86_64/bits/limits.h index 86ef766..07743b6 100644 --- a/libc-top-half/musl/arch/x86_64/bits/limits.h +++ b/libc-top-half/musl/arch/x86_64/bits/limits.h @@ -1,8 +1 @@ -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define PAGESIZE 4096 -#define LONG_BIT 64 -#endif - -#define LONG_MAX 0x7fffffffffffffffL -#define LLONG_MAX 0x7fffffffffffffffLL diff --git a/libc-top-half/musl/arch/x86_64/bits/socket.h b/libc-top-half/musl/arch/x86_64/bits/socket.h deleted file mode 100644 index a4c89f3..0000000 --- a/libc-top-half/musl/arch/x86_64/bits/socket.h +++ /dev/null @@ -1,16 +0,0 @@ -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen, __pad1; - void *msg_control; - socklen_t msg_controllen, __pad2; - int msg_flags; -}; - -struct cmsghdr { - socklen_t cmsg_len; - int __pad1; - int cmsg_level; - int cmsg_type; -}; diff --git a/libc-top-half/musl/arch/x86_64/bits/syscall.h.in b/libc-top-half/musl/arch/x86_64/bits/syscall.h.in index 2d4634f..6a646ad 100644 --- a/libc-top-half/musl/arch/x86_64/bits/syscall.h.in +++ b/libc-top-half/musl/arch/x86_64/bits/syscall.h.in @@ -343,4 +343,6 @@ #define __NR_fsconfig 431 #define __NR_fsmount 432 #define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 diff --git a/libc-top-half/musl/compat/time32/__xstat.c b/libc-top-half/musl/compat/time32/__xstat.c new file mode 100644 index 0000000..acfbd3c --- /dev/null +++ b/libc-top-half/musl/compat/time32/__xstat.c @@ -0,0 +1,24 @@ +#include "time32.h" +#include + +struct stat32; + +int __fxstat64(int ver, int fd, struct stat32 *buf) +{ + return __fstat_time32(fd, buf); +} + +int __fxstatat64(int ver, int fd, const char *path, struct stat32 *buf, int flag) +{ + return __fstatat_time32(fd, path, buf, flag); +} + +int __lxstat64(int ver, const char *path, struct stat32 *buf) +{ + return __lstat_time32(path, buf); +} + +int __xstat64(int ver, const char *path, struct stat32 *buf) +{ + return __stat_time32(path, buf); +} diff --git a/libc-top-half/musl/compat/time32/adjtime32.c b/libc-top-half/musl/compat/time32/adjtime32.c new file mode 100644 index 0000000..b0042c6 --- /dev/null +++ b/libc-top-half/musl/compat/time32/adjtime32.c @@ -0,0 +1,21 @@ +#define _GNU_SOURCE +#include "time32.h" +#include +#include +#include + +int __adjtime32(const struct timeval32 *in32, struct timeval32 *out32) +{ + struct timeval out; + int r = adjtime((&(struct timeval){ + .tv_sec = in32->tv_sec, + .tv_usec = in32->tv_usec}), &out); + if (r) return r; + /* We can't range-check the result because success was already + * committed by the above call. */ + if (out32) { + out32->tv_sec = out.tv_sec; + out32->tv_usec = out.tv_usec; + } + return r; +} diff --git a/libc-top-half/musl/compat/time32/adjtimex_time32.c b/libc-top-half/musl/compat/time32/adjtimex_time32.c new file mode 100644 index 0000000..9c6f190 --- /dev/null +++ b/libc-top-half/musl/compat/time32/adjtimex_time32.c @@ -0,0 +1,10 @@ +#include "time32.h" +#include +#include + +struct timex32; + +int __adjtimex_time32(struct timex32 *tx32) +{ + return __clock_adjtime32(CLOCK_REALTIME, tx32); +} diff --git a/libc-top-half/musl/compat/time32/aio_suspend_time32.c b/libc-top-half/musl/compat/time32/aio_suspend_time32.c new file mode 100644 index 0000000..ed5119b --- /dev/null +++ b/libc-top-half/musl/compat/time32/aio_suspend_time32.c @@ -0,0 +1,11 @@ +#include "time32.h" +#include +#include + +int __aio_suspend_time32(const struct aiocb *const cbs[], int cnt, const struct timespec32 *ts32) +{ + return aio_suspend(cbs, cnt, ts32 ? (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0); +} + +weak_alias(aio_suspend, aio_suspend64); diff --git a/libc-top-half/musl/compat/time32/clock_adjtime32.c b/libc-top-half/musl/compat/time32/clock_adjtime32.c new file mode 100644 index 0000000..5a25b8a --- /dev/null +++ b/libc-top-half/musl/compat/time32/clock_adjtime32.c @@ -0,0 +1,70 @@ +#include "time32.h" +#include +#include +#include +#include +#include + +struct timex32 { + unsigned modes; + long offset, freq, maxerror, esterror; + int status; + long constant, precision, tolerance; + struct timeval32 time; + long tick, ppsfreq, jitter; + int shift; + long stabil, jitcnt, calcnt, errcnt, stbcnt; + int tai; + int __padding[11]; +}; + +int __clock_adjtime32(clockid_t clock_id, struct timex32 *tx32) +{ + struct timex utx = { + .modes = tx32->modes, + .offset = tx32->offset, + .freq = tx32->freq, + .maxerror = tx32->maxerror, + .esterror = tx32->esterror, + .status = tx32->status, + .constant = tx32->constant, + .precision = tx32->precision, + .tolerance = tx32->tolerance, + .time.tv_sec = tx32->time.tv_sec, + .time.tv_usec = tx32->time.tv_usec, + .tick = tx32->tick, + .ppsfreq = tx32->ppsfreq, + .jitter = tx32->jitter, + .shift = tx32->shift, + .stabil = tx32->stabil, + .jitcnt = tx32->jitcnt, + .calcnt = tx32->calcnt, + .errcnt = tx32->errcnt, + .stbcnt = tx32->stbcnt, + .tai = tx32->tai, + }; + int r = clock_adjtime(clock_id, &utx); + if (r<0) return r; + tx32->modes = utx.modes; + tx32->offset = utx.offset; + tx32->freq = utx.freq; + tx32->maxerror = utx.maxerror; + tx32->esterror = utx.esterror; + tx32->status = utx.status; + tx32->constant = utx.constant; + tx32->precision = utx.precision; + tx32->tolerance = utx.tolerance; + tx32->time.tv_sec = utx.time.tv_sec; + tx32->time.tv_usec = utx.time.tv_usec; + tx32->tick = utx.tick; + tx32->ppsfreq = utx.ppsfreq; + tx32->jitter = utx.jitter; + tx32->shift = utx.shift; + tx32->stabil = utx.stabil; + tx32->jitcnt = utx.jitcnt; + tx32->calcnt = utx.calcnt; + tx32->errcnt = utx.errcnt; + tx32->stbcnt = utx.stbcnt; + tx32->tai = utx.tai; + return r; +} diff --git a/libc-top-half/musl/compat/time32/clock_getres_time32.c b/libc-top-half/musl/compat/time32/clock_getres_time32.c new file mode 100644 index 0000000..47a24c1 --- /dev/null +++ b/libc-top-half/musl/compat/time32/clock_getres_time32.c @@ -0,0 +1,13 @@ +#include "time32.h" +#include + +int __clock_getres_time32(clockid_t clk, struct timespec32 *ts32) +{ + struct timespec ts; + int r = clock_getres(clk, &ts); + if (!r && ts32) { + ts32->tv_sec = ts.tv_sec; + ts32->tv_nsec = ts.tv_nsec; + } + return r; +} diff --git a/libc-top-half/musl/compat/time32/clock_gettime32.c b/libc-top-half/musl/compat/time32/clock_gettime32.c new file mode 100644 index 0000000..0cac7bb --- /dev/null +++ b/libc-top-half/musl/compat/time32/clock_gettime32.c @@ -0,0 +1,18 @@ +#include "time32.h" +#include +#include +#include + +int __clock_gettime32(clockid_t clk, struct timespec32 *ts32) +{ + struct timespec ts; + int r = clock_gettime(clk, &ts); + if (r) return r; + if (ts.tv_sec < INT32_MIN || ts.tv_sec > INT32_MAX) { + errno = EOVERFLOW; + return -1; + } + ts32->tv_sec = ts.tv_sec; + ts32->tv_nsec = ts.tv_nsec; + return 0; +} diff --git a/libc-top-half/musl/compat/time32/clock_nanosleep_time32.c b/libc-top-half/musl/compat/time32/clock_nanosleep_time32.c new file mode 100644 index 0000000..91ef067 --- /dev/null +++ b/libc-top-half/musl/compat/time32/clock_nanosleep_time32.c @@ -0,0 +1,15 @@ +#include "time32.h" +#include +#include + +int __clock_nanosleep_time32(clockid_t clk, int flags, const struct timespec32 *req32, struct timespec32 *rem32) +{ + struct timespec rem; + int ret = clock_nanosleep(clk, flags, (&(struct timespec){ + .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem); + if (ret==EINTR && rem32 && !(flags & TIMER_ABSTIME)) { + rem32->tv_sec = rem.tv_sec; + rem32->tv_nsec = rem.tv_nsec; + } + return ret; +} diff --git a/libc-top-half/musl/compat/time32/clock_settime32.c b/libc-top-half/musl/compat/time32/clock_settime32.c new file mode 100644 index 0000000..7ca4f0e --- /dev/null +++ b/libc-top-half/musl/compat/time32/clock_settime32.c @@ -0,0 +1,9 @@ +#include "time32.h" +#include + +int __clock_settime32(clockid_t clk, const struct timespec32 *ts32) +{ + return clock_settime(clk, (&(struct timespec){ + .tv_sec = ts32->tv_sec, + .tv_nsec = ts32->tv_nsec})); +} diff --git a/libc-top-half/musl/compat/time32/cnd_timedwait_time32.c b/libc-top-half/musl/compat/time32/cnd_timedwait_time32.c new file mode 100644 index 0000000..314251d --- /dev/null +++ b/libc-top-half/musl/compat/time32/cnd_timedwait_time32.c @@ -0,0 +1,9 @@ +#include "time32.h" +#include +#include + +int __cnd_timedwait_time32(cnd_t *restrict c, mtx_t *restrict m, const struct timespec32 *restrict ts32) +{ + return cnd_timedwait(c, m, ts32 ? (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0); +} diff --git a/libc-top-half/musl/compat/time32/ctime32.c b/libc-top-half/musl/compat/time32/ctime32.c new file mode 100644 index 0000000..a057274 --- /dev/null +++ b/libc-top-half/musl/compat/time32/ctime32.c @@ -0,0 +1,7 @@ +#include "time32.h" +#include + +char *__ctime32(time32_t *t) +{ + return ctime(&(time_t){*t}); +} diff --git a/libc-top-half/musl/compat/time32/ctime32_r.c b/libc-top-half/musl/compat/time32/ctime32_r.c new file mode 100644 index 0000000..e1ad2e2 --- /dev/null +++ b/libc-top-half/musl/compat/time32/ctime32_r.c @@ -0,0 +1,7 @@ +#include "time32.h" +#include + +char *__ctime32_r(time32_t *t, char *buf) +{ + return ctime_r(&(time_t){*t}, buf); +} diff --git a/libc-top-half/musl/compat/time32/difftime32.c b/libc-top-half/musl/compat/time32/difftime32.c new file mode 100644 index 0000000..5950943 --- /dev/null +++ b/libc-top-half/musl/compat/time32/difftime32.c @@ -0,0 +1,7 @@ +#include "time32.h" +#include + +double __difftime32(time32_t t1, time32_t t2) +{ + return difftime(t1, t2); +} diff --git a/libc-top-half/musl/compat/time32/fstat_time32.c b/libc-top-half/musl/compat/time32/fstat_time32.c new file mode 100644 index 0000000..3e08439 --- /dev/null +++ b/libc-top-half/musl/compat/time32/fstat_time32.c @@ -0,0 +1,17 @@ +#include "time32.h" +#include +#include +#include +#include + +struct stat32; + +int __fstat_time32(int fd, struct stat32 *restrict st32) +{ + struct stat st; + int r = fstat(fd, &st); + if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim)); + return r; +} + +weak_alias(fstat, fstat64); diff --git a/libc-top-half/musl/compat/time32/fstatat_time32.c b/libc-top-half/musl/compat/time32/fstatat_time32.c new file mode 100644 index 0000000..85dcb00 --- /dev/null +++ b/libc-top-half/musl/compat/time32/fstatat_time32.c @@ -0,0 +1,17 @@ +#include "time32.h" +#include +#include +#include +#include + +struct stat32; + +int __fstatat_time32(int fd, const char *restrict path, struct stat32 *restrict st32, int flag) +{ + struct stat st; + int r = fstatat(fd, path, &st, flag); + if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim)); + return r; +} + +weak_alias(fstatat, fstatat64); diff --git a/libc-top-half/musl/compat/time32/ftime32.c b/libc-top-half/musl/compat/time32/ftime32.c new file mode 100644 index 0000000..166a6da --- /dev/null +++ b/libc-top-half/musl/compat/time32/ftime32.c @@ -0,0 +1,25 @@ +#include "time32.h" +#include +#include +#include + +struct timeb32 { + int32_t time; + unsigned short millitm; + short timezone, dstflag; +}; + +int __ftime32(struct timeb32 *tp) +{ + struct timeb tb; + if (ftime(&tb) < 0) return -1; + if (tb.time < INT32_MIN || tb.time > INT32_MAX) { + errno = EOVERFLOW; + return -1; + } + tp->time = tb.time; + tp->millitm = tb.millitm; + tp->timezone = tb.timezone; + tp->dstflag = tb.dstflag; + return 0; +} diff --git a/libc-top-half/musl/compat/time32/futimens_time32.c b/libc-top-half/musl/compat/time32/futimens_time32.c new file mode 100644 index 0000000..7856f17 --- /dev/null +++ b/libc-top-half/musl/compat/time32/futimens_time32.c @@ -0,0 +1,10 @@ +#include "time32.h" +#include +#include + +int __futimens_time32(int fd, const struct timespec32 *times32) +{ + return futimens(fd, !times32 ? 0 : ((struct timespec[2]){ + {.tv_sec = times32[0].tv_sec,.tv_nsec = times32[0].tv_nsec}, + {.tv_sec = times32[1].tv_sec,.tv_nsec = times32[1].tv_nsec}})); +} diff --git a/libc-top-half/musl/compat/time32/futimes_time32.c b/libc-top-half/musl/compat/time32/futimes_time32.c new file mode 100644 index 0000000..f29533f --- /dev/null +++ b/libc-top-half/musl/compat/time32/futimes_time32.c @@ -0,0 +1,12 @@ +#define _GNU_SOURCE +#include "time32.h" +#include +#include +#include + +int __futimes_time32(int fd, const struct timeval32 times32[2]) +{ + return futimes(fd, !times32 ? 0 : ((struct timeval[2]){ + {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec}, + {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}})); +} diff --git a/libc-top-half/musl/compat/time32/futimesat_time32.c b/libc-top-half/musl/compat/time32/futimesat_time32.c new file mode 100644 index 0000000..5a1295b --- /dev/null +++ b/libc-top-half/musl/compat/time32/futimesat_time32.c @@ -0,0 +1,12 @@ +#define _GNU_SOURCE +#include "time32.h" +#include +#include +#include + +int __futimesat_time32(int dirfd, const char *pathname, const struct timeval32 times32[2]) +{ + return futimesat(dirfd, pathname, !times32 ? 0 : ((struct timeval[2]){ + {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec}, + {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}})); +} diff --git a/libc-top-half/musl/compat/time32/getitimer_time32.c b/libc-top-half/musl/compat/time32/getitimer_time32.c new file mode 100644 index 0000000..4bac4bf --- /dev/null +++ b/libc-top-half/musl/compat/time32/getitimer_time32.c @@ -0,0 +1,15 @@ +#include "time32.h" +#include +#include + +int __getitimer_time32(int which, struct itimerval32 *old32) +{ + struct itimerval old; + int r = getitimer(which, &old); + if (r) return r; + old32->it_interval.tv_sec = old.it_interval.tv_sec; + old32->it_interval.tv_usec = old.it_interval.tv_usec; + old32->it_value.tv_sec = old.it_value.tv_sec; + old32->it_value.tv_usec = old.it_value.tv_usec; + return 0; +} diff --git a/libc-top-half/musl/compat/time32/getrusage_time32.c b/libc-top-half/musl/compat/time32/getrusage_time32.c new file mode 100644 index 0000000..d7487de --- /dev/null +++ b/libc-top-half/musl/compat/time32/getrusage_time32.c @@ -0,0 +1,39 @@ +#include "time32.h" +#include +#include +#include + +struct compat_rusage { + struct timeval32 ru_utime; + struct timeval32 ru_stime; + long ru_maxrss; + long ru_ixrss; + long ru_idrss; + long ru_isrss; + long ru_minflt; + long ru_majflt; + long ru_nswap; + long ru_inblock; + long ru_oublock; + long ru_msgsnd; + long ru_msgrcv; + long ru_nsignals; + long ru_nvcsw; + long ru_nivcsw; +}; + +int __getrusage_time32(int who, struct compat_rusage *usage) +{ + struct rusage ru; + int r = getrusage(who, &ru); + if (!r) { + usage->ru_utime.tv_sec = ru.ru_utime.tv_sec; + usage->ru_utime.tv_usec = ru.ru_utime.tv_usec; + usage->ru_stime.tv_sec = ru.ru_stime.tv_sec; + usage->ru_stime.tv_usec = ru.ru_stime.tv_usec; + memcpy(&usage->ru_maxrss, &ru.ru_maxrss, + sizeof(struct compat_rusage) - + offsetof(struct compat_rusage, ru_maxrss)); + } + return r; +} diff --git a/libc-top-half/musl/compat/time32/gettimeofday_time32.c b/libc-top-half/musl/compat/time32/gettimeofday_time32.c new file mode 100644 index 0000000..1f3ce68 --- /dev/null +++ b/libc-top-half/musl/compat/time32/gettimeofday_time32.c @@ -0,0 +1,19 @@ +#include "time32.h" +#include +#include +#include + +int __gettimeofday_time32(struct timeval32 *tv32, void *tz) +{ + struct timeval tv; + if (!tv32) return 0; + int r = gettimeofday(&tv, 0); + if (r) return r; + if (tv.tv_sec < INT32_MIN || tv.tv_sec > INT32_MAX) { + errno = EOVERFLOW; + return -1; + } + tv32->tv_sec = tv.tv_sec; + tv32->tv_usec = tv.tv_usec; + return 0; +} diff --git a/libc-top-half/musl/compat/time32/gmtime32.c b/libc-top-half/musl/compat/time32/gmtime32.c new file mode 100644 index 0000000..963f0e0 --- /dev/null +++ b/libc-top-half/musl/compat/time32/gmtime32.c @@ -0,0 +1,7 @@ +#include "time32.h" +#include + +struct tm *__gmtime32(time32_t *t) +{ + return gmtime(&(time_t){*t}); +} diff --git a/libc-top-half/musl/compat/time32/gmtime32_r.c b/libc-top-half/musl/compat/time32/gmtime32_r.c new file mode 100644 index 0000000..7d72bfb --- /dev/null +++ b/libc-top-half/musl/compat/time32/gmtime32_r.c @@ -0,0 +1,7 @@ +#include "time32.h" +#include + +struct tm *__gmtime32_r(time32_t *t, struct tm *tm) +{ + return gmtime_r(&(time_t){*t}, tm); +} diff --git a/libc-top-half/musl/compat/time32/localtime32.c b/libc-top-half/musl/compat/time32/localtime32.c new file mode 100644 index 0000000..96bc303 --- /dev/null +++ b/libc-top-half/musl/compat/time32/localtime32.c @@ -0,0 +1,7 @@ +#include "time32.h" +#include + +struct tm *__localtime32(time32_t *t) +{ + return localtime(&(time_t){*t}); +} diff --git a/libc-top-half/musl/compat/time32/localtime32_r.c b/libc-top-half/musl/compat/time32/localtime32_r.c new file mode 100644 index 0000000..633ec82 --- /dev/null +++ b/libc-top-half/musl/compat/time32/localtime32_r.c @@ -0,0 +1,7 @@ +#include "time32.h" +#include + +struct tm *__localtime32_r(time32_t *t, struct tm *tm) +{ + return localtime_r(&(time_t){*t}, tm); +} diff --git a/libc-top-half/musl/compat/time32/lstat_time32.c b/libc-top-half/musl/compat/time32/lstat_time32.c new file mode 100644 index 0000000..c1257a1 --- /dev/null +++ b/libc-top-half/musl/compat/time32/lstat_time32.c @@ -0,0 +1,17 @@ +#include "time32.h" +#include +#include +#include +#include + +struct stat32; + +int __lstat_time32(const char *restrict path, struct stat32 *restrict st32) +{ + struct stat st; + int r = lstat(path, &st); + if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim)); + return r; +} + +weak_alias(lstat, lstat64); diff --git a/libc-top-half/musl/compat/time32/lutimes_time32.c b/libc-top-half/musl/compat/time32/lutimes_time32.c new file mode 100644 index 0000000..7f75cd4 --- /dev/null +++ b/libc-top-half/musl/compat/time32/lutimes_time32.c @@ -0,0 +1,12 @@ +#define _GNU_SOURCE +#include "time32.h" +#include +#include +#include + +int __lutimes_time32(const char *path, const struct timeval32 times32[2]) +{ + return lutimes(path, !times32 ? 0 : ((struct timeval[2]){ + {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec}, + {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}})); +} diff --git a/libc-top-half/musl/compat/time32/mktime32.c b/libc-top-half/musl/compat/time32/mktime32.c new file mode 100644 index 0000000..e6f15d5 --- /dev/null +++ b/libc-top-half/musl/compat/time32/mktime32.c @@ -0,0 +1,16 @@ +#include "time32.h" +#include +#include +#include + +time32_t __mktime32(struct tm *tm) +{ + struct tm tmp = *tm; + time_t t = mktime(&tmp); + if (t < INT32_MIN || t > INT32_MAX) { + errno = EOVERFLOW; + return -1; + } + *tm = tmp; + return t; +} diff --git a/libc-top-half/musl/compat/time32/mq_timedreceive_time32.c b/libc-top-half/musl/compat/time32/mq_timedreceive_time32.c new file mode 100644 index 0000000..211cea4 --- /dev/null +++ b/libc-top-half/musl/compat/time32/mq_timedreceive_time32.c @@ -0,0 +1,9 @@ +#include "time32.h" +#include +#include + +ssize_t __mq_timedreceive_time32(mqd_t mqd, char *restrict msg, size_t len, unsigned *restrict prio, const struct timespec32 *restrict ts32) +{ + return mq_timedreceive(mqd, msg, len, prio, ts32 ? (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0); +} diff --git a/libc-top-half/musl/compat/time32/mq_timedsend_time32.c b/libc-top-half/musl/compat/time32/mq_timedsend_time32.c new file mode 100644 index 0000000..93b697a --- /dev/null +++ b/libc-top-half/musl/compat/time32/mq_timedsend_time32.c @@ -0,0 +1,9 @@ +#include "time32.h" +#include +#include + +int __mq_timedsend_time32(mqd_t mqd, const char *msg, size_t len, unsigned prio, const struct timespec32 *ts32) +{ + return mq_timedsend(mqd, msg, len, prio, ts32 ? (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0); +} diff --git a/libc-top-half/musl/compat/time32/mtx_timedlock_time32.c b/libc-top-half/musl/compat/time32/mtx_timedlock_time32.c new file mode 100644 index 0000000..a01f09b --- /dev/null +++ b/libc-top-half/musl/compat/time32/mtx_timedlock_time32.c @@ -0,0 +1,9 @@ +#include "time32.h" +#include +#include + +int __mtx_timedlock_time32(mtx_t *restrict m, const struct timespec32 *restrict ts32) +{ + return mtx_timedlock(m, !ts32 ? 0 : (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec})); +} diff --git a/libc-top-half/musl/compat/time32/nanosleep_time32.c b/libc-top-half/musl/compat/time32/nanosleep_time32.c new file mode 100644 index 0000000..ea6bdd8 --- /dev/null +++ b/libc-top-half/musl/compat/time32/nanosleep_time32.c @@ -0,0 +1,15 @@ +#include "time32.h" +#include +#include + +int __nanosleep_time32(const struct timespec32 *req32, struct timespec32 *rem32) +{ + struct timespec rem; + int ret = nanosleep((&(struct timespec){ + .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem); + if (ret<0 && errno==EINTR && rem32) { + rem32->tv_sec = rem.tv_sec; + rem32->tv_nsec = rem.tv_nsec; + } + return ret; +} diff --git a/libc-top-half/musl/compat/time32/ppoll_time32.c b/libc-top-half/musl/compat/time32/ppoll_time32.c new file mode 100644 index 0000000..43b4b0d --- /dev/null +++ b/libc-top-half/musl/compat/time32/ppoll_time32.c @@ -0,0 +1,10 @@ +#include "time32.h" +#define _GNU_SOURCE +#include +#include + +int __ppoll_time32(struct pollfd *fds, nfds_t n, const struct timespec32 *ts32, const sigset_t *mask) +{ + return ppoll(fds, n, !ts32 ? 0 : (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}), mask); +} diff --git a/libc-top-half/musl/compat/time32/pselect_time32.c b/libc-top-half/musl/compat/time32/pselect_time32.c new file mode 100644 index 0000000..ecaa8f8 --- /dev/null +++ b/libc-top-half/musl/compat/time32/pselect_time32.c @@ -0,0 +1,9 @@ +#include "time32.h" +#include +#include + +int __pselect_time32(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict efds, const struct timespec32 *restrict ts32, const sigset_t *restrict mask) +{ + return pselect(n, rfds, wfds, efds, !ts32 ? 0 : (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}), mask); +} diff --git a/libc-top-half/musl/compat/time32/pthread_cond_timedwait_time32.c b/libc-top-half/musl/compat/time32/pthread_cond_timedwait_time32.c new file mode 100644 index 0000000..fba1f2a --- /dev/null +++ b/libc-top-half/musl/compat/time32/pthread_cond_timedwait_time32.c @@ -0,0 +1,9 @@ +#include "time32.h" +#include +#include + +int __pthread_cond_timedwait_time32(pthread_cond_t *restrict c, pthread_mutex_t *restrict m, const struct timespec32 *restrict ts32) +{ + return pthread_cond_timedwait(c, m, !ts32 ? 0 : (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec})); +} diff --git a/libc-top-half/musl/compat/time32/pthread_mutex_timedlock_time32.c b/libc-top-half/musl/compat/time32/pthread_mutex_timedlock_time32.c new file mode 100644 index 0000000..2d29602 --- /dev/null +++ b/libc-top-half/musl/compat/time32/pthread_mutex_timedlock_time32.c @@ -0,0 +1,9 @@ +#include "time32.h" +#include +#include + +int __pthread_mutex_timedlock_time32(pthread_mutex_t *restrict m, const struct timespec32 *restrict ts32) +{ + return pthread_mutex_timedlock(m, !ts32 ? 0 : (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec})); +} diff --git a/libc-top-half/musl/compat/time32/pthread_rwlock_timedrdlock_time32.c b/libc-top-half/musl/compat/time32/pthread_rwlock_timedrdlock_time32.c new file mode 100644 index 0000000..33df27a --- /dev/null +++ b/libc-top-half/musl/compat/time32/pthread_rwlock_timedrdlock_time32.c @@ -0,0 +1,9 @@ +#include "time32.h" +#include +#include + +int __pthread_rwlock_timedrdlock_time32(pthread_rwlock_t *restrict rw, const struct timespec32 *restrict ts32) +{ + return pthread_rwlock_timedrdlock(rw, !ts32 ? 0 : (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec})); +} diff --git a/libc-top-half/musl/compat/time32/pthread_rwlock_timedwrlock_time32.c b/libc-top-half/musl/compat/time32/pthread_rwlock_timedwrlock_time32.c new file mode 100644 index 0000000..99f24f7 --- /dev/null +++ b/libc-top-half/musl/compat/time32/pthread_rwlock_timedwrlock_time32.c @@ -0,0 +1,9 @@ +#include "time32.h" +#include +#include + +int __pthread_rwlock_timedwrlock_time32(pthread_rwlock_t *restrict rw, const struct timespec32 *restrict ts32) +{ + return pthread_rwlock_timedwrlock(rw, !ts32 ? 0 : (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec})); +} diff --git a/libc-top-half/musl/compat/time32/pthread_timedjoin_np_time32.c b/libc-top-half/musl/compat/time32/pthread_timedjoin_np_time32.c new file mode 100644 index 0000000..3ec2995 --- /dev/null +++ b/libc-top-half/musl/compat/time32/pthread_timedjoin_np_time32.c @@ -0,0 +1,10 @@ +#define _GNU_SOURCE +#include "time32.h" +#include +#include + +int __pthread_timedjoin_np_time32(pthread_t t, void **res, const struct timespec32 *at32) +{ + return pthread_timedjoin_np(t, res, !at32 ? 0 : (&(struct timespec){ + .tv_sec = at32->tv_sec, .tv_nsec = at32->tv_nsec})); +} diff --git a/libc-top-half/musl/compat/time32/recvmmsg_time32.c b/libc-top-half/musl/compat/time32/recvmmsg_time32.c new file mode 100644 index 0000000..acf1cfb --- /dev/null +++ b/libc-top-half/musl/compat/time32/recvmmsg_time32.c @@ -0,0 +1,10 @@ +#include "time32.h" +#define _GNU_SOURCE +#include +#include + +int __recvmmsg_time32(int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int flags, struct timespec32 *ts32) +{ + return recvmmsg(fd, msgvec, vlen, flags, ts32 ? (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0); +} diff --git a/libc-top-half/musl/compat/time32/sched_rr_get_interval_time32.c b/libc-top-half/musl/compat/time32/sched_rr_get_interval_time32.c new file mode 100644 index 0000000..36cbbac --- /dev/null +++ b/libc-top-half/musl/compat/time32/sched_rr_get_interval_time32.c @@ -0,0 +1,13 @@ +#include "time32.h" +#include +#include + +int __sched_rr_get_interval_time32(pid_t pid, struct timespec32 *ts32) +{ + struct timespec ts; + int r = sched_rr_get_interval(pid, &ts); + if (r) return r; + ts32->tv_sec = ts.tv_sec; + ts32->tv_nsec = ts.tv_nsec; + return r; +} diff --git a/libc-top-half/musl/compat/time32/select_time32.c b/libc-top-half/musl/compat/time32/select_time32.c new file mode 100644 index 0000000..2d8df9a --- /dev/null +++ b/libc-top-half/musl/compat/time32/select_time32.c @@ -0,0 +1,10 @@ +#include "time32.h" +#include +#include +#include + +int __select_time32(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict efds, struct timeval32 *restrict tv32) +{ + return select(n, rfds, wfds, efds, !tv32 ? 0 : (&(struct timeval){ + .tv_sec = tv32->tv_sec, .tv_usec = tv32->tv_usec})); +} diff --git a/libc-top-half/musl/compat/time32/sem_timedwait_time32.c b/libc-top-half/musl/compat/time32/sem_timedwait_time32.c new file mode 100644 index 0000000..c3469f9 --- /dev/null +++ b/libc-top-half/musl/compat/time32/sem_timedwait_time32.c @@ -0,0 +1,9 @@ +#include "time32.h" +#include +#include + +int __sem_timedwait_time32(sem_t *sem, const struct timespec32 *restrict ts32) +{ + return sem_timedwait(sem, !ts32 ? 0 : (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec})); +} diff --git a/libc-top-half/musl/compat/time32/semtimedop_time32.c b/libc-top-half/musl/compat/time32/semtimedop_time32.c new file mode 100644 index 0000000..34ec528 --- /dev/null +++ b/libc-top-half/musl/compat/time32/semtimedop_time32.c @@ -0,0 +1,10 @@ +#include "time32.h" +#define _GNU_SOURCE +#include +#include + +int __semtimedop_time32(int id, struct sembuf *buf, size_t n, const struct timespec32 *ts32) +{ + return semtimedop(id, buf, n, !ts32 ? 0 : (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec})); +} diff --git a/libc-top-half/musl/compat/time32/setitimer_time32.c b/libc-top-half/musl/compat/time32/setitimer_time32.c new file mode 100644 index 0000000..2475fd8 --- /dev/null +++ b/libc-top-half/musl/compat/time32/setitimer_time32.c @@ -0,0 +1,25 @@ +#include "time32.h" +#include +#include + +int __setitimer_time32(int which, const struct itimerval32 *restrict new32, struct itimerval32 *restrict old32) +{ + struct itimerval old; + int r = setitimer(which, (&(struct itimerval){ + .it_interval.tv_sec = new32->it_interval.tv_sec, + .it_interval.tv_usec = new32->it_interval.tv_usec, + .it_value.tv_sec = new32->it_value.tv_sec, + .it_value.tv_usec = new32->it_value.tv_usec}), &old); + if (r) return r; + /* The above call has already committed to success by changing the + * timer setting, so we can't fail on out-of-range old value. + * Since these are relative times, values large enough to overflow + * don't make sense anyway. */ + if (old32) { + old32->it_interval.tv_sec = old.it_interval.tv_sec; + old32->it_interval.tv_usec = old.it_interval.tv_usec; + old32->it_value.tv_sec = old.it_value.tv_sec; + old32->it_value.tv_usec = old.it_value.tv_usec; + } + return 0; +} diff --git a/libc-top-half/musl/compat/time32/settimeofday_time32.c b/libc-top-half/musl/compat/time32/settimeofday_time32.c new file mode 100644 index 0000000..09e625c --- /dev/null +++ b/libc-top-half/musl/compat/time32/settimeofday_time32.c @@ -0,0 +1,10 @@ +#define _BSD_SOURCE +#include "time32.h" +#include + +int __settimeofday_time32(const struct timeval32 *tv32, const void *tz) +{ + return settimeofday(!tv32 ? 0 : (&(struct timeval){ + .tv_sec = tv32->tv_sec, + .tv_usec = tv32->tv_usec}), 0); +} diff --git a/libc-top-half/musl/compat/time32/sigtimedwait_time32.c b/libc-top-half/musl/compat/time32/sigtimedwait_time32.c new file mode 100644 index 0000000..6b3aa39 --- /dev/null +++ b/libc-top-half/musl/compat/time32/sigtimedwait_time32.c @@ -0,0 +1,9 @@ +#include "time32.h" +#include +#include + +int __sigtimedwait_time32(const sigset_t *restrict set, siginfo_t *restrict si, const struct timespec32 *restrict ts32) +{ + return sigtimedwait(set, si, !ts32 ? 0 : (&(struct timespec){ + .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec})); +} diff --git a/libc-top-half/musl/compat/time32/stat_time32.c b/libc-top-half/musl/compat/time32/stat_time32.c new file mode 100644 index 0000000..8c6121d --- /dev/null +++ b/libc-top-half/musl/compat/time32/stat_time32.c @@ -0,0 +1,17 @@ +#include "time32.h" +#include +#include +#include +#include + +struct stat32; + +int __stat_time32(const char *restrict path, struct stat32 *restrict st32) +{ + struct stat st; + int r = stat(path, &st); + if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim)); + return r; +} + +weak_alias(stat, stat64); diff --git a/libc-top-half/musl/compat/time32/stime32.c b/libc-top-half/musl/compat/time32/stime32.c new file mode 100644 index 0000000..cc76364 --- /dev/null +++ b/libc-top-half/musl/compat/time32/stime32.c @@ -0,0 +1,8 @@ +#define _GNU_SOURCE +#include "time32.h" +#include + +int __stime32(const time32_t *t) +{ + return stime(&(time_t){*t}); +} diff --git a/libc-top-half/musl/compat/time32/thrd_sleep_time32.c b/libc-top-half/musl/compat/time32/thrd_sleep_time32.c new file mode 100644 index 0000000..5908800 --- /dev/null +++ b/libc-top-half/musl/compat/time32/thrd_sleep_time32.c @@ -0,0 +1,16 @@ +#include "time32.h" +#include +#include +#include + +int __thrd_sleep_time32(const struct timespec32 *req32, struct timespec32 *rem32) +{ + struct timespec rem; + int ret = thrd_sleep((&(struct timespec){ + .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem); + if (ret<0 && errno==EINTR && rem32) { + rem32->tv_sec = rem.tv_sec; + rem32->tv_nsec = rem.tv_nsec; + } + return ret; +} diff --git a/libc-top-half/musl/compat/time32/time32.c b/libc-top-half/musl/compat/time32/time32.c new file mode 100644 index 0000000..4b8fac1 --- /dev/null +++ b/libc-top-half/musl/compat/time32/time32.c @@ -0,0 +1,15 @@ +#include "time32.h" +#include +#include +#include + +time32_t __time32(time32_t *p) +{ + time_t t = time(0); + if (t < INT32_MIN || t > INT32_MAX) { + errno = EOVERFLOW; + return -1; + } + if (p) *p = t; + return t; +} diff --git a/libc-top-half/musl/compat/time32/time32.h b/libc-top-half/musl/compat/time32/time32.h new file mode 100644 index 0000000..fdec17c --- /dev/null +++ b/libc-top-half/musl/compat/time32/time32.h @@ -0,0 +1,91 @@ +#ifndef TIME32_H +#define TIME32_H + +#include + +typedef long time32_t; + +struct timeval32 { + long tv_sec; + long tv_usec; +}; + +struct itimerval32 { + struct timeval32 it_interval; + struct timeval32 it_value; +}; + +struct timespec32 { + long tv_sec; + long tv_nsec; +}; + +struct itimerspec32 { + struct timespec32 it_interval; + struct timespec32 it_value; +}; + +int __adjtime32() __asm__("adjtime"); +int __adjtimex_time32() __asm__("adjtimex"); +int __aio_suspend_time32() __asm__("aio_suspend"); +int __clock_adjtime32() __asm__("clock_adjtime"); +int __clock_getres_time32() __asm__("clock_getres"); +int __clock_gettime32() __asm__("clock_gettime"); +int __clock_nanosleep_time32() __asm__("clock_nanosleep"); +int __clock_settime32() __asm__("clock_settime"); +int __cnd_timedwait_time32() __asm__("cnd_timedwait"); +char *__ctime32() __asm__("ctime"); +char *__ctime32_r() __asm__("ctime_r"); +double __difftime32() __asm__("difftime"); +int __fstat_time32() __asm__("fstat"); +int __fstatat_time32() __asm__("fstatat"); +int __ftime32() __asm__("ftime"); +int __futimens_time32() __asm__("futimens"); +int __futimes_time32() __asm__("futimes"); +int __futimesat_time32() __asm__("futimesat"); +int __getitimer_time32() __asm__("getitimer"); +int __getrusage_time32() __asm__("getrusage"); +int __gettimeofday_time32() __asm__("gettimeofday"); +struct tm *__gmtime32() __asm__("gmtime"); +struct tm *__gmtime32_r() __asm__("gmtime_r"); +struct tm *__localtime32() __asm__("localtime"); +struct tm *__localtime32_r() __asm__("localtime_r"); +int __lstat_time32() __asm__("lstat"); +int __lutimes_time32() __asm__("lutimes"); +time32_t __mktime32() __asm__("mktime"); +ssize_t __mq_timedreceive_time32() __asm__("mq_timedreceive"); +int __mq_timedsend_time32() __asm__("mq_timedsend"); +int __mtx_timedlock_time32() __asm__("mtx_timedlock"); +int __nanosleep_time32() __asm__("nanosleep"); +int __ppoll_time32() __asm__("ppoll"); +int __pselect_time32() __asm__("pselect"); +int __pthread_cond_timedwait_time32() __asm__("pthread_cond_timedwait"); +int __pthread_mutex_timedlock_time32() __asm__("pthread_mutex_timedlock"); +int __pthread_rwlock_timedrdlock_time32() __asm__("pthread_rwlock_timedrdlock"); +int __pthread_rwlock_timedwrlock_time32() __asm__("pthread_rwlock_timedwrlock"); +int __pthread_timedjoin_np_time32() __asm__("pthread_timedjoin_np"); +int __recvmmsg_time32() __asm__("recvmmsg"); +int __sched_rr_get_interval_time32() __asm__("sched_rr_get_interval"); +int __select_time32() __asm__("select"); +int __sem_timedwait_time32() __asm__("sem_timedwait"); +int __semtimedop_time32() __asm__("semtimedop"); +int __setitimer_time32() __asm__("setitimer"); +int __settimeofday_time32() __asm__("settimeofday"); +int __sigtimedwait_time32() __asm__("sigtimedwait"); +int __stat_time32() __asm__("stat"); +int __stime32() __asm__("stime"); +int __thrd_sleep_time32() __asm__("thrd_sleep"); +time32_t __time32() __asm__("time"); +time32_t __time32gm() __asm__("timegm"); +int __timer_gettime32() __asm__("timer_gettime"); +int __timer_settime32() __asm__("timer_settime"); +int __timerfd_gettime32() __asm__("timerfd_gettime"); +int __timerfd_settime32() __asm__("timerfd_settime"); +int __timespec_get_time32() __asm__("timespec_get"); +int __utime_time32() __asm__("utime"); +int __utimensat_time32() __asm__("utimensat"); +int __utimes_time32() __asm__("utimes"); +pid_t __wait3_time32() __asm__("wait3"); +pid_t __wait4_time32() __asm__("wait4"); + +#endif diff --git a/libc-top-half/musl/compat/time32/time32gm.c b/libc-top-half/musl/compat/time32/time32gm.c new file mode 100644 index 0000000..60d68fb --- /dev/null +++ b/libc-top-half/musl/compat/time32/time32gm.c @@ -0,0 +1,15 @@ +#define _GNU_SOURCE +#include "time32.h" +#include +#include +#include + +time32_t __time32gm(struct tm *tm) +{ + time_t t = timegm(tm); + if (t < INT32_MIN || t > INT32_MAX) { + errno = EOVERFLOW; + return -1; + } + return t; +} diff --git a/libc-top-half/musl/compat/time32/timer_gettime32.c b/libc-top-half/musl/compat/time32/timer_gettime32.c new file mode 100644 index 0000000..b4184cc --- /dev/null +++ b/libc-top-half/musl/compat/time32/timer_gettime32.c @@ -0,0 +1,15 @@ +#include "time32.h" +#include + +int __timer_gettime32(timer_t t, struct itimerspec32 *val32) +{ + struct itimerspec old; + int r = timer_gettime(t, &old); + if (r) return r; + /* No range checking for consistency with settime */ + val32->it_interval.tv_sec = old.it_interval.tv_sec; + val32->it_interval.tv_nsec = old.it_interval.tv_nsec; + val32->it_value.tv_sec = old.it_value.tv_sec; + val32->it_value.tv_nsec = old.it_value.tv_nsec; + return 0; +} diff --git a/libc-top-half/musl/compat/time32/timer_settime32.c b/libc-top-half/musl/compat/time32/timer_settime32.c new file mode 100644 index 0000000..a447e7d --- /dev/null +++ b/libc-top-half/musl/compat/time32/timer_settime32.c @@ -0,0 +1,25 @@ +#include "time32.h" +#include + +int __timer_settime32(timer_t t, int flags, const struct itimerspec32 *restrict val32, struct itimerspec32 *restrict old32) +{ + struct itimerspec old; + int r = timer_settime(t, flags, (&(struct itimerspec){ + .it_interval.tv_sec = val32->it_interval.tv_sec, + .it_interval.tv_nsec = val32->it_interval.tv_nsec, + .it_value.tv_sec = val32->it_value.tv_sec, + .it_value.tv_nsec = val32->it_value.tv_nsec}), + old32 ? &old : 0); + if (r) return r; + /* The above call has already committed to success by changing the + * timer setting, so we can't fail on out-of-range old value. + * Since these are relative times, values large enough to overflow + * don't make sense anyway. */ + if (old32) { + old32->it_interval.tv_sec = old.it_interval.tv_sec; + old32->it_interval.tv_nsec = old.it_interval.tv_nsec; + old32->it_value.tv_sec = old.it_value.tv_sec; + old32->it_value.tv_nsec = old.it_value.tv_nsec; + } + return 0; +} diff --git a/libc-top-half/musl/compat/time32/timerfd_gettime32.c b/libc-top-half/musl/compat/time32/timerfd_gettime32.c new file mode 100644 index 0000000..75e5435 --- /dev/null +++ b/libc-top-half/musl/compat/time32/timerfd_gettime32.c @@ -0,0 +1,16 @@ +#include "time32.h" +#include +#include + +int __timerfd_gettime32(int t, struct itimerspec32 *val32) +{ + struct itimerspec old; + int r = timerfd_gettime(t, &old); + if (r) return r; + /* No range checking for consistency with settime */ + val32->it_interval.tv_sec = old.it_interval.tv_sec; + val32->it_interval.tv_nsec = old.it_interval.tv_nsec; + val32->it_value.tv_sec = old.it_value.tv_sec; + val32->it_value.tv_nsec = old.it_value.tv_nsec; + return 0; +} diff --git a/libc-top-half/musl/compat/time32/timerfd_settime32.c b/libc-top-half/musl/compat/time32/timerfd_settime32.c new file mode 100644 index 0000000..67830d3 --- /dev/null +++ b/libc-top-half/musl/compat/time32/timerfd_settime32.c @@ -0,0 +1,26 @@ +#include "time32.h" +#include +#include + +int __timerfd_settime32(int t, int flags, const struct itimerspec32 *restrict val32, struct itimerspec32 *restrict old32) +{ + struct itimerspec old; + int r = timerfd_settime(t, flags, (&(struct itimerspec){ + .it_interval.tv_sec = val32->it_interval.tv_sec, + .it_interval.tv_nsec = val32->it_interval.tv_nsec, + .it_value.tv_sec = val32->it_value.tv_sec, + .it_value.tv_nsec = val32->it_value.tv_nsec}), + old32 ? &old : 0); + if (r) return r; + /* The above call has already committed to success by changing the + * timer setting, so we can't fail on out-of-range old value. + * Since these are relative times, values large enough to overflow + * don't make sense anyway. */ + if (old32) { + old32->it_interval.tv_sec = old.it_interval.tv_sec; + old32->it_interval.tv_nsec = old.it_interval.tv_nsec; + old32->it_value.tv_sec = old.it_value.tv_sec; + old32->it_value.tv_nsec = old.it_value.tv_nsec; + } + return 0; +} diff --git a/libc-top-half/musl/compat/time32/timespec_get_time32.c b/libc-top-half/musl/compat/time32/timespec_get_time32.c new file mode 100644 index 0000000..e9ca94c --- /dev/null +++ b/libc-top-half/musl/compat/time32/timespec_get_time32.c @@ -0,0 +1,18 @@ +#include "time32.h" +#include +#include +#include + +int __timespec_get_time32(struct timespec32 *ts32, int base) +{ + struct timespec ts; + int r = timespec_get(&ts, base); + if (!r) return r; + if (ts.tv_sec < INT32_MIN || ts.tv_sec > INT32_MAX) { + errno = EOVERFLOW; + return 0; + } + ts32->tv_sec = ts.tv_sec; + ts32->tv_nsec = ts.tv_nsec; + return r; +} diff --git a/libc-top-half/musl/compat/time32/utime_time32.c b/libc-top-half/musl/compat/time32/utime_time32.c new file mode 100644 index 0000000..65f11d4 --- /dev/null +++ b/libc-top-half/musl/compat/time32/utime_time32.c @@ -0,0 +1,14 @@ +#include "time32.h" +#include +#include + +struct utimbuf32 { + time32_t actime; + time32_t modtime; +}; + +int __utime_time32(const char *path, const struct utimbuf32 *times32) +{ + return utime(path, !times32 ? 0 : (&(struct utimbuf){ + .actime = times32->actime, .modtime = times32->modtime})); +} diff --git a/libc-top-half/musl/compat/time32/utimensat_time32.c b/libc-top-half/musl/compat/time32/utimensat_time32.c new file mode 100644 index 0000000..c687b8d --- /dev/null +++ b/libc-top-half/musl/compat/time32/utimensat_time32.c @@ -0,0 +1,11 @@ +#include "time32.h" +#include +#include + +int __utimensat_time32(int fd, const char *path, const struct timespec32 times32[2], int flags) +{ + return utimensat(fd, path, !times32 ? 0 : ((struct timespec[2]){ + {.tv_sec = times32[0].tv_sec,.tv_nsec = times32[0].tv_nsec}, + {.tv_sec = times32[1].tv_sec,.tv_nsec = times32[1].tv_nsec}}), + flags); +} diff --git a/libc-top-half/musl/compat/time32/utimes_time32.c b/libc-top-half/musl/compat/time32/utimes_time32.c new file mode 100644 index 0000000..59248f6 --- /dev/null +++ b/libc-top-half/musl/compat/time32/utimes_time32.c @@ -0,0 +1,11 @@ +#include "time32.h" +#include +#include +#include + +int __utimes_time32(const char *path, const struct timeval32 times32[2]) +{ + return utimes(path, !times32 ? 0 : ((struct timeval[2]){ + {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec}, + {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}})); +} diff --git a/libc-top-half/musl/compat/time32/wait3_time32.c b/libc-top-half/musl/compat/time32/wait3_time32.c new file mode 100644 index 0000000..8fe128e --- /dev/null +++ b/libc-top-half/musl/compat/time32/wait3_time32.c @@ -0,0 +1,40 @@ +#define _BSD_SOURCE +#include "time32.h" +#include +#include +#include + +struct compat_rusage { + struct timeval32 ru_utime; + struct timeval32 ru_stime; + long ru_maxrss; + long ru_ixrss; + long ru_idrss; + long ru_isrss; + long ru_minflt; + long ru_majflt; + long ru_nswap; + long ru_inblock; + long ru_oublock; + long ru_msgsnd; + long ru_msgrcv; + long ru_nsignals; + long ru_nvcsw; + long ru_nivcsw; +}; + +pid_t __wait3_time32(int *status, int options, struct compat_rusage *usage) +{ + struct rusage ru; + int r = wait3(status, options, usage ? &ru : 0); + if (!r && usage) { + usage->ru_utime.tv_sec = ru.ru_utime.tv_sec; + usage->ru_utime.tv_usec = ru.ru_utime.tv_usec; + usage->ru_stime.tv_sec = ru.ru_stime.tv_sec; + usage->ru_stime.tv_usec = ru.ru_stime.tv_usec; + memcpy(&usage->ru_maxrss, &ru.ru_maxrss, + sizeof(struct compat_rusage) - + offsetof(struct compat_rusage, ru_maxrss)); + } + return r; +} diff --git a/libc-top-half/musl/compat/time32/wait4_time32.c b/libc-top-half/musl/compat/time32/wait4_time32.c new file mode 100644 index 0000000..918548e --- /dev/null +++ b/libc-top-half/musl/compat/time32/wait4_time32.c @@ -0,0 +1,40 @@ +#define _BSD_SOURCE +#include "time32.h" +#include +#include +#include + +struct compat_rusage { + struct timeval32 ru_utime; + struct timeval32 ru_stime; + long ru_maxrss; + long ru_ixrss; + long ru_idrss; + long ru_isrss; + long ru_minflt; + long ru_majflt; + long ru_nswap; + long ru_inblock; + long ru_oublock; + long ru_msgsnd; + long ru_msgrcv; + long ru_nsignals; + long ru_nvcsw; + long ru_nivcsw; +}; + +pid_t __wait4_time32(pid_t pid, int *status, int options, struct compat_rusage *usage) +{ + struct rusage ru; + int r = wait4(pid, status, options, usage ? &ru : 0); + if (!r && usage) { + usage->ru_utime.tv_sec = ru.ru_utime.tv_sec; + usage->ru_utime.tv_usec = ru.ru_utime.tv_usec; + usage->ru_stime.tv_sec = ru.ru_stime.tv_sec; + usage->ru_stime.tv_usec = ru.ru_stime.tv_usec; + memcpy(&usage->ru_maxrss, &ru.ru_maxrss, + sizeof(struct compat_rusage) - + offsetof(struct compat_rusage, ru_maxrss)); + } + return r; +} diff --git a/libc-top-half/musl/configure b/libc-top-half/musl/configure index ae13e0e..8bacaee 100755 --- a/libc-top-half/musl/configure +++ b/libc-top-half/musl/configure @@ -648,6 +648,15 @@ if test "$ARCH" = "powerpc" ; then trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \ "$0: error: compiler's floating point configuration is unsupported" trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf +printf "checking whether compiler can use 'd' constraint in asm... " +echo 'double f(double x) { __asm__ ("fabs %0, %1" : "=d"(x) : "d"(x)); return x; }' > "$tmpc" +if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then +printf "yes\n" +else +printf "no\n" +CFLAGS_AUTO="$CFLAGS_AUTO -DBROKEN_PPC_D_ASM" +CFLAGS_AUTO="${CFLAGS_AUTO# }" +fi fi test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \ diff --git a/libc-top-half/musl/include/aio.h b/libc-top-half/musl/include/aio.h index 19bc28a..453c41b 100644 --- a/libc-top-half/musl/include/aio.h +++ b/libc-top-half/musl/include/aio.h @@ -62,6 +62,10 @@ int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sige #define off64_t off_t #endif +#if _REDIR_TIME64 +__REDIR(aio_suspend, __aio_suspend_time64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/alloca.h b/libc-top-half/musl/include/alloca.h index d2e6f1c..b8d183d 100644 --- a/libc-top-half/musl/include/alloca.h +++ b/libc-top-half/musl/include/alloca.h @@ -10,9 +10,7 @@ extern "C" { void *alloca(size_t); -#ifdef __GNUC__ #define alloca __builtin_alloca -#endif #ifdef __cplusplus } diff --git a/libc-top-half/musl/include/alltypes.h.in b/libc-top-half/musl/include/alltypes.h.in index d38de75..3daf9f6 100644 --- a/libc-top-half/musl/include/alltypes.h.in +++ b/libc-top-half/musl/include/alltypes.h.in @@ -1,3 +1,7 @@ +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 +#define __USE_TIME_BITS64 1 + TYPEDEF unsigned _Addr size_t; TYPEDEF unsigned _Addr uintptr_t; TYPEDEF _Addr ptrdiff_t; @@ -5,6 +9,20 @@ TYPEDEF _Addr ssize_t; TYPEDEF _Addr intptr_t; TYPEDEF _Addr regoff_t; TYPEDEF _Reg register_t; +#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ +TYPEDEF _Int64 time_t; +TYPEDEF _Int64 suseconds_t; +#else +#if defined(__NEED_time_t) && !defined(__DEFINED_time_t) +#include <__typedef_time_t.h> +#define __DEFINED_time_t +#endif + +#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t) +#include <__typedef_suseconds_t.h> +#define __DEFINED_suseconds_t +#endif +#endif TYPEDEF signed char int8_t; TYPEDEF signed short int16_t; @@ -36,7 +54,7 @@ TYPEDEF int clockid_t; TYPEDEF long clock_t; #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ STRUCT timeval { time_t tv_sec; suseconds_t tv_usec; }; -STRUCT timespec { time_t tv_sec; long tv_nsec; }; +STRUCT timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); }; #else #include <__struct_timeval.h> #include <__struct_timespec.h> @@ -67,6 +85,9 @@ STRUCT _IO_FILE { char __x; }; #endif TYPEDEF struct _IO_FILE FILE; +TYPEDEF __builtin_va_list va_list; +TYPEDEF __builtin_va_list __isoc_va_list; + TYPEDEF struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; TYPEDEF struct __locale_struct * locale_t; @@ -82,6 +103,14 @@ STRUCT iovec { void *iov_base; size_t iov_len; }; TYPEDEF unsigned socklen_t; TYPEDEF unsigned short sa_family_t; +TYPEDEF struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t; +TYPEDEF struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t; +TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t; +TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t; +TYPEDEF struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t; +TYPEDEF struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t; + #undef _Addr #undef _Int64 #undef _Reg diff --git a/libc-top-half/musl/include/arpa/nameser.h b/libc-top-half/musl/include/arpa/nameser.h index b315e0f..581925a 100644 --- a/libc-top-half/musl/include/arpa/nameser.h +++ b/libc-top-half/musl/include/arpa/nameser.h @@ -7,7 +7,6 @@ extern "C" { #include #include -#include #define __NAMESER 19991006 #define NS_PACKETSZ 512 diff --git a/libc-top-half/musl/include/dirent.h b/libc-top-half/musl/include/dirent.h index 3a129a4..52a3b16 100644 --- a/libc-top-half/musl/include/dirent.h +++ b/libc-top-half/musl/include/dirent.h @@ -19,28 +19,14 @@ extern "C" { #include +#include + #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ typedef struct __dirstream DIR; #else #include <__typedef_DIR.h> #endif -#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ -#define _DIRENT_HAVE_D_RECLEN -#define _DIRENT_HAVE_D_OFF -#define _DIRENT_HAVE_D_TYPE - -struct dirent { - ino_t d_ino; - off_t d_off; - unsigned short d_reclen; - unsigned char d_type; - char d_name[256]; -}; -#else -#include <__struct_dirent.h> -#endif - #define d_fileno d_ino int closedir(DIR *); diff --git a/libc-top-half/musl/include/dlfcn.h b/libc-top-half/musl/include/dlfcn.h index 78fb073..13ab71d 100644 --- a/libc-top-half/musl/include/dlfcn.h +++ b/libc-top-half/musl/include/dlfcn.h @@ -35,6 +35,10 @@ int dladdr(const void *, Dl_info *); int dlinfo(void *, int, void *); #endif +#if _REDIR_TIME64 +__REDIR(dlsym, __dlsym_time64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/endian.h b/libc-top-half/musl/include/endian.h index 1bd4445..172c432 100644 --- a/libc-top-half/musl/include/endian.h +++ b/libc-top-half/musl/include/endian.h @@ -3,25 +3,19 @@ #include -#define __LITTLE_ENDIAN 1234 -#define __BIG_ENDIAN 4321 -#define __PDP_ENDIAN 3412 +#define __NEED_uint16_t +#define __NEED_uint32_t +#define __NEED_uint64_t -#if defined(__GNUC__) && defined(__BYTE_ORDER__) -#define __BYTE_ORDER __BYTE_ORDER__ -#else -#include -#endif +#include -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define __PDP_ENDIAN 3412 #define BIG_ENDIAN __BIG_ENDIAN #define LITTLE_ENDIAN __LITTLE_ENDIAN #define PDP_ENDIAN __PDP_ENDIAN #define BYTE_ORDER __BYTE_ORDER -#include - static __inline uint16_t __bswap16(uint16_t __x) { return __x<<8 | __x>>8; @@ -40,43 +34,47 @@ static __inline uint64_t __bswap64(uint64_t __x) #if __BYTE_ORDER == __LITTLE_ENDIAN #define htobe16(x) __bswap16(x) #define be16toh(x) __bswap16(x) -#define betoh16(x) __bswap16(x) #define htobe32(x) __bswap32(x) #define be32toh(x) __bswap32(x) -#define betoh32(x) __bswap32(x) #define htobe64(x) __bswap64(x) #define be64toh(x) __bswap64(x) -#define betoh64(x) __bswap64(x) #define htole16(x) (uint16_t)(x) #define le16toh(x) (uint16_t)(x) -#define letoh16(x) (uint16_t)(x) #define htole32(x) (uint32_t)(x) #define le32toh(x) (uint32_t)(x) -#define letoh32(x) (uint32_t)(x) #define htole64(x) (uint64_t)(x) #define le64toh(x) (uint64_t)(x) -#define letoh64(x) (uint64_t)(x) #else #define htobe16(x) (uint16_t)(x) #define be16toh(x) (uint16_t)(x) -#define betoh16(x) (uint16_t)(x) #define htobe32(x) (uint32_t)(x) #define be32toh(x) (uint32_t)(x) -#define betoh32(x) (uint32_t)(x) #define htobe64(x) (uint64_t)(x) #define be64toh(x) (uint64_t)(x) -#define betoh64(x) (uint64_t)(x) #define htole16(x) __bswap16(x) #define le16toh(x) __bswap16(x) -#define letoh16(x) __bswap16(x) #define htole32(x) __bswap32(x) #define le32toh(x) __bswap32(x) -#define letoh32(x) __bswap32(x) #define htole64(x) __bswap64(x) #define le64toh(x) __bswap64(x) -#define letoh64(x) __bswap64(x) #endif +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define betoh16(x) __bswap16(x) +#define betoh32(x) __bswap32(x) +#define betoh64(x) __bswap64(x) +#define letoh16(x) (uint16_t)(x) +#define letoh32(x) (uint32_t)(x) +#define letoh64(x) (uint64_t)(x) +#else +#define betoh16(x) (uint16_t)(x) +#define betoh32(x) (uint32_t)(x) +#define betoh64(x) (uint64_t)(x) +#define letoh16(x) __bswap16(x) +#define letoh32(x) __bswap32(x) +#define letoh64(x) __bswap64(x) +#endif #endif #endif diff --git a/libc-top-half/musl/include/features.h b/libc-top-half/musl/include/features.h index f4d651e..85cfb72 100644 --- a/libc-top-half/musl/include/features.h +++ b/libc-top-half/musl/include/features.h @@ -35,4 +35,6 @@ #define _Noreturn #endif +#define __REDIR(x,y) __typeof__(x) x __asm__(#y) + #endif diff --git a/libc-top-half/musl/include/limits.h b/libc-top-half/musl/include/limits.h index 96ca363..a78cb2f 100644 --- a/libc-top-half/musl/include/limits.h +++ b/libc-top-half/musl/include/limits.h @@ -3,9 +3,7 @@ #include -/* Most limits are system-specific */ - -#include +#include /* __LONG_MAX */ /* Support signed or unsigned plain-char */ @@ -17,8 +15,6 @@ #define CHAR_MAX 127 #endif -/* Some universal constants... */ - #define CHAR_BIT 8 #define SCHAR_MIN (-128) #define SCHAR_MAX 127 @@ -30,8 +26,10 @@ #define INT_MAX 0x7fffffff #define UINT_MAX 0xffffffffU #define LONG_MIN (-LONG_MAX-1) +#define LONG_MAX __LONG_MAX #define ULONG_MAX (2UL*LONG_MAX+1) #define LLONG_MIN (-LLONG_MAX-1) +#define LLONG_MAX 0x7fffffffffffffffLL #define ULLONG_MAX (2ULL*LLONG_MAX+1) #define MB_LEN_MAX 4 @@ -39,11 +37,15 @@ #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#include + #ifdef __wasilibc_unmodified_upstream /* WASI has no pipes */ #define PIPE_BUF 4096 #endif #define FILESIZEBITS 64 +#ifndef NAME_MAX #define NAME_MAX 255 +#endif #define PATH_MAX 4096 #define NGROUPS_MAX 32 #define ARG_MAX 131072 @@ -55,6 +57,12 @@ #define TTY_NAME_MAX 32 #define HOST_NAME_MAX 255 +#if LONG_MAX == 0x7fffffffL +#define LONG_BIT 32 +#else +#define LONG_BIT 64 +#endif + /* Implementation choices... */ #if defined(__wasilibc_unmodified_upstream) || defined(_REENTRANT) diff --git a/libc-top-half/musl/include/mqueue.h b/libc-top-half/musl/include/mqueue.h index f5cbe79..0c807ea 100644 --- a/libc-top-half/musl/include/mqueue.h +++ b/libc-top-half/musl/include/mqueue.h @@ -30,6 +30,11 @@ ssize_t mq_timedreceive(mqd_t, char *__restrict, size_t, unsigned *__restrict, c int mq_timedsend(mqd_t, const char *, size_t, unsigned, const struct timespec *); int mq_unlink(const char *); +#if _REDIR_TIME64 +__REDIR(mq_timedreceive, __mq_timedreceive_time64); +__REDIR(mq_timedsend, __mq_timedsend_time64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/netinet/icmp6.h b/libc-top-half/musl/include/netinet/icmp6.h index cf951d9..01269e7 100644 --- a/libc-top-half/musl/include/netinet/icmp6.h +++ b/libc-top-half/musl/include/netinet/icmp6.h @@ -9,7 +9,6 @@ extern "C" { #include #include #include -#include #define ICMP6_FILTER 1 diff --git a/libc-top-half/musl/include/netinet/if_ether.h b/libc-top-half/musl/include/netinet/if_ether.h index 8af47db..a08485e 100644 --- a/libc-top-half/musl/include/netinet/if_ether.h +++ b/libc-top-half/musl/include/netinet/if_ether.h @@ -58,6 +58,7 @@ #define ETH_P_ERSPAN 0x88BE #define ETH_P_PREAUTH 0x88C7 #define ETH_P_TIPC 0x88CA +#define ETH_P_LLDP 0x88CC #define ETH_P_MACSEC 0x88E5 #define ETH_P_8021AH 0x88E7 #define ETH_P_MVRP 0x88F5 diff --git a/libc-top-half/musl/include/netinet/ip.h b/libc-top-half/musl/include/netinet/ip.h index d7fa8d5..0ae132a 100644 --- a/libc-top-half/musl/include/netinet/ip.h +++ b/libc-top-half/musl/include/netinet/ip.h @@ -7,7 +7,6 @@ extern "C" { #include #include -#include struct timestamp { uint8_t len; @@ -191,6 +190,8 @@ struct ip_timestamp { #define IP_MSS 576 +#define __UAPI_DEF_IPHDR 0 + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/netinet/ip6.h b/libc-top-half/musl/include/netinet/ip6.h index a4347a5..50c626a 100644 --- a/libc-top-half/musl/include/netinet/ip6.h +++ b/libc-top-half/musl/include/netinet/ip6.h @@ -7,7 +7,6 @@ extern "C" { #include #include -#include struct ip6_hdr { union { diff --git a/libc-top-half/musl/include/netinet/tcp.h b/libc-top-half/musl/include/netinet/tcp.h index c7a8648..44a007a 100644 --- a/libc-top-half/musl/include/netinet/tcp.h +++ b/libc-top-half/musl/include/netinet/tcp.h @@ -38,6 +38,7 @@ #define TCP_FASTOPEN_NO_COOKIE 34 #define TCP_ZEROCOPY_RECEIVE 35 #define TCP_INQ 36 +#define TCP_TX_DELAY 37 #define TCP_CM_INQ TCP_INQ @@ -97,7 +98,6 @@ enum { #include #include #include -#include typedef uint32_t tcp_seq; @@ -234,6 +234,8 @@ struct tcp_info { uint64_t tcpi_bytes_retrans; uint32_t tcpi_dsack_dups; uint32_t tcpi_reord_seen; + uint32_t tcpi_rcv_ooopack; + uint32_t tcpi_snd_wnd; }; #define TCP_MD5SIG_MAXKEYLEN 80 diff --git a/libc-top-half/musl/include/poll.h b/libc-top-half/musl/include/poll.h index a5a799b..cdbd29a 100644 --- a/libc-top-half/musl/include/poll.h +++ b/libc-top-half/musl/include/poll.h @@ -56,6 +56,12 @@ int poll (struct pollfd *, nfds_t, int); int ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *); #endif +#if _REDIR_TIME64 +#ifdef _GNU_SOURCE +__REDIR(ppoll, __ppoll_time64); +#endif +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/pthread.h b/libc-top-half/musl/include/pthread.h index a5ea7b0..d4a9b65 100644 --- a/libc-top-half/musl/include/pthread.h +++ b/libc-top-half/musl/include/pthread.h @@ -230,6 +230,16 @@ int pthread_tryjoin_np(pthread_t, void **); int pthread_timedjoin_np(pthread_t, void **, const struct timespec *); #endif +#if _REDIR_TIME64 +__REDIR(pthread_mutex_timedlock, __pthread_mutex_timedlock_time64); +__REDIR(pthread_cond_timedwait, __pthread_cond_timedwait_time64); +__REDIR(pthread_rwlock_timedrdlock, __pthread_rwlock_timedrdlock_time64); +__REDIR(pthread_rwlock_timedwrlock, __pthread_rwlock_timedwrlock_time64); +#ifdef _GNU_SOURCE +__REDIR(pthread_timedjoin_np, __pthread_timedjoin_np_time64); +#endif +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/sched.h b/libc-top-half/musl/include/sched.h index 290e174..36dd4df 100644 --- a/libc-top-half/musl/include/sched.h +++ b/libc-top-half/musl/include/sched.h @@ -20,10 +20,14 @@ extern "C" { struct sched_param { int sched_priority; int __reserved1; +#if _REDIR_TIME64 + long __reserved2[4]; +#else struct { time_t __reserved1; long __reserved2; } __reserved2[2]; +#endif int __reserved3; }; @@ -137,6 +141,10 @@ __CPU_op_func_S(XOR, ^) #endif #endif +#if _REDIR_TIME64 +__REDIR(sched_rr_get_interval, __sched_rr_get_interval_time64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/semaphore.h b/libc-top-half/musl/include/semaphore.h index 277c47d..3690f49 100644 --- a/libc-top-half/musl/include/semaphore.h +++ b/libc-top-half/musl/include/semaphore.h @@ -29,6 +29,10 @@ int sem_trywait(sem_t *); int sem_unlink(const char *); int sem_wait(sem_t *); +#if _REDIR_TIME64 +__REDIR(sem_timedwait, __sem_timedwait_time64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/signal.h b/libc-top-half/musl/include/signal.h index 482e1f7..068234f 100644 --- a/libc-top-half/musl/include/signal.h +++ b/libc-top-half/musl/include/signal.h @@ -285,6 +285,14 @@ void (*signal(int, void (*)(int)))(int); #endif int raise(int); +#if _REDIR_TIME64 +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ + || defined(_BSD_SOURCE) +__REDIR(sigtimedwait, __sigtimedwait_time64); +#endif +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/sys/acct.h b/libc-top-half/musl/include/sys/acct.h index 9b0ba36..fae9d05 100644 --- a/libc-top-half/musl/include/sys/acct.h +++ b/libc-top-half/musl/include/sys/acct.h @@ -6,7 +6,6 @@ extern "C" { #endif #include -#include #include #include diff --git a/libc-top-half/musl/include/sys/ioctl.h b/libc-top-half/musl/include/sys/ioctl.h index eb90364..3877ca4 100644 --- a/libc-top-half/musl/include/sys/ioctl.h +++ b/libc-top-half/musl/include/sys/ioctl.h @@ -5,6 +5,7 @@ extern "C" { #endif +#include #include #define N_TTY 0 diff --git a/libc-top-half/musl/include/sys/mman.h b/libc-top-half/musl/include/sys/mman.h index 32357ee..e6079c8 100644 --- a/libc-top-half/musl/include/sys/mman.h +++ b/libc-top-half/musl/include/sys/mman.h @@ -96,6 +96,8 @@ extern "C" { #define MADV_DODUMP 17 #define MADV_WIPEONFORK 18 #define MADV_KEEPONFORK 19 +#define MADV_COLD 20 +#define MADV_PAGEOUT 21 #define MADV_HWPOISON 100 #define MADV_SOFT_OFFLINE 101 #endif diff --git a/libc-top-half/musl/include/sys/prctl.h b/libc-top-half/musl/include/sys/prctl.h index 07f0d73..d9c846e 100644 --- a/libc-top-half/musl/include/sys/prctl.h +++ b/libc-top-half/musl/include/sys/prctl.h @@ -154,6 +154,10 @@ struct prctl_mm_map { #define PR_PAC_APDBKEY (1UL << 3) #define PR_PAC_APGAKEY (1UL << 4) +#define PR_SET_TAGGED_ADDR_CTRL 55 +#define PR_GET_TAGGED_ADDR_CTRL 56 +#define PR_TAGGED_ADDR_ENABLE (1UL << 0) + int prctl (int, ...); #ifdef __cplusplus diff --git a/libc-top-half/musl/include/sys/procfs.h b/libc-top-half/musl/include/sys/procfs.h index e23bf1a..38e58c1 100644 --- a/libc-top-half/musl/include/sys/procfs.h +++ b/libc-top-half/musl/include/sys/procfs.h @@ -23,10 +23,9 @@ struct elf_prstatus { pid_t pr_ppid; pid_t pr_pgrp; pid_t pr_sid; - struct timeval pr_utime; - struct timeval pr_stime; - struct timeval pr_cutime; - struct timeval pr_cstime; + struct { + long tv_sec, tv_usec; + } pr_utime, pr_stime, pr_cutime, pr_cstime; elf_gregset_t pr_reg; int pr_fpvalid; }; diff --git a/libc-top-half/musl/include/sys/ptrace.h b/libc-top-half/musl/include/sys/ptrace.h index 229e1f3..5d62a98 100644 --- a/libc-top-half/musl/include/sys/ptrace.h +++ b/libc-top-half/musl/include/sys/ptrace.h @@ -41,6 +41,7 @@ extern "C" { #define PTRACE_SETSIGMASK 0x420b #define PTRACE_SECCOMP_GET_FILTER 0x420c #define PTRACE_SECCOMP_GET_METADATA 0x420d +#define PTRACE_GET_SYSCALL_INFO 0x420e #define PT_READ_I PTRACE_PEEKTEXT #define PT_READ_D PTRACE_PEEKDATA @@ -88,6 +89,11 @@ extern "C" { #define PTRACE_PEEKSIGINFO_SHARED 1 +#define PTRACE_SYSCALL_INFO_NONE 0 +#define PTRACE_SYSCALL_INFO_ENTRY 1 +#define PTRACE_SYSCALL_INFO_EXIT 2 +#define PTRACE_SYSCALL_INFO_SECCOMP 3 + #include struct __ptrace_peeksiginfo_args { @@ -101,6 +107,29 @@ struct __ptrace_seccomp_metadata { uint64_t flags; }; +struct __ptrace_syscall_info { + uint8_t op; + uint8_t __pad[3]; + uint32_t arch; + uint64_t instruction_pointer; + uint64_t stack_pointer; + union { + struct { + uint64_t nr; + uint64_t args[6]; + } entry; + struct { + int64_t rval; + uint8_t is_error; + } exit; + struct { + uint64_t nr; + uint64_t args[6]; + uint32_t ret_data; + } seccomp; + }; +}; + long ptrace(int, ...); #ifdef __cplusplus diff --git a/libc-top-half/musl/include/sys/resource.h b/libc-top-half/musl/include/sys/resource.h index a12e290..8b55331 100644 --- a/libc-top-half/musl/include/sys/resource.h +++ b/libc-top-half/musl/include/sys/resource.h @@ -91,7 +91,8 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *); #define RLIMIT_MSGQUEUE 12 #define RLIMIT_NICE 13 #define RLIMIT_RTPRIO 14 -#define RLIMIT_NLIMITS 15 +#define RLIMIT_RTTIME 15 +#define RLIMIT_NLIMITS 16 #define RLIM_NLIMITS RLIMIT_NLIMITS @@ -108,6 +109,10 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *); #include <__header_sys_resource.h> #endif +#if _REDIR_TIME64 +__REDIR(getrusage, __getrusage_time64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/sys/select.h b/libc-top-half/musl/include/sys/select.h index cb70ea5..1c1adff 100644 --- a/libc-top-half/musl/include/sys/select.h +++ b/libc-top-half/musl/include/sys/select.h @@ -43,6 +43,11 @@ int pselect (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, co #endif #endif +#if _REDIR_TIME64 +__REDIR(select, __select_time64); +__REDIR(pselect, __pselect_time64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/sys/sem.h b/libc-top-half/musl/include/sys/sem.h index 410c877..a747784 100644 --- a/libc-top-half/musl/include/sys/sem.h +++ b/libc-top-half/musl/include/sys/sem.h @@ -25,8 +25,6 @@ extern "C" { #define SETVAL 16 #define SETALL 17 -#include - #include #define _SEM_SEMUN_UNDEFINED 1 @@ -62,6 +60,12 @@ int semop(int, struct sembuf *, size_t); int semtimedop(int, struct sembuf *, size_t, const struct timespec *); #endif +#if _REDIR_TIME64 +#ifdef _GNU_SOURCE +__REDIR(semtimedop, __semtimedop_time64); +#endif +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/sys/socket.h b/libc-top-half/musl/include/sys/socket.h index 239b038..cea24cf 100644 --- a/libc-top-half/musl/include/sys/socket.h +++ b/libc-top-half/musl/include/sys/socket.h @@ -23,6 +23,44 @@ extern "C" { #include +#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */ +struct msghdr { + void *msg_name; + socklen_t msg_namelen; + struct iovec *msg_iov; +#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN + int __pad1; +#endif + int msg_iovlen; +#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN + int __pad1; +#endif + void *msg_control; +#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN + int __pad2; +#endif + socklen_t msg_controllen; +#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN + int __pad2; +#endif + int msg_flags; +}; + +struct cmsghdr { +#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN + int __pad1; +#endif + socklen_t cmsg_len; +#if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN + int __pad1; +#endif + int cmsg_level; + int cmsg_type; +}; +#else +#include <__struct_msghdr.h> +#endif + #ifdef _GNU_SOURCE struct ucred { pid_t pid; @@ -187,8 +225,6 @@ struct linger { #define SO_PEERCRED 17 #define SO_RCVLOWAT 18 #define SO_SNDLOWAT 19 -#define SO_RCVTIMEO 20 -#define SO_SNDTIMEO 21 #define SO_ACCEPTCONN 30 #define SO_PEERSEC 31 #define SO_SNDBUFFORCE 32 @@ -197,6 +233,28 @@ struct linger { #define SO_DOMAIN 39 #endif +#ifndef SO_RCVTIMEO +#if __LONG_MAX == 0x7fffffff +#define SO_RCVTIMEO 66 +#define SO_SNDTIMEO 67 +#else +#define SO_RCVTIMEO 20 +#define SO_SNDTIMEO 21 +#endif +#endif + +#ifndef SO_TIMESTAMP +#if __LONG_MAX == 0x7fffffff +#define SO_TIMESTAMP 63 +#define SO_TIMESTAMPNS 64 +#define SO_TIMESTAMPING 65 +#else +#define SO_TIMESTAMP 29 +#define SO_TIMESTAMPNS 35 +#define SO_TIMESTAMPING 37 +#endif +#endif + #define SO_SECURITY_AUTHENTICATION 22 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 #define SO_SECURITY_ENCRYPTION_NETWORK 24 @@ -208,14 +266,10 @@ struct linger { #define SO_GET_FILTER SO_ATTACH_FILTER #define SO_PEERNAME 28 -#define SO_TIMESTAMP 29 #define SCM_TIMESTAMP SO_TIMESTAMP - #define SO_PASSSEC 34 -#define SO_TIMESTAMPNS 35 #define SCM_TIMESTAMPNS SO_TIMESTAMPNS #define SO_MARK 36 -#define SO_TIMESTAMPING 37 #define SCM_TIMESTAMPING SO_TIMESTAMPING #define SO_RXQ_OVFL 40 #define SO_WIFI_STATUS 41 @@ -243,6 +297,7 @@ struct linger { #define SO_TXTIME 61 #define SCM_TXTIME SO_TXTIME #define SO_BINDTOIFINDEX 62 +#define SO_DETACH_REUSEPORT_BPF 68 #ifndef SOL_SOCKET #define SOL_SOCKET 1 @@ -378,6 +433,12 @@ int setsockopt (int, int, int, const void *, socklen_t); int sockatmark (int); #endif +#if _REDIR_TIME64 +#ifdef _GNU_SOURCE +__REDIR(recvmmsg, __recvmmsg_time64); +#endif +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/sys/stat.h b/libc-top-half/musl/include/sys/stat.h index a91b71b..72e1626 100644 --- a/libc-top-half/musl/include/sys/stat.h +++ b/libc-top-half/musl/include/sys/stat.h @@ -126,6 +126,15 @@ int lchmod(const char *, mode_t); #define off64_t off_t #endif +#if _REDIR_TIME64 +__REDIR(stat, __stat_time64); +__REDIR(fstat, __fstat_time64); +__REDIR(lstat, __lstat_time64); +__REDIR(fstatat, __fstatat_time64); +__REDIR(futimens, __futimens_time64); +__REDIR(utimensat, __utimensat_time64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/sys/statvfs.h b/libc-top-half/musl/include/sys/statvfs.h index ef07d68..793490b 100644 --- a/libc-top-half/musl/include/sys/statvfs.h +++ b/libc-top-half/musl/include/sys/statvfs.h @@ -11,8 +11,6 @@ extern "C" { #define __NEED_fsfilcnt_t #include -#include - struct statvfs { unsigned long f_bsize, f_frsize; fsblkcnt_t f_blocks, f_bfree, f_bavail; diff --git a/libc-top-half/musl/include/sys/time.h b/libc-top-half/musl/include/sys/time.h index 03c297f..389cdcb 100644 --- a/libc-top-half/musl/include/sys/time.h +++ b/libc-top-half/musl/include/sys/time.h @@ -64,6 +64,20 @@ int adjtime (const struct timeval *, struct timeval *); (void)0 ) #endif +#if _REDIR_TIME64 +__REDIR(gettimeofday, __gettimeofday_time64); +__REDIR(getitimer, __getitimer_time64); +__REDIR(setitimer, __setitimer_time64); +__REDIR(utimes, __utimes_time64); +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +__REDIR(futimes, __futimes_time64); +__REDIR(futimesat, __futimesat_time64); +__REDIR(lutimes, __lutimes_time64); +__REDIR(settimeofday, __settimeofday_time64); +__REDIR(adjtime, __adjtime64); +#endif +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/sys/timeb.h b/libc-top-half/musl/include/sys/timeb.h index 108c1f5..628239b 100644 --- a/libc-top-half/musl/include/sys/timeb.h +++ b/libc-top-half/musl/include/sys/timeb.h @@ -4,6 +4,8 @@ extern "C" { #endif +#include + #define __NEED_time_t #include @@ -16,6 +18,10 @@ struct timeb { int ftime(struct timeb *); +#if _REDIR_TIME64 +__REDIR(ftime, __ftime64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/sys/timerfd.h b/libc-top-half/musl/include/sys/timerfd.h index 2794d36..1b832cd 100644 --- a/libc-top-half/musl/include/sys/timerfd.h +++ b/libc-top-half/musl/include/sys/timerfd.h @@ -20,6 +20,11 @@ int timerfd_create(int, int); int timerfd_settime(int, int, const struct itimerspec *, struct itimerspec *); int timerfd_gettime(int, struct itimerspec *); +#if _REDIR_TIME64 +__REDIR(timerfd_settime, __timerfd_settime64); +__REDIR(timerfd_gettime, __timerfd_gettime64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/sys/timex.h b/libc-top-half/musl/include/sys/timex.h index 2e68888..8b417e1 100644 --- a/libc-top-half/musl/include/sys/timex.h +++ b/libc-top-half/musl/include/sys/timex.h @@ -91,6 +91,11 @@ struct timex { int adjtimex(struct timex *); int clock_adjtime(clockid_t, struct timex *); +#if _REDIR_TIME64 +__REDIR(adjtimex, __adjtimex_time64); +__REDIR(clock_adjtime, __clock_adjtime64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/sys/ttydefaults.h b/libc-top-half/musl/include/sys/ttydefaults.h index d251b71..edb55bc 100644 --- a/libc-top-half/musl/include/sys/ttydefaults.h +++ b/libc-top-half/musl/include/sys/ttydefaults.h @@ -6,16 +6,11 @@ #define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) #define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL) #define TTYDEF_SPEED (B9600) -#define CTRL(x) (x&037) +#define CTRL(x) ((x)&037) #define CEOF CTRL('d') -#ifdef _POSIX_VDISABLE -#define CEOL _POSIX_VDISABLE -#define CSTATUS _POSIX_VDISABLE -#else #define CEOL '\0' #define CSTATUS '\0' -#endif #define CERASE 0177 #define CINTR CTRL('c') diff --git a/libc-top-half/musl/include/sys/wait.h b/libc-top-half/musl/include/sys/wait.h index 50c5c70..d4b1f2e 100644 --- a/libc-top-half/musl/include/sys/wait.h +++ b/libc-top-half/musl/include/sys/wait.h @@ -13,7 +13,8 @@ extern "C" { typedef enum { P_ALL = 0, P_PID = 1, - P_PGID = 2 + P_PGID = 2, + P_PIDFD = 3 } idtype_t; pid_t wait (int *); @@ -53,6 +54,13 @@ pid_t wait4 (pid_t, int *, int, struct rusage *); #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu) #define WIFCONTINUED(s) ((s) == 0xffff) +#if _REDIR_TIME64 +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +__REDIR(wait3, __wait3_time64); +__REDIR(wait4, __wait4_time64); +#endif +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/threads.h b/libc-top-half/musl/include/threads.h index 8122b3b..52ec310 100644 --- a/libc-top-half/musl/include/threads.h +++ b/libc-top-half/musl/include/threads.h @@ -80,6 +80,12 @@ void tss_delete(tss_t); int tss_set(tss_t, void *); void *tss_get(tss_t); +#if _REDIR_TIME64 +__REDIR(thrd_sleep, __thrd_sleep_time64); +__REDIR(mtx_timedlock, __mtx_timedlock_time64); +__REDIR(cnd_timedwait, __cnd_timedwait_time64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/time.h b/libc-top-half/musl/include/time.h index 899d862..01ba89b 100644 --- a/libc-top-half/musl/include/time.h +++ b/libc-top-half/musl/include/time.h @@ -157,6 +157,34 @@ int stime(const time_t *); time_t timegm(struct tm *); #endif +#if _REDIR_TIME64 +__REDIR(time, __time64); +__REDIR(difftime, __difftime64); +__REDIR(mktime, __mktime64); +__REDIR(gmtime, __gmtime64); +__REDIR(localtime, __localtime64); +__REDIR(ctime, __ctime64); +__REDIR(timespec_get, __timespec_get_time64); +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ + || defined(_BSD_SOURCE) +__REDIR(gmtime_r, __gmtime64_r); +__REDIR(localtime_r, __localtime64_r); +__REDIR(ctime_r, __ctime64_r); +__REDIR(nanosleep, __nanosleep_time64); +__REDIR(clock_getres, __clock_getres_time64); +__REDIR(clock_gettime, __clock_gettime64); +__REDIR(clock_settime, __clock_settime64); +__REDIR(clock_nanosleep, __clock_nanosleep_time64); +__REDIR(timer_settime, __timer_settime64); +__REDIR(timer_gettime, __timer_gettime64); +#endif +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +__REDIR(stime, __stime64); +__REDIR(timegm, __timegm_time64); +#endif +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/utime.h b/libc-top-half/musl/include/utime.h index dd5ff92..5755bd5 100644 --- a/libc-top-half/musl/include/utime.h +++ b/libc-top-half/musl/include/utime.h @@ -5,6 +5,8 @@ extern "C" { #endif +#include + #define __NEED_time_t #include @@ -16,6 +18,10 @@ struct utimbuf { int utime (const char *, const struct utimbuf *); +#if _REDIR_TIME64 +__REDIR(utime, __utime64); +#endif + #ifdef __cplusplus } #endif diff --git a/libc-top-half/musl/include/utmpx.h b/libc-top-half/musl/include/utmpx.h index 0429014..b293f42 100644 --- a/libc-top-half/musl/include/utmpx.h +++ b/libc-top-half/musl/include/utmpx.h @@ -16,6 +16,7 @@ extern "C" { struct utmpx { short ut_type; + short __ut_pad1; pid_t ut_pid; char ut_line[32]; char ut_id[4]; @@ -25,7 +26,11 @@ struct utmpx { short __e_termination; short __e_exit; } ut_exit; - long ut_session; +#if __BYTE_ORDER == 1234 + int ut_session, __ut_pad2; +#else + int __ut_pad2, ut_session; +#endif struct timeval ut_tv; unsigned ut_addr_v6[4]; char __unused[20]; diff --git a/libc-top-half/musl/ldso/dynlink.c b/libc-top-half/musl/ldso/dynlink.c index 7ac0bf7..afec985 100644 --- a/libc-top-half/musl/ldso/dynlink.c +++ b/libc-top-half/musl/ldso/dynlink.c @@ -107,6 +107,8 @@ struct symdef { struct dso *dso; }; +typedef void (*stage3_func)(size_t *, size_t *); + static struct builtin_tls { char c; struct pthread pt; @@ -183,8 +185,14 @@ static void *laddr_pg(const struct dso *p, size_t v) } return (void *)(v - p->loadmap->segs[j].p_vaddr + p->loadmap->segs[j].addr); } -#define fpaddr(p, v) ((void (*)())&(struct funcdesc){ \ - laddr(p, v), (p)->got }) +static void (*fdbarrier(void *p))() +{ + void (*fd)(); + __asm__("" : "=r"(fd) : "0"(p)); + return fd; +} +#define fpaddr(p, v) fdbarrier((&(struct funcdesc){ \ + laddr(p, v), (p)->got })) #else #define laddr(p, v) (void *)((p)->base + (v)) #define laddr_pg(p, v) laddr(p, v) @@ -1594,13 +1602,14 @@ static void install_new_tls(void) hidden void __dls2(unsigned char *base, size_t *sp) { + size_t *auxv; + for (auxv=sp+1+*sp+1; *auxv; auxv++); + auxv++; if (DL_FDPIC) { void *p1 = (void *)sp[-2]; void *p2 = (void *)sp[-1]; if (!p1) { - size_t *auxv, aux[AUX_CNT]; - for (auxv=sp+1+*sp+1; *auxv; auxv++); - auxv++; + size_t aux[AUX_CNT]; decode_vec(auxv, aux, AUX_CNT); if (aux[AT_BASE]) ldso.base = (void *)aux[AT_BASE]; else ldso.base = (void *)(aux[AT_PHDR] & -4096); @@ -1646,8 +1655,8 @@ hidden void __dls2(unsigned char *base, size_t *sp) * symbolically as a barrier against moving the address * load across the above relocation processing. */ struct symdef dls2b_def = find_sym(&ldso, "__dls2b", 0); - if (DL_FDPIC) ((stage3_func)&ldso.funcdescs[dls2b_def.sym-ldso.syms])(sp); - else ((stage3_func)laddr(&ldso, dls2b_def.sym->st_value))(sp); + if (DL_FDPIC) ((stage3_func)&ldso.funcdescs[dls2b_def.sym-ldso.syms])(sp, auxv); + else ((stage3_func)laddr(&ldso, dls2b_def.sym->st_value))(sp, auxv); } /* Stage 2b sets up a valid thread pointer, which requires relocations @@ -1656,11 +1665,13 @@ hidden void __dls2(unsigned char *base, size_t *sp) * so that loads of the thread pointer and &errno can be pure/const and * thereby hoistable. */ -void __dls2b(size_t *sp) +void __dls2b(size_t *sp, size_t *auxv) { /* Setup early thread pointer in builtin_tls for ldso/libc itself to * use during dynamic linking. If possible it will also serve as the * thread pointer at runtime. */ + search_vec(auxv, &__hwcap, AT_HWCAP); + libc.auxv = auxv; libc.tls_size = sizeof builtin_tls; libc.tls_align = tls_align; if (__init_tp(__copy_tls((void *)builtin_tls)) < 0) { @@ -1668,8 +1679,8 @@ void __dls2b(size_t *sp) } struct symdef dls3_def = find_sym(&ldso, "__dls3", 0); - if (DL_FDPIC) ((stage3_func)&ldso.funcdescs[dls3_def.sym-ldso.syms])(sp); - else ((stage3_func)laddr(&ldso, dls3_def.sym->st_value))(sp); + if (DL_FDPIC) ((stage3_func)&ldso.funcdescs[dls3_def.sym-ldso.syms])(sp, auxv); + else ((stage3_func)laddr(&ldso, dls3_def.sym->st_value))(sp, auxv); } /* Stage 3 of the dynamic linker is called with the dynamic linker/libc @@ -1677,10 +1688,10 @@ void __dls2b(size_t *sp) * process dependencies and relocations for the main application and * transfer control to its entry point. */ -void __dls3(size_t *sp) +void __dls3(size_t *sp, size_t *auxv) { static struct dso app, vdso; - size_t aux[AUX_CNT], *auxv; + size_t aux[AUX_CNT]; size_t i; char *env_preload=0; char *replace_argv0=0; @@ -1693,10 +1704,7 @@ void __dls3(size_t *sp) /* Find aux vector just past environ[] and use it to initialize * global data that may be needed before we can make syscalls. */ __environ = envp; - for (i=argc+1; argv[i]; i++); - libc.auxv = auxv = (void *)(argv+i+1); decode_vec(auxv, aux, AUX_CNT); - __hwcap = aux[AT_HWCAP]; search_vec(auxv, &__sysinfo, AT_SYSINFO); __pthread_self()->sysinfo = __sysinfo; libc.page_size = aux[AT_PAGESZ]; @@ -2237,6 +2245,33 @@ hidden void *__dlsym(void *restrict p, const char *restrict s, void *restrict ra return res; } +hidden void *__dlsym_redir_time64(void *restrict p, const char *restrict s, void *restrict ra) +{ +#if _REDIR_TIME64 + const char *suffix, *suffix2 = ""; + char redir[36]; + + /* Map the symbol name to a time64 version of itself according to the + * pattern used for naming the redirected time64 symbols. */ + size_t l = strnlen(s, sizeof redir); + if (l<4 || l==sizeof redir) goto no_redir; + if (s[l-2]=='_' && s[l-1]=='r') { + l -= 2; + suffix2 = s+l; + } + if (l<4) goto no_redir; + if (!strcmp(s+l-4, "time")) suffix = "64"; + else suffix = "_time64"; + + /* Use the presence of the remapped symbol name in libc to determine + * whether it's one that requires time64 redirection; replace if so. */ + snprintf(redir, sizeof redir, "__%.*s%s%s", (int)l, s, suffix, suffix2); + if (find_sym(&ldso, redir, 1).sym) s = redir; +no_redir: +#endif + return __dlsym(p, s, ra); +} + int dl_iterate_phdr(int(*callback)(struct dl_phdr_info *info, size_t size, void *data), void *data) { struct dso *current; diff --git a/libc-top-half/musl/src/aio/aio_suspend.c b/libc-top-half/musl/src/aio/aio_suspend.c index 9b24b6a..34b66f8 100644 --- a/libc-top-half/musl/src/aio/aio_suspend.c +++ b/libc-top-half/musl/src/aio/aio_suspend.c @@ -73,4 +73,6 @@ int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec } } +#if !_REDIR_TIME64 weak_alias(aio_suspend, aio_suspend64); +#endif diff --git a/libc-top-half/musl/src/complex/cacosh.c b/libc-top-half/musl/src/complex/cacosh.c index 8e42f1a..76127f7 100644 --- a/libc-top-half/musl/src/complex/cacosh.c +++ b/libc-top-half/musl/src/complex/cacosh.c @@ -4,6 +4,9 @@ double complex cacosh(double complex z) { + int zineg = signbit(cimag(z)); + z = cacos(z); - return CMPLX(-cimag(z), creal(z)); + if (zineg) return CMPLX(cimag(z), -creal(z)); + else return CMPLX(-cimag(z), creal(z)); } diff --git a/libc-top-half/musl/src/complex/cacoshf.c b/libc-top-half/musl/src/complex/cacoshf.c index d7e6b54..8bd8058 100644 --- a/libc-top-half/musl/src/complex/cacoshf.c +++ b/libc-top-half/musl/src/complex/cacoshf.c @@ -2,6 +2,9 @@ float complex cacoshf(float complex z) { + int zineg = signbit(cimagf(z)); + z = cacosf(z); - return CMPLXF(-cimagf(z), crealf(z)); + if (zineg) return CMPLXF(cimagf(z), -crealf(z)); + else return CMPLXF(-cimagf(z), crealf(z)); } diff --git a/libc-top-half/musl/src/complex/cacoshl.c b/libc-top-half/musl/src/complex/cacoshl.c index d3eaee2..3a284be 100644 --- a/libc-top-half/musl/src/complex/cacoshl.c +++ b/libc-top-half/musl/src/complex/cacoshl.c @@ -8,7 +8,10 @@ long double complex cacoshl(long double complex z) #else long double complex cacoshl(long double complex z) { + int zineg = signbit(cimagl(z)); + z = cacosl(z); - return CMPLXL(-cimagl(z), creall(z)); + if (zineg) return CMPLXL(cimagl(z), -creall(z)); + else return CMPLXL(-cimagl(z), creall(z)); } #endif diff --git a/libc-top-half/musl/src/complex/catanf.c b/libc-top-half/musl/src/complex/catanf.c index e10d9c0..ef3907a 100644 --- a/libc-top-half/musl/src/complex/catanf.c +++ b/libc-top-half/musl/src/complex/catanf.c @@ -87,29 +87,17 @@ float complex catanf(float complex z) x = crealf(z); y = cimagf(z); - if ((x == 0.0f) && (y > 1.0f)) - goto ovrf; - x2 = x * x; a = 1.0f - x2 - (y * y); - if (a == 0.0f) - goto ovrf; t = 0.5f * atan2f(2.0f * x, a); w = _redupif(t); t = y - 1.0f; a = x2 + (t * t); - if (a == 0.0f) - goto ovrf; t = y + 1.0f; a = (x2 + (t * t))/a; - w = w + (0.25f * logf (a)) * I; - return w; - -ovrf: - // FIXME - w = MAXNUMF + MAXNUMF * I; + w = CMPLXF(w, 0.25f * logf(a)); return w; } diff --git a/libc-top-half/musl/src/complex/catanl.c b/libc-top-half/musl/src/complex/catanl.c index a9fc02d..e62526c 100644 --- a/libc-top-half/musl/src/complex/catanl.c +++ b/libc-top-half/musl/src/complex/catanl.c @@ -97,30 +97,18 @@ long double complex catanl(long double complex z) x = creall(z); y = cimagl(z); - if ((x == 0.0L) && (y > 1.0L)) - goto ovrf; - x2 = x * x; a = 1.0L - x2 - (y * y); - if (a == 0.0L) - goto ovrf; t = atan2l(2.0L * x, a) * 0.5L; w = redupil(t); t = y - 1.0L; a = x2 + (t * t); - if (a == 0.0L) - goto ovrf; t = y + 1.0L; a = (x2 + (t * t)) / a; - w = w + (0.25L * logl(a)) * I; - return w; - -ovrf: - // FIXME - w = LDBL_MAX + LDBL_MAX * I; + w = CMPLXF(w, 0.25L * logl(a)); return w; } #endif diff --git a/libc-top-half/musl/src/ctype/alpha.h b/libc-top-half/musl/src/ctype/alpha.h index 299277c..4167f38 100644 --- a/libc-top-half/musl/src/ctype/alpha.h +++ b/libc-top-half/musl/src/ctype/alpha.h @@ -8,17 +8,17 @@ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, 17,17,17,17,17,17,17,63,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,64,65,17,66,67, -68,69,70,71,72,73,74,17,75,76,77,78,79,80,16,16,16,81,82,83,84,85,86,87,88,89, -16,90,16,91,92,16,16,17,17,17,93,94,95,16,16,16,16,16,16,16,16,16,16,17,17,17, -17,96,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,97,16,16,16,16,16,16, +68,69,70,71,72,73,74,17,75,76,77,78,79,80,81,16,82,83,84,85,86,87,88,89,90,91, +92,93,16,94,95,96,16,17,17,17,97,98,99,16,16,16,16,16,16,16,16,16,16,17,17,17, +17,100,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,101,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,17,17,98,99,16,16,16,100,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, -17,17,17,17,17,17,17,101,17,17,102,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,103, -104,16,16,16,16,16,16,16,16,16,105,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,16,16,106,107,108,109,16,16,16,16,16,16,16,16,110,16,16, -16,16,16,16,16,111,112,16,16,16,16,113,16,16,114,16,16,16,16,16,16,16,16,16, -16,16,16,16, +16,16,17,17,102,103,16,16,104,105,17,17,17,17,17,17,17,17,17,17,17,17,17,17, +17,17,17,17,17,17,17,17,17,106,17,17,107,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17, +108,109,16,16,16,16,16,16,16,16,16,110,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,111,112,113,114,16,16,16,16,16,16,16,16,115,116, +117,16,16,16,16,16,118,119,16,16,16,16,120,16,16,121,16,16,16,16,16,16,16,16, +16,16,16,16,16, 16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,254,255,255,7,254, @@ -27,8 +27,8 @@ 255,195,255,3,0,31,80,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,223,188,64,215,255,255, 251,255,255,255,255,255,255,255,255,255,191,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,3,252,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,254,255,255,255,127,2,254,255,255, -255,255,0,0,0,0,0,255,191,182,0,255,255,255,7,7,0,0,0,255,7,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,254,255,255,255,127,2,255,255,255, +255,255,1,0,0,0,0,255,191,182,0,255,255,255,135,7,0,0,0,255,7,255,255,255,255, 255,255,255,254,255,195,255,255,255,255,255,255,255,255,255,255,255,255,239, 31,254,225,255, 159,0,0,255,255,255,255,255,255,0,224,255,255,255,255,255,255,255,255,255,255, @@ -42,54 +42,55 @@ 255,0,0,239,223,253,255,255,253,239,227,223,29,96,64,207,255,6,0,239,223,253, 255,255,255,255,231,223,93,240,128,207,255,0,252,236,255,127,252,255,255,251, 47,127,128,95,255,192,255,12,0,254,255,255,255,255,127,255,7,63,32,255,3,0,0, -0,0,150,37,240,254,174,236,255,59,95,32,255,243,0,0,0, +0,0,214,247,255,255,175,255,255,59,95,32,255,243,0,0,0, 0,1,0,0,0,255,3,0,0,255,254,255,255,255,31,254,255,3,255,255,254,255,255,255, -31,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,249,255,3,255,255,231,193,255, -255,127,64,255,51,255,255,255,255,191,32,255,255,255,255,255,247,255,255,255, +31,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,249,255,3,255,255,255,255,255, +255,255,255,255,63,255,255,255,255,191,32,255,255,255,255,255,247,255,255,255, 255,255,255,255,255,255,61,127,61,255,255,255,255,255,61,255,255,255,255,61, 127,61,255,127,255,255,255,255,255,255,255,61,255,255,255,255,255,255,255,255, -135,0,0,0,0,255,255,0,0,255,255,255,255,255,255,255,255,255,255,63,63,254,255, +7,0,0,0,0,255,255,0,0,255,255,255,255,255,255,255,255,255,255,63,63,254,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,159,255,255,254,255,255,7,255,255,255,255,255,255,255,255, 255,199,255,1,255,223,15,0,255,255,15,0,255,255,15,0,255,223,13,0,255,255,255, 255,255,255,207,255,255,1,128,16,255,3,0,0,0,0,255,3,255,255,255,255,255,255, -255,255,255,255,255,0,255,255,255,255,255,7,255,255,255,255,255,255,255,255, +255,255,255,255,255,1,255,255,255,255,255,7,255,255,255,255,255,255,255,255, 63, 0,255,255,255,127,255,15,255,1,192,255,255,255,255,63,31,0,255,255,255,255, 255,15,255,255,255,3,255,3,0,0,0,0,255,255,255,15,255,255,255,255,255,255,255, 127,254,255,31,0,255,3,255,3,128,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255, 255,239,255,239,15,255,3,0,0,0,0,255,255,255,255,255,243,255,255,255,255,255, -255,191,255,3,0,255,255,255,255,255,255,63,0,255,227,255,255,255,255,255,63, -255,1,0,0,0,0,0,0,0,0,0,0,0,222,111,0,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,128,255,31,0, -255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,255,255,255,255, -255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,128, -0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,132,252,47,62,80,189,255,243,224,67,0,0, -255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0, +255,191,255,3,0,255,255,255,255,255,255,127,0,255,227,255,255,255,255,255,63, +255,1,255,255,255,255,255,231,0,0,0,0,0,222,111,4,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0, +128,255,31,0,255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,255, +255,255,255,255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,2,128,0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,132,252,47,62,80,189,255,243, +224,67,0,0,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,255,255,255,255,255,255,3,0, 0,255,255,255,255,255,127,255,255,255,255,255,127,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,31,120,12,0,255,255,255,255,191,32,255, 255,255,255,255,255,255,128,0,0,255,255,127,0,127,127,127,127,127,127,127,127, 255,255,255,255,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,224,0,0,0,254,3,62,31,254,255,255,255,255,255,255,255,255,255,127,224,254, -255,255,255,255,255,255,255,255,255,255,247,224,255,255,255,255,127,254,255, +255,255,255,255,255,255,255,255,255,255,247,224,255,255,255,255,255,254,255, 255,255,255,255,255,255,255,255,255,127,0,0,255,255,255,7,0,0,0,0,0,0,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,63,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0, 0,0,0,0,0,0,255,255,255,255,255,63,255,31,255,255,255,15,0,0,255,255,255,255, 255,127,240,143,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0, 0,128,255,252,255,255,255,255,255,255,255,255,255,255,255,255,249,255,255,255, -127,255,0,0,0,0,0,0,0,128,255,187,247,255,255,255,0,0,0,255,255,255,255,255, -255,15,0,255,255,255,255,255,255,255,255,47,0,255,3,0,0,252,40,255,255,255, -255,255,7,255,255,255,255,7,0,255,255,255,31,255,255,255,255,255,255,247,255, -0,128,255,3,223,255,255,127,255,255,255,255,255,255,127,0,255,63,255,3,255, -255,127,196,255,255,255,255,255,255,255,127,5,0,0,56,255,255,60,0,126,126,126, -0,127,127,255,255,255,255,255,247,63,0,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,7,255,3,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,15,0,255,255,127,248,255,255,255,255,255, +255,255,255,124,0,0,0,0,0,128,255,191,255,255,255,255,0,0,0,255,255,255,255, +255,255,15,0,255,255,255,255,255,255,255,255,47,0,255,3,0,0,252,232,255,255, +255,255,255,7,255,255,255,255,7,0,255,255,255,31,255,255,255,255,255,255,247, +255,0,128,255,3,255,255,255,127,255,255,255,255,255,255,127,0,255,63,255,3, +255,255,127,252,255,255,255,255,255,255,255,127,5,0,0,56,255,255,60,0,126,126, +126,0,127,127,255,255,255,255,255,247,255,0,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,7,255,3,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,15,0,255,255,127,248,255,255,255,255, +255, 15,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,255,255, 255,255,255,255,255,255,255,255,3,0,0,0,0,127,0,248,224,255,253,127,95,219, 255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,248,255,255,255, @@ -109,55 +110,63 @@ 0,0,0,0,0,0,0,0,0,0,0,0,63,253,255,255,255,255,191,145,255,255,63,0,255,255, 127,0,255,255,255,127,0,0,0,0,0,0,0,0,255,255,55,0,255,255,63,0,255,255,255,3, 0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,192,0,0,0,0,0,0,0,0,111,240,239, -254,255,255,15,0,0,0,0,0,255,255,255,31,255,255,255,31,0,0,0,0,255,254,255, +254,255,255,63,0,0,0,0,0,255,255,255,31,255,255,255,31,0,0,0,0,255,254,255, 255,31,0,0,0,255,255,255,255,255,255,63,0,255,255,63,0,255,255,7,0,255,255,3, 0,0,0,0,0,0,0,0,0,0,0,0, 0,255,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,255,255,255,255,255,255,7, -0,255,255,255,255,255,255,7,0,255,255,255,255,255,255,255,255,63,0,0,0,192, -255,0,0,252,255,255,255,255,255,255,1,0,0,255,255,255,1,255,3,255,255,255,255, -255,255,199,255,0,0,255,255,255,255,71,0,255,255,255,255,255,255,255,255,30,0, -255,23,0,0,0,0,255,255,251,255,255,255,159,64,0,0,0,0,0,0,0,0,127,189,255,191, -255,1,255,255,255,255,255,255,255,1,255,3,239,159,249,255,255,253,237,227,159, -25,129,224,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255, -255,255,187,7,255,3,0,0,0,0,255,255,255,255,255,255,255,255,179,0,255,3,0,0,0, +0,255,255,255,255,255,255,7,0,255,255,255,255,255,0,255,3,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,31,128,0,255,255,63,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,255,255,127,0,255,255,255,255,255,255,255,255,63,0,0,0, +192,255,0,0,252,255,255,255,255,255,255,1,0,0,255,255,255,1,255,3,255,255,255, +255,255,255,199,255,112,0,255,255,255,255,71,0,255,255,255,255,255,255,255, +255,30,0,255,23,0,0,0,0,255,255,251,255,255,255,159,64,0,0,0,0,0,0,0,0,127, +189,255,191,255,1,255,255,255,255,255,255,255,1,255,3,239,159,249,255,255,253, +237,227,159,25,129,224,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255, +255,255,255,255,255,187,7,255,131,0,0,0,0,255,255,255,255,255,255,255,255,179, +0,255,3,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,63,127,0,0,0,63,0,0, 0,0,255,255,255,255,255,255,255,127,17,0,255,3,0,0,0,0,255,255,255,255,255, -255,63,0,255,3,0,0,0,0,0, -0,255,255,255,227,255,7,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,3, -0,128,255,255,255,255,255,255,231,127,0,0,255,255,255,255,255,255,207,255,255, -0,0,0,0,0,255,255,255,255,255,255,255,1,255,253,255,255,255,255,127,127,1,0, -255,3,0,0,252,255,255,255,252,255,255,254,127,0,0,0,0,0,0,0,0,0,127,251,255, -255,255,255,127,180,203,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255, +255,63,1,255,3,0,0,0,0,0,0,255,255,255,231,255,7,255,3,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0, +0,255,255,255,255,255,255,255,255,255,3,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,255,252,255,255,255,255,255,252,26,0,0,0,255,255,255,255,255,255,231, +127,0,0,255,255,255,255,255,255,255,255,255,32,0,0,0,0,255,255,255,255,255, +255,255,1,255,253,255,255,255,255,127,127,1,0,255,3,0,0,252,255,255,255,252, +255,255,254,127,0,0,0,0,0,0,0,0,0,127,251,255,255,255,255,127,180,203,0,255,3, +191,253,255,255,255,127,123,1,255,3,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,127,0,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0, 0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,127,0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -255,255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,255,255,255,255,255,255,255,1,255,255,255,127,255,3,0,0,0,0,0,0,0,0,0,0,0, -0,255,255,255,63,0,0,255,255,255,255,255,255,127,0,15,0,255,3,248,255,255,224, -255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,31,0,255, -255,255,255,255,127,0,0,248,255,0,0,0,0,0,0,0,0,3,0,0,0,255,255,255,255,255, +255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255, +255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255, +255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255, +255,255,255,255,255,255,1,255,255,255,127,255,3,0,0,0,0,0,0,0,0,0,0,0,0,255, +255,255,63,0,0,255,255,255,255,255,255,0,0,15,0,255,3,248,255,255,224,255,255, +0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,255,255,255,255,255,255,255,255,255,135,255,255,255,255,255,255,255,128, +255,255,0,0,0,0,0,0,0,0,11,0,0,0,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,31,0,0,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0, -255,255,255,127,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255, +255,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,7,0,255,255,255,127,0,0,0,0,0, +0,7,0,240,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,15,255,255,255,255,255, -255,255,255,255,255,255,255,255,7,255,31,255,1,255,67,0,0,0,0,0,0,0,0,0,0,0,0, -255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,255,255,255, -223,100,222,255,235,239,255,255,255,255,255,255,255,191,231,223,223,255,255, -255,123,95,252,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,255,255,255,255, +255,255,255,255,255,255,255,255,255,7,255,31,255,1,255,67,0,0,0,0,0,0,0,0,0,0, +0,0,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,255,255, +255,223,100,222,255,235,239,255,255,255,255,255,255, +255,191,231,223,223,255,255,255,123,95,252,253,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,63,255,255,255,253,255,255,247,255,255,255, -247,255,255,223,255,255,255,223,255,255,127,255,255,255,127,255,255,255,253, -255,255,255,253,255,255,247,207,255,255,255,255,255,255,127,255,255,249,219,7, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0, -0,0,0,0,0, -0,255,255,255,255,255,255,255,255,143,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,239,255,255,255,150,254,247,10,132,234,150,170,150,247,247,94,255,251, -255,15,238,251,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,255,255,255,3, -255,255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255, +253,255,255,247,255,255,255,247,255,255,223,255,255,255,223,255,255,127,255, +255,255,127,255,255,255,253,255,255,255,253,255,255,247,207,255,255,255,255, +255,255,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,255,255,255,255,255,31,128,63,255,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255, +15,255,3,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,31,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255, +143,8,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,239,255,255,255,150,254,247,10,132,234,150,170,150,247,247,94,255,251,255, +15,238,251,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,255,255,255,3,255, +255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0, diff --git a/libc-top-half/musl/src/ctype/casemap.h b/libc-top-half/musl/src/ctype/casemap.h new file mode 100644 index 0000000..6ee1209 --- /dev/null +++ b/libc-top-half/musl/src/ctype/casemap.h @@ -0,0 +1,297 @@ +static const unsigned char tab[] = { + 7, 8, 9, 10, 11, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 13, 6, 6, 14, 6, 6, 6, 6, 6, 6, 6, 6, 15, 16, 17, 18, + 6, 19, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 20, 21, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 22, 23, 6, 6, 6, 24, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 25, + 6, 6, 6, 6, 26, 6, 6, 6, 6, 6, 6, 6, 27, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 28, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 29, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 30, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, + 43, 43, 43, 43, 43, 43, 43, 43, 1, 0, 84, 86, 86, 86, 86, 86, + 86, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 43, 43, 43, 43, 43, 43, + 43, 7, 43, 43, 91, 86, 86, 86, 86, 86, 86, 86, 74, 86, 86, 5, + 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, + 36, 80, 121, 49, 80, 49, 80, 49, 56, 80, 49, 80, 49, 80, 49, 80, + 49, 80, 49, 80, 49, 80, 49, 80, 78, 49, 2, 78, 13, 13, 78, 3, + 78, 0, 36, 110, 0, 78, 49, 38, 110, 81, 78, 36, 80, 78, 57, 20, + 129, 27, 29, 29, 83, 49, 80, 49, 80, 13, 49, 80, 49, 80, 49, 80, + 27, 83, 36, 80, 49, 2, 92, 123, 92, 123, 92, 123, 92, 123, 92, 123, + 20, 121, 92, 123, 92, 123, 92, 45, 43, 73, 3, 72, 3, 120, 92, 123, + 20, 0, 150, 10, 1, 43, 40, 6, 6, 0, 42, 6, 42, 42, 43, 7, + 187, 181, 43, 30, 0, 43, 7, 43, 43, 43, 1, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 1, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 205, 70, 205, 43, 0, 37, 43, 7, 1, 6, 1, 85, 86, 86, 86, + 86, 86, 85, 86, 86, 2, 36, 129, 129, 129, 129, 129, 21, 129, 129, 129, + 0, 0, 43, 0, 178, 209, 178, 209, 178, 209, 178, 209, 0, 0, 205, 204, + 1, 0, 215, 215, 215, 215, 215, 131, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 129, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 28, 0, 0, 0, + 0, 0, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 2, 0, 0, + 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, + 49, 80, 78, 49, 80, 49, 80, 78, 49, 80, 49, 80, 49, 80, 49, 80, + 49, 80, 49, 80, 49, 80, 49, 2, 135, 166, 135, 166, 135, 166, 135, 166, + 135, 166, 135, 166, 135, 166, 135, 166, 42, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 0, 0, 0, 84, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 84, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 12, 0, 12, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 7, 42, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 86, 86, 108, 129, 21, 0, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 7, 108, 3, 65, 43, 43, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 44, 86, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 12, 108, 0, 0, 0, 0, 0, 6, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, + 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, + 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, + 6, 37, 6, 37, 6, 37, 6, 37, 86, 122, 158, 38, 6, 37, 6, 37, + 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, + 6, 37, 6, 37, 6, 37, 6, 37, 6, 37, 6, 1, 43, 43, 79, 86, + 86, 44, 43, 127, 86, 86, 57, 43, 43, 85, 86, 86, 43, 43, 79, 86, + 86, 44, 43, 127, 86, 86, 129, 55, 117, 91, 123, 92, 43, 43, 79, 86, + 86, 2, 172, 4, 0, 0, 57, 43, 43, 85, 86, 86, 43, 43, 79, 86, + 86, 44, 43, 43, 86, 86, 50, 19, 129, 87, 0, 111, 129, 126, 201, 215, + 126, 45, 129, 129, 14, 126, 57, 127, 111, 87, 0, 129, 129, 126, 21, 0, + 126, 3, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 7, 43, + 36, 43, 151, 43, 43, 43, 43, 43, 43, 43, 43, 43, 42, 43, 43, 43, + 43, 43, 86, 86, 86, 86, 86, 128, 129, 129, 129, 129, 57, 187, 42, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 1, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 201, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 208, 13, 0, 78, 49, 2, 180, 193, 193, + 215, 215, 36, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, + 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, 49, 80, + 49, 80, 49, 80, 215, 215, 83, 193, 71, 212, 215, 215, 215, 5, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 7, 1, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 49, 80, 49, 80, 49, 80, + 49, 80, 49, 80, 49, 80, 49, 80, 13, 0, 0, 0, 0, 0, 36, 80, + 49, 80, 49, 80, 49, 80, 49, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 121, 92, 123, 92, 123, 79, 123, 92, 123, 92, 123, + 92, 123, 92, 123, 92, 123, 92, 123, 92, 123, 92, 123, 92, 123, 92, 45, + 43, 43, 121, 20, 92, 123, 92, 45, 121, 42, 92, 39, 92, 123, 92, 123, + 92, 123, 164, 0, 10, 180, 92, 123, 92, 123, 79, 3, 42, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 43, 43, 43, 43, 43, 43, 43, 43, 7, 0, 72, 86, 86, 86, 86, + 86, 86, 86, 86, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 85, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 36, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 7, 0, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 7, 0, 0, + 0, 0, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 14, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 85, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 14, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; +static const int rules[] = { + 0x0, 0x2001, -0x2000, 0x1dbf00, 0x2e700, 0x7900, + 0x2402, 0x101, -0x100, 0x0, 0x201, -0x200, + -0xc6ff, -0xe800, -0x78ff, -0x12c00, 0xc300, 0xd201, + 0xce01, 0xcd01, 0x4f01, 0xca01, 0xcb01, 0xcf01, + 0x6100, 0xd301, 0xd101, 0xa300, 0xd501, 0x8200, + 0xd601, 0xda01, 0xd901, 0xdb01, 0x3800, 0x3, + -0x4f00, -0x60ff, -0x37ff, 0x242802, 0x0, 0x101, + -0x100, -0xcd00, -0xda00, -0x81ff, 0x2a2b01, -0xa2ff, + 0x2a2801, 0x2a3f00, -0xc2ff, 0x4501, 0x4701, 0x2a1f00, + 0x2a1c00, 0x2a1e00, -0xd200, -0xce00, -0xca00, -0xcb00, + 0xa54f00, 0xa54b00, -0xcf00, 0xa52800, 0xa54400, -0xd100, + -0xd300, 0x29f700, 0xa54100, 0x29fd00, -0xd500, -0xd600, + 0x29e700, 0xa54300, 0xa52a00, -0x4500, -0xd900, -0x4700, + -0xdb00, 0xa51500, 0xa51200, 0x4c2402, 0x0, 0x2001, + -0x2000, 0x101, -0x100, 0x5400, 0x7401, 0x2601, + 0x2501, 0x4001, 0x3f01, -0x2600, -0x2500, -0x1f00, + -0x4000, -0x3f00, 0x801, -0x3e00, -0x3900, -0x2f00, + -0x3600, -0x800, -0x5600, -0x5000, 0x700, -0x7400, + -0x3bff, -0x6000, -0x6ff, 0x701a02, 0x101, -0x100, + 0x2001, -0x2000, 0x5001, 0xf01, -0xf00, 0x0, + 0x3001, -0x3000, 0x101, -0x100, 0x0, 0xbc000, + 0x1c6001, 0x0, 0x97d001, 0x801, -0x800, 0x8a0502, + 0x0, -0xbbfff, -0x186200, 0x89c200, -0x182500, -0x186e00, + -0x186d00, -0x186400, -0x186300, -0x185c00, 0x0, 0x8a3800, + 0x8a0400, 0xee600, 0x101, -0x100, 0x0, -0x3b00, + -0x1dbeff, 0x8f1d02, 0x800, -0x7ff, 0x0, 0x5600, + -0x55ff, 0x4a00, 0x6400, 0x8000, 0x7000, 0x7e00, + 0x900, -0x49ff, -0x8ff, -0x1c2500, -0x63ff, -0x6fff, + -0x7fff, -0x7dff, 0xac0502, 0x0, 0x1001, -0x1000, + 0x1c01, 0x101, -0x1d5cff, -0x20beff, -0x2045ff, -0x1c00, + 0xb10b02, 0x101, -0x100, 0x3001, -0x3000, 0x0, + -0x29f6ff, -0xee5ff, -0x29e6ff, -0x2a2b00, -0x2a2800, -0x2a1bff, + -0x29fcff, -0x2a1eff, -0x2a1dff, -0x2a3eff, 0x0, -0x1c6000, + 0x0, 0x101, -0x100, 0xbc0c02, 0x0, 0x101, + -0x100, -0xa543ff, 0x3a001, -0x8a03ff, -0xa527ff, 0x3000, + -0xa54eff, -0xa54aff, -0xa540ff, -0xa511ff, -0xa529ff, -0xa514ff, + -0x2fff, -0xa542ff, -0x8a37ff, 0x0, -0x97d000, -0x3a000, + 0x0, 0x2001, -0x2000, 0x0, 0x2801, -0x2800, + 0x0, 0x4001, -0x4000, 0x0, 0x2001, -0x2000, + 0x0, 0x2001, -0x2000, 0x0, 0x2201, -0x2200, +}; +static const unsigned char rulebases[] = { + 0, 6, 39, 81, 111, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 124, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 131, 142, 146, 151, + 0, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 196, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 198, 201, 0, 0, 0, 219, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, + 0, 0, 0, 0, 225, 0, 0, 0, 0, 0, 0, 0, 228, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 231, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 237, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; +static const unsigned char exceptions[][2] = { + { 48, 12 }, { 49, 13 }, { 120, 14 }, { 127, 15 }, + { 128, 16 }, { 129, 17 }, { 134, 18 }, { 137, 19 }, + { 138, 19 }, { 142, 20 }, { 143, 21 }, { 144, 22 }, + { 147, 19 }, { 148, 23 }, { 149, 24 }, { 150, 25 }, + { 151, 26 }, { 154, 27 }, { 156, 25 }, { 157, 28 }, + { 158, 29 }, { 159, 30 }, { 166, 31 }, { 169, 31 }, + { 174, 31 }, { 177, 32 }, { 178, 32 }, { 183, 33 }, + { 191, 34 }, { 197, 35 }, { 200, 35 }, { 203, 35 }, + { 221, 36 }, { 242, 35 }, { 246, 37 }, { 247, 38 }, + { 32, 45 }, { 58, 46 }, { 61, 47 }, { 62, 48 }, + { 63, 49 }, { 64, 49 }, { 67, 50 }, { 68, 51 }, + { 69, 52 }, { 80, 53 }, { 81, 54 }, { 82, 55 }, + { 83, 56 }, { 84, 57 }, { 89, 58 }, { 91, 59 }, + { 92, 60 }, { 97, 61 }, { 99, 62 }, { 101, 63 }, + { 102, 64 }, { 104, 65 }, { 105, 66 }, { 106, 64 }, + { 107, 67 }, { 108, 68 }, { 111, 66 }, { 113, 69 }, + { 114, 70 }, { 117, 71 }, { 125, 72 }, { 130, 73 }, + { 135, 74 }, { 137, 75 }, { 138, 76 }, { 139, 76 }, + { 140, 77 }, { 146, 78 }, { 157, 79 }, { 158, 80 }, + { 69, 87 }, { 123, 29 }, { 124, 29 }, { 125, 29 }, + { 127, 88 }, { 134, 89 }, { 136, 90 }, { 137, 90 }, + { 138, 90 }, { 140, 91 }, { 142, 92 }, { 143, 92 }, + { 172, 93 }, { 173, 94 }, { 174, 94 }, { 175, 94 }, + { 194, 95 }, { 204, 96 }, { 205, 97 }, { 206, 97 }, + { 207, 98 }, { 208, 99 }, { 209, 100 }, { 213, 101 }, + { 214, 102 }, { 215, 103 }, { 240, 104 }, { 241, 105 }, + { 242, 106 }, { 243, 107 }, { 244, 108 }, { 245, 109 }, + { 249, 110 }, { 253, 45 }, { 254, 45 }, { 255, 45 }, + { 80, 105 }, { 81, 105 }, { 82, 105 }, { 83, 105 }, + { 84, 105 }, { 85, 105 }, { 86, 105 }, { 87, 105 }, + { 88, 105 }, { 89, 105 }, { 90, 105 }, { 91, 105 }, + { 92, 105 }, { 93, 105 }, { 94, 105 }, { 95, 105 }, + { 130, 0 }, { 131, 0 }, { 132, 0 }, { 133, 0 }, + { 134, 0 }, { 135, 0 }, { 136, 0 }, { 137, 0 }, + { 192, 117 }, { 207, 118 }, { 128, 137 }, { 129, 138 }, + { 130, 139 }, { 133, 140 }, { 134, 141 }, { 112, 157 }, + { 113, 157 }, { 118, 158 }, { 119, 158 }, { 120, 159 }, + { 121, 159 }, { 122, 160 }, { 123, 160 }, { 124, 161 }, + { 125, 161 }, { 179, 162 }, { 186, 163 }, { 187, 163 }, + { 188, 164 }, { 190, 165 }, { 195, 162 }, { 204, 164 }, + { 218, 166 }, { 219, 166 }, { 229, 106 }, { 234, 167 }, + { 235, 167 }, { 236, 110 }, { 243, 162 }, { 248, 168 }, + { 249, 168 }, { 250, 169 }, { 251, 169 }, { 252, 164 }, + { 38, 176 }, { 42, 177 }, { 43, 178 }, { 78, 179 }, + { 132, 8 }, { 98, 186 }, { 99, 187 }, { 100, 188 }, + { 101, 189 }, { 102, 190 }, { 109, 191 }, { 110, 192 }, + { 111, 193 }, { 112, 194 }, { 126, 195 }, { 127, 195 }, + { 125, 207 }, { 141, 208 }, { 148, 209 }, { 171, 210 }, + { 172, 211 }, { 173, 212 }, { 176, 213 }, { 177, 214 }, + { 178, 215 }, { 196, 216 }, { 197, 217 }, { 198, 218 }, +}; diff --git a/libc-top-half/musl/src/ctype/nonspacing.h b/libc-top-half/musl/src/ctype/nonspacing.h index 48231e7..5d05a3d 100644 --- a/libc-top-half/musl/src/ctype/nonspacing.h +++ b/libc-top-half/musl/src/ctype/nonspacing.h @@ -8,16 +8,16 @@ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,49,16,16,50, -51,16,52,53,54,16,16,16,16,16,16,55,16,16,16,16,16,56,57,58,59,60,61,62,63,16, -16,64,16,65,66,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +51,16,52,53,54,16,16,16,16,16,16,55,16,16,56,16,57,58,59,60,61,62,63,64,65,66, +67,68,16,69,70,71,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,72,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,73,74,16,16,16,75,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,67,68,16,16,16,69,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,70,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,71,72,16,16,16,16,16,16,16,73,16,16,16,16,16,74,16,16,16,16,16,16,16,75, -76,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,76,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,77,78,16,16,16,16,16,16,16,79,16,16,16,16,16,80,81,82,16,16,16,16,16,83, +84,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, @@ -25,16 +25,16 @@ 0,0,0,0,0,0,0,248,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,254,255,255,255,255,191,182,0,0,0,0,0,0,0,63,0,255,23,0,0,0,0,0,248,255, 255,0,0,1,0,0,0,0,0,0,0,0,0,0,0,192,191,159,61,0,0,0,128,2,0,0,0,255,255,255, -7,0,0,0,0,0,0,0,0,0,0,192,255,1,0,0,0,0,0,0,248,15,0,0,0,192,251,239,62,0,0,0, -0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,255,255,255,255, +7,0,0,0,0,0,0,0,0,0,0,192,255,1,0,0,0,0,0,0,248,15,32,0,0,192,251,239,62,0,0, +0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,255,255,255,255, 255,7,0,0,0,0,0,0,20,254,33,254,0,12,0,0,0,2,0,0,0,0,0,0,16,30,32,0,0,12,0,0, -0,6,0,0,0,0,0,0,16,134,57,2,0,0,0,35,0,6,0,0,0,0,0,0,16,190,33,0,0,12,0,0,252, -2,0,0,0,0,0,0,144,30,32,64,0,12,0,0,0,4,0,0,0,0,0,0,0,1,32,0,0,0,0,0,0,1,0,0, -0,0,0,0,192,193,61,96,0,12,0,0,0,2,0,0,0,0,0,0,144,64,48,0,0,12,0,0,0,3,0,0,0, -0,0,0,24,30,32,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,4,92,0,0,0,0,0,0,0,0,0,0,0,242, -7,128,127,0,0,0,0,0,0,0,0,0,0,0,0,242,27,0,63,0,0,0,0,0,0,0,0,0,3,0,0,160,2,0, -0,0,0,0,0,254,127,223,224,255,254,255,255,255,31,64,0,0,0,0,0,0,0,0,0,0,0,0, -224,253,102,0,0,0,195,1,0,30,0,100,32,0,32,0,0,0,0,0,0,0,0,0,0,0, +64,6,0,0,0,0,0,0,16,134,57,2,0,0,0,35,0,6,0,0,0,0,0,0,16,190,33,0,0,12,0,0, +252,2,0,0,0,0,0,0,144,30,32,64,0,12,0,0,0,4,0,0,0,0,0,0,0,1,32,0,0,0,0,0,0,17, +0,0,0,0,0,0,192,193,61,96,0,12,0,0,0,2,0,0,0,0,0,0,144,64,48,0,0,12,0,0,0,3,0, +0,0,0,0,0,24,30,32,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,4,92,0,0,0,0,0,0,0,0,0,0,0, +242,7,128,127,0,0,0,0,0,0,0,0,0,0,0,0,242,31,0,63,0,0,0,0,0,0,0,0,0,3,0,0,160, +2,0,0,0,0,0,0,254,127,223,224,255,254,255,255,255,31,64,0,0,0,0,0,0,0,0,0,0,0, +0,224,253,102,0,0,0,195,1,0,30,0,100,32,0,32,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0, 0,0,28,0,0,0,12,0,0,0,12,0,0,0,0,0,0,0,176,63,64,254,15,32,0,0,0,0,0,120,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,1,4,14,0, @@ -48,9 +48,9 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0, 0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,128,247,63,0,0,0,192,0,0,0,0,0,0,0,0,0,0,3,0,68,8,0,0,96,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,255,255,3,0,0,0,0,0,192,63,0,0,128,255,3,0,0, -0,0,0,7,0,0,0,0,0,200,19,0,0,0,0,32,0,0,0,0,0,0,0,0,126,102,0,8,16,0,0,0,0,0, -16,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64, +0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,255,255,3,128,0,0,0,0,192,63,0,0,128,255,3,0, +0,0,0,0,7,0,0,0,0,0,200,51,0,0,0,0,32,0,0,0,0,0,0,0,0,126,102,0,8,16,0,0,0,0, +0,16,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,33,0,0,0,0,0,64, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,255,255,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -58,24 +58,32 @@ 0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,110,240,0,0,0,0,0,135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0, -0,2,0,0,0,0,0,0,255,127,0,0,0,0,0,0,128,3,0,0,0,0,0,120,38,0,0,0,0,0,0,0,0,7, -0,0,0,128,239,31,0,0,0,0,0,0,0,8,0,3,0,0,0,0,0,192,127,0,28,0,0,0,0,0,0,0,0,0, -0,0,128,211,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,248,7,0,0,3,0,0,0,0, -0,0,16,1,0,0,0,192,31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255, -92,0,0,0,0,0,0,0,0,0,0,0,0,0,248,133,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,60,176,1,0,0,48,0,0,0,0,0,0,0,0,0,0,248,167,1,0,0,0,0,0,0, -0,0,0,0,0,0,40,191,0,0,0,0,0,0,0,0,0,0,0,0,224,188,15,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0, -0,126,6,0,0,0,0,248,121,128,0,126,14,0,0,0,0,0,252,127,3,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,127,191,0,0,0,0,0,0,0,0,0,0,252,255,255,252,109,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,126,180,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,127, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -96,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,231,15,0,0, -0,60,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255, -255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248,254,255,0,0,0, -0,0,0,0,0,0,0,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0, -0,0,0,0,0,0,0,240,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,192,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,255, +127,0,0,0,0,0,0,128,3,0,0,0,0,0,120,38,0,32,0,0,0,0,0,0,7,0,0,0,128,239,31,0, +0,0,0,0,0,0,8,0,3,0,0,0,0,0,192,127,0,30,0,0,0,0,0,0,0,0,0,0,0,128,211,64,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,248,7,0,0,3,0,0,0,0,0,0,24,1,0,0,0,192, +31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,92,0,0,64,0,0,0,0,0, +0,0,0,0,0,248,133,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,60,176,1,0,0,48,0,0,0, +0,0,0,0,0,0,0,248,167,1,0,0,0,0,0,0,0,0,0,0,0,0,40,191,0,0,0,0,0,0,0,0,0,0,0, +0,224,188,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +128,255,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,12,1,0,0,0,254,7,0,0,0,0,248,121,128,0, +126,14,0,0,0,0,0,252,127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,191,0,0,0, +0,0,0,0,0,0,0,252,255,255,252,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,180,191,0, +0,0,0,0,0,0,0,0,163,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,24, +0,0,0,0,0,0,0,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,127,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0, +0,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,15, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,231,15,0,0,0,60,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,255,255,255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248, +254,255,0,0,0,0,0,0,0,0,0, +0,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,240,7,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0, diff --git a/libc-top-half/musl/src/ctype/punct.h b/libc-top-half/musl/src/ctype/punct.h index 7a62394..6792947 100644 --- a/libc-top-half/musl/src/ctype/punct.h +++ b/libc-top-half/musl/src/ctype/punct.h @@ -8,17 +8,17 @@ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,64,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,65,16,16,66,16,67,68, -69,16,70,71,72,16,73,16,16,74,75,76,77,78,16,79,16,80,81,82,83,84,85,86,87,88, -16,89,16,90,91,16,16,16,16,16,16,92,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +69,16,70,71,72,16,73,16,16,74,75,76,77,78,16,79,80,81,82,83,84,85,86,87,88,89, +90,91,16,92,93,94,95,16,16,16,16,96,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,97,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,98,99,16,16,100,101,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,93,94,16,16,16,95,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,96,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,97,98,99,100,16,16,101,102,17,17,103,16,16,16,16,16,16,16,16,16,16,16,16, -16,104,105,16,16,16,16,106,16,107,108,109,17,17,17,110,111,112,113,16,16,16, -16,16, +16,16,16,16,16,16,16,16,102,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,103,104,105,106,16,16,107,108,17,17,109,16,16,16,16,16,16,110,111,16, +16,16,16,16,112,113,16,16,114,115,116,16,117,118,119,17,17,17,120,121,122,123, +124,16,16,16,16, 16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,254,255,0,252,1,0,0,248,1, @@ -28,25 +28,25 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,252,0,0,0,0,0,230,254,255,255,255,0,64,73,0,0,0,0,0,24,0,255,255,0,216, 0,0,0,0,0,0,0,1,0,60,0,0,0,0,0,0,0,0,0,0,0,0,16,224,1,30,0, -96,255,191,0,0,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,207,3, -0,0,0,3,0,32,255,127,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,252,0,0,0,0,0, -0,0,0,0,16,0,32,30,0,48,0,1,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,252,47,0,0,0,0,0, -0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,3,224,0,0,0,0,0,0,0,16, -0,32,0,0,0,0,253,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,32,0, -0,0,0,0,255,0,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,160,0,127,0, -0,255,3,0,0,0,0,0,0,0,0,0,4,0,0,0,0,16,0,0,0,0,0,0,128,0,128,192,223,0,12,0,0, -0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0, +96,255,191,0,0,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,207, +227,0,0,0,3,0,32,255,127,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,7,252,0,0,0, +0,0,0,0,0,0,16,0,32,30,0,48,0,1,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,252,111,0,0,0, +0,0,0,0,16,0,32,0,0,0,0,64,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,3,224,0,0,0,0,0,0, +0,16,0,32,0,0,0,0,253,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,255,7,16,0,0,0,0,0,0,0,0, +32,0,0,0,0,128,255,16,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,160, +0,127,0,0,255,3,0,0,0,0,0,0,0,0,0,4,0,0,0,0,16,0,0,0,0,0,0,128,0,128,192,223, +0,12,0,0,0,0,0,0,0,0,0,0,0,4,0,31,0,0,0,0,0, 0,254,255,255,255,0,252,255,255,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,192,255,223, -255,7,0,0,0,0,0,0,0,0,0,0,128,6,0,252,0,0,24,62,0,0,128,191,0,204,0,0,0,0,0,0, -0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,96,255,255,255,31,0,0,255,3,0,0,0,0,0,0,0,0, -0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,96,0,0,1,0,0,24,0,0,0,0,0,0,0,0,0,56,0,0,0,0,16,0,0,0,112, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,254,127,47,0,0,255,3,255,127,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,49,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,196,255,255,255, +255,7,0,0,0,0,0,0,0,0,0,0,128,6,0,252,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0, +0,0,8,0,0,0,0,0,0,0,0,0,0,0,224,255,255,255,31,0,0,255,3,0,0,0,0,0,0,0,0,0,0, +0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,96,0,0,1,0,0,24,0,0,0,0,0,0,0,0,0,56,0,0,0,0,16,0,0,0,112,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,254,127,47,0,0,255,3,255,127,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,49,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,196,255,255,255, 255,0,0,0,192,0,0,0,0,0,0,0,0,1,0,224,159,0,0,0,0,127,63,255,127,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,16,0,16,0,0,252,255,255,255,31,0,0,0,0,0,12,0,0,0,0,0,0,64,0, -12,240,0,0,0,0,0,0,192,248,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,255,0,255,255, +12,240,0,0,0,0,0,0,128,248,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,255,0,255,255, 255,33,144,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255, 127,0,224,251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,3,224,0,224,0, 224,0,96,128,248,255,255,255,252,255,255,255,255,255,127,223,255,241,127,255, @@ -55,22 +55,23 @@ 255,255,255,255,255,127,0,0,0,255,7,0,0,255,255,255,255,255,255,255,255,255, 255,63,0,0,0,0,0,0,252,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,207,255,255,255, -63,255,255,255,255,227,255,253,7,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,224,135,3,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,128,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,127,255,255,255,3,0,0,0,0,0,0, -255,255,255,251,255,255,255,255,255,255,255,255,255,255,15,0,255,255,255,255, +63,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,135,3,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,127,255,255,255,255,0, +0,0,0,0,0,255,255,255,251,255,255,255,255,255,255,255,255,255,255,15,0,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,63,0,0,0,255,15,30,255,255,255,1,252,193,224,0,0,0,0,0,0,0,0,0,0, -0,30,1,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0, -0,0,255,255,255,255,15,0,0,0,255,255,255,127,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,63,0,0,0,255,15,30,255,255,255,1,252,193,224,0,0,0,0, +0,0,0,0,0,0,0,30,1,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +255,255,0,0,0,0,255,255,255,255,15,0,0,0,255,255,255,127,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255, +255,255,255, +255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255, 255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,0,0,0, 0,0,0,192,0,224,0,0,0,0,0,0,0,0,0,0,0,128,15,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 255,0,255,255,127,0,3,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -68,8,0,0,0,15,255,3,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,16,192,0,0,255,255,3,23, -0,0,0,0,0,248,0,0,0,0,8,128,0,0,0,0,0,0,0,0,0,0,8,0,255,63,0,192,32,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,240,0,0,128,59,0,0,0,0,0,0,0,128,2,0,0,192,0,0,67,0,0,0,0,0, +64,0,0,0,0,15,255,3,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,16,192,0,0,255,255,3,23, +0,0,0,0,0,248,0,0,0,0,8,128,0,0,0,0,0,0,0,0,0,0,8,0,255,63,0,192,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,240,0,0,128,3,0,0,0,0,0,0,0,128,2,0,0,192,0,0,67,0,0,0,0,0, 0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0, 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,2,0,0,0,0,0,0, @@ -84,46 +85,57 @@ 0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 128,255,0,0,128,255,0,0,0,0,128,255,0,0,0,0,0,0,0,0,0,248,0,0,192,143,0,0,0, 128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,255,255,252,255,255,255,255,255,0,0,0,0, -0,0,0,135,255,0,255,1,0,0,0,224,0,0,0,224,0,0,0,0,0,1,0,0,96,248,127,0,0,0,0, +0,0,0,135,255,1,255,1,0,0,0,224,0,0,0,224,0,0,0,0,0,1,0,0,96,248,127,0,0,0,0, 0,0,0,0,254,0,0,0,255,0,0,0,255,0,0,0,30,0,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,0,0,0,0,0, 0,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,192,63,252,255,63,0,0,128,3,0,0,0,0,0,0,254,3,0,0,0,0,0,0,0, -0,0,0,0,0,0,24,0,15,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,225,63,0,232,254,255,31,0, -0,0,0,0,0,0,96,63,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0, -0,16,0,32,0,0,192,31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68, -248,0,40,0,0,0,0,0,0,0,0,0,0,0,0,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,128,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,128,14,0,0,0,255,31, -0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,252,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,224,127,0,0,0,192,255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,192,63,252,255,63,0,0,128,3,0,0,0,0,0,0,254,3,32,0,0,0,0,0,0,0, +0,0,0,0,0,24,0,15,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,225,63,0,232,254,255,31,0,0, +0,0,0,0,0,96,63,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0, +24,0,32,0,0,192,31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68, +248,0,104,0,0,0,0,0,0,0,0,0,0,0,0,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,128,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,128,14,0,0,0,255, +31,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,8,0,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,7,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,24,128,255,0,0,0,0,0, +0,0,0,0,0,223,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,62,0,0,252,255,31,3,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,0,0,0,0,0,0,0,0,0,128,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,128,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255, +255,3, +128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0,255,255,48,0,0,248, +3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255, +255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,15,0,0,0,0,0,0, +0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,63, +0,255,255,255,255,127,254,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,1,0,0,255,255,255,255,255,255,255,255, +63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,15,0,255,255,255,255,255,255, +255,255,255,255,127,0,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,8,0,0,0,8,0,0,32,0,0,0,32,0,0,128, +0,0,0,128,0,0,0,2,0,0,0,2,0,0,8,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,15,0,248,254,255,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,127,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0, +128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,127,0,0,0,0,0,0,0, +0,0,0,0,0,0,112,7,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,254,255,255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,0,254,255, +255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,255,255,255,255,255, +15,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,127,254,255,254, +255,254,255,255,255,63,0,255,31,255,255,255,255,0,0,0,252,0,0,0,28,0,0,0,252, +255,255,255,31,0,0,0,0,0,0,192,255,255,255,7,0,255,255,255,255,255,15,255,1,3, +0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,63,0,255,31,255,7,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,15,0,255,255,255,255,255,255,255,255,255,255,255,1, +255,15,0,0,255,15,255,255,255,255,255,255,255,0,255,3,255,255,255,255,255,0, +255,255,255,63,0,0,0,0,0,0,0,0,0,0,255,239,255,255,255,255,255,255,255,255, +255,255,255,255,123,252,255,255,255,255,231,199,255,255,255,231,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,63,15,7,7,0,63,0, 0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,7,0,0,0,0,0,0, -0,24,128,255,0,0,0,0,0,0,0,0,0,0,223,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -128,62,0,0,252,255,31,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0,128,255,48,0,0,248,3,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,7,0,0,0,0,0,0,0,0,0,0,0, -0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,15,0,0,0,0,0,0,0,0,0,0,0,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,63,0,255,255,255,255,127,254,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,1,0,0,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,127,0,255,255,3,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0, -0,8,0,0,0,8,0,0,32,0,0,0,32,0,0,128,0,0,0,128,0,0,0,2,0,0,0,2,0,0,8,0,0,0,0,0, -0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0, -248,254,255,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,127,0,0,0,0,0,0,0,0, -0,0,0,0,0,112,7,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,255,255,255,255,255,15,255, -255,255,255,255,255,255,255,255,255,255,255,15,0,255,127,254,255,254,255,254, -255,255,255,63,0,255,31,255,255,255,127,0,0,0,252,0,0,0,12,0,0,0,252,255,255, -255,31,0,0,0,0,0,0,192,255,255,255,7,0,255,255,255,255,255,15,255,1,3,0,63,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,255,31, -255,1,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,255, -255,255,255,255,255,255,255,255,31,0,0,0,0, -0,255,15,255,255,255,255,255,255,255,0,255,3,255,255,255,255,255,0,255,255, -255,63,0,0,0,0,0,0,0,0,0,0,255,15,255,255,255,255,255,127,255,31,255,255,255, -15,0,0,255,255,255,0,0,0,0,0,1,0,255,255,127,0,0,0, diff --git a/libc-top-half/musl/src/ctype/towctrans.c b/libc-top-half/musl/src/ctype/towctrans.c index 8f68101..76d1376 100644 --- a/libc-top-half/musl/src/ctype/towctrans.c +++ b/libc-top-half/musl/src/ctype/towctrans.c @@ -1,307 +1,73 @@ -#include -#include #include -#define CASEMAP(u1,u2,l) { (u1), (l)-(u1), (u2)-(u1)+1 } -#define CASELACE(u1,u2) CASEMAP((u1),(u2),(u1)+1) +static const unsigned char tab[]; -static const struct { - unsigned short upper; - signed char lower; - unsigned char len; -} casemaps[] = { - CASEMAP(0xc0,0xde,0xe0), +static const unsigned char rulebases[512]; +static const int rules[]; - CASELACE(0x0100,0x012e), - CASELACE(0x0132,0x0136), - CASELACE(0x0139,0x0147), - CASELACE(0x014a,0x0176), - CASELACE(0x0179,0x017d), +static const unsigned char exceptions[][2]; - CASELACE(0x370,0x372), - CASEMAP(0x391,0x3a1,0x3b1), - CASEMAP(0x3a3,0x3ab,0x3c3), - CASEMAP(0x400,0x40f,0x450), - CASEMAP(0x410,0x42f,0x430), +#include "casemap.h" - CASELACE(0x460,0x480), - CASELACE(0x48a,0x4be), - CASELACE(0x4c1,0x4cd), - CASELACE(0x4d0,0x50e), - - CASELACE(0x514,0x52e), - CASEMAP(0x531,0x556,0x561), - - CASELACE(0x01a0,0x01a4), - CASELACE(0x01b3,0x01b5), - CASELACE(0x01cd,0x01db), - CASELACE(0x01de,0x01ee), - CASELACE(0x01f8,0x021e), - CASELACE(0x0222,0x0232), - CASELACE(0x03d8,0x03ee), - - CASELACE(0x1e00,0x1e94), - CASELACE(0x1ea0,0x1efe), - - CASEMAP(0x1f08,0x1f0f,0x1f00), - CASEMAP(0x1f18,0x1f1d,0x1f10), - CASEMAP(0x1f28,0x1f2f,0x1f20), - CASEMAP(0x1f38,0x1f3f,0x1f30), - CASEMAP(0x1f48,0x1f4d,0x1f40), - - CASEMAP(0x1f68,0x1f6f,0x1f60), - CASEMAP(0x1f88,0x1f8f,0x1f80), - CASEMAP(0x1f98,0x1f9f,0x1f90), - CASEMAP(0x1fa8,0x1faf,0x1fa0), - CASEMAP(0x1fb8,0x1fb9,0x1fb0), - CASEMAP(0x1fba,0x1fbb,0x1f70), - CASEMAP(0x1fc8,0x1fcb,0x1f72), - CASEMAP(0x1fd8,0x1fd9,0x1fd0), - CASEMAP(0x1fda,0x1fdb,0x1f76), - CASEMAP(0x1fe8,0x1fe9,0x1fe0), - CASEMAP(0x1fea,0x1feb,0x1f7a), - CASEMAP(0x1ff8,0x1ff9,0x1f78), - CASEMAP(0x1ffa,0x1ffb,0x1f7c), - - CASEMAP(0x13f0,0x13f5,0x13f8), - CASELACE(0xa698,0xa69a), - CASELACE(0xa796,0xa79e), - - CASELACE(0x246,0x24e), - CASELACE(0x510,0x512), - CASEMAP(0x2160,0x216f,0x2170), - CASEMAP(0x2c00,0x2c2e,0x2c30), - CASELACE(0x2c67,0x2c6b), - CASELACE(0x2c80,0x2ce2), - CASELACE(0x2ceb,0x2ced), - - CASELACE(0xa640,0xa66c), - CASELACE(0xa680,0xa696), - - CASELACE(0xa722,0xa72e), - CASELACE(0xa732,0xa76e), - CASELACE(0xa779,0xa77b), - CASELACE(0xa77e,0xa786), - - CASELACE(0xa790,0xa792), - CASELACE(0xa7a0,0xa7a8), - - CASELACE(0xa7b4,0xa7b6), - - CASEMAP(0xff21,0xff3a,0xff41), - { 0,0,0 } -}; - -static const unsigned short pairs[][2] = { - { 'I', 0x0131 }, - { 'S', 0x017f }, - { 0x0130, 'i' }, - { 0x0178, 0x00ff }, - { 0x0181, 0x0253 }, - { 0x0182, 0x0183 }, - { 0x0184, 0x0185 }, - { 0x0186, 0x0254 }, - { 0x0187, 0x0188 }, - { 0x0189, 0x0256 }, - { 0x018a, 0x0257 }, - { 0x018b, 0x018c }, - { 0x018e, 0x01dd }, - { 0x018f, 0x0259 }, - { 0x0190, 0x025b }, - { 0x0191, 0x0192 }, - { 0x0193, 0x0260 }, - { 0x0194, 0x0263 }, - { 0x0196, 0x0269 }, - { 0x0197, 0x0268 }, - { 0x0198, 0x0199 }, - { 0x019c, 0x026f }, - { 0x019d, 0x0272 }, - { 0x019f, 0x0275 }, - { 0x01a6, 0x0280 }, - { 0x01a7, 0x01a8 }, - { 0x01a9, 0x0283 }, - { 0x01ac, 0x01ad }, - { 0x01ae, 0x0288 }, - { 0x01af, 0x01b0 }, - { 0x01b1, 0x028a }, - { 0x01b2, 0x028b }, - { 0x01b7, 0x0292 }, - { 0x01b8, 0x01b9 }, - { 0x01bc, 0x01bd }, - { 0x01c4, 0x01c6 }, - { 0x01c4, 0x01c5 }, - { 0x01c5, 0x01c6 }, - { 0x01c7, 0x01c9 }, - { 0x01c7, 0x01c8 }, - { 0x01c8, 0x01c9 }, - { 0x01ca, 0x01cc }, - { 0x01ca, 0x01cb }, - { 0x01cb, 0x01cc }, - { 0x01f1, 0x01f3 }, - { 0x01f1, 0x01f2 }, - { 0x01f2, 0x01f3 }, - { 0x01f4, 0x01f5 }, - { 0x01f6, 0x0195 }, - { 0x01f7, 0x01bf }, - { 0x0220, 0x019e }, - { 0x0386, 0x03ac }, - { 0x0388, 0x03ad }, - { 0x0389, 0x03ae }, - { 0x038a, 0x03af }, - { 0x038c, 0x03cc }, - { 0x038e, 0x03cd }, - { 0x038f, 0x03ce }, - { 0x0399, 0x0345 }, - { 0x0399, 0x1fbe }, - { 0x03a3, 0x03c2 }, - { 0x03f7, 0x03f8 }, - { 0x03fa, 0x03fb }, - { 0x1e60, 0x1e9b }, - { 0x1e9e, 0xdf }, - - { 0x1f59, 0x1f51 }, - { 0x1f5b, 0x1f53 }, - { 0x1f5d, 0x1f55 }, - { 0x1f5f, 0x1f57 }, - { 0x1fbc, 0x1fb3 }, - { 0x1fcc, 0x1fc3 }, - { 0x1fec, 0x1fe5 }, - { 0x1ffc, 0x1ff3 }, - - { 0x23a, 0x2c65 }, - { 0x23b, 0x23c }, - { 0x23d, 0x19a }, - { 0x23e, 0x2c66 }, - { 0x241, 0x242 }, - { 0x243, 0x180 }, - { 0x244, 0x289 }, - { 0x245, 0x28c }, - { 0x3f4, 0x3b8 }, - { 0x3f9, 0x3f2 }, - { 0x3fd, 0x37b }, - { 0x3fe, 0x37c }, - { 0x3ff, 0x37d }, - { 0x4c0, 0x4cf }, - - { 0x2126, 0x3c9 }, - { 0x212a, 'k' }, - { 0x212b, 0xe5 }, - { 0x2132, 0x214e }, - { 0x2183, 0x2184 }, - { 0x2c60, 0x2c61 }, - { 0x2c62, 0x26b }, - { 0x2c63, 0x1d7d }, - { 0x2c64, 0x27d }, - { 0x2c6d, 0x251 }, - { 0x2c6e, 0x271 }, - { 0x2c6f, 0x250 }, - { 0x2c70, 0x252 }, - { 0x2c72, 0x2c73 }, - { 0x2c75, 0x2c76 }, - { 0x2c7e, 0x23f }, - { 0x2c7f, 0x240 }, - { 0x2cf2, 0x2cf3 }, - - { 0xa77d, 0x1d79 }, - { 0xa78b, 0xa78c }, - { 0xa78d, 0x265 }, - { 0xa7aa, 0x266 }, - - { 0x10c7, 0x2d27 }, - { 0x10cd, 0x2d2d }, - - /* bogus greek 'symbol' letters */ - { 0x376, 0x377 }, - { 0x39c, 0xb5 }, - { 0x392, 0x3d0 }, - { 0x398, 0x3d1 }, - { 0x3a6, 0x3d5 }, - { 0x3a0, 0x3d6 }, - { 0x39a, 0x3f0 }, - { 0x3a1, 0x3f1 }, - { 0x395, 0x3f5 }, - { 0x3cf, 0x3d7 }, - - { 0xa7ab, 0x25c }, - { 0xa7ac, 0x261 }, - { 0xa7ad, 0x26c }, - { 0xa7ae, 0x26a }, - { 0xa7b0, 0x29e }, - { 0xa7b1, 0x287 }, - { 0xa7b2, 0x29d }, - { 0xa7b3, 0xab53 }, - - /* special cyrillic lowercase forms */ - { 0x412, 0x1c80 }, - { 0x414, 0x1c81 }, - { 0x41e, 0x1c82 }, - { 0x421, 0x1c83 }, - { 0x422, 0x1c84 }, - { 0x422, 0x1c85 }, - { 0x42a, 0x1c86 }, - { 0x462, 0x1c87 }, - { 0xa64a, 0x1c88 }, - - { 0,0 } -}; - - -static wchar_t __towcase(wchar_t wc, int lower) +static int casemap(unsigned c, int dir) { - int i; - int lmul = 2*lower-1; - int lmask = lower-1; - /* no letters with case in these large ranges */ - if (!iswalpha(wc) - || (unsigned)wc - 0x0600 <= 0x0fff-0x0600 - || (unsigned)wc - 0x2e00 <= 0xa63f-0x2e00 - || (unsigned)wc - 0xa800 <= 0xab52-0xa800 - || (unsigned)wc - 0xabc0 <= 0xfeff-0xabc0) - return wc; - /* special case because the diff between upper/lower is too big */ - if (lower && (unsigned)wc - 0x10a0 < 0x2e) - if (wc>0x10c5 && wc != 0x10c7 && wc != 0x10cd) return wc; - else return wc + 0x2d00 - 0x10a0; - if (!lower && (unsigned)wc - 0x2d00 < 0x26) - if (wc>0x2d25 && wc != 0x2d27 && wc != 0x2d2d) return wc; - else return wc + 0x10a0 - 0x2d00; - if (lower && (unsigned)wc - 0x13a0 < 0x50) - return wc + 0xab70 - 0x13a0; - if (!lower && (unsigned)wc - 0xab70 < 0x50) - return wc + 0x13a0 - 0xab70; - for (i=0; casemaps[i].len; i++) { - int base = casemaps[i].upper + (lmask & casemaps[i].lower); - if ((unsigned)wc-base < casemaps[i].len) { - if (casemaps[i].lower == 1) - return wc + lower - ((wc-casemaps[i].upper)&1); - return wc + lmul*casemaps[i].lower; + unsigned b, x, y, v, rt, xb, xn; + int r, rd, c0 = c; + + if (c >= 0x20000) return c; + + b = c>>8; + c &= 255; + x = c/3; + y = c%3; + + /* lookup entry in two-level base-6 table */ + v = tab[tab[b]*86+x]; + static const int mt[] = { 2048, 342, 57 }; + v = (v*mt[y]>>11)%6; + + /* use the bit vector out of the tables as an index into + * a block-specific set of rules and decode the rule into + * a type and a case-mapping delta. */ + r = rules[rulebases[b]+v]; + rt = r & 255; + rd = r >> 8; + + /* rules 0/1 are simple lower/upper case with a delta. + * apply according to desired mapping direction. */ + if (rt < 2) return c0 + (rd & -(rt^dir)); + + /* binary search. endpoints of the binary search for + * this block are stored in the rule delta field. */ + xn = rd & 0xff; + xb = (unsigned)rd >> 8; + while (xn) { + unsigned try = exceptions[xb+xn/2][0]; + if (try == c) { + r = rules[exceptions[xb+xn/2][1]]; + rt = r & 255; + rd = r >> 8; + if (rt < 2) return c0 + (rd & -(rt^dir)); + /* Hard-coded for the four exceptional titlecase */ + return c0 + (dir ? -1 : 1); + } else if (try > c) { + xn /= 2; + } else { + xb += xn/2; + xn -= xn/2; } } - for (i=0; pairs[i][1-lower]; i++) { - if (pairs[i][1-lower] == wc) - return pairs[i][lower]; - } - if ((unsigned)wc - (0x10428 - 0x28*lower) < 0x28) - return wc - 0x28 + 0x50*lower; - if ((unsigned)wc - (0x104d8 - 0x28*lower) < 0x24) - return wc - 0x28 + 0x50*lower; - if ((unsigned)wc - (0x10cc0 - 0x40*lower) < 0x33) - return wc - 0x40 + 0x80*lower; - if ((unsigned)wc - (0x118c0 - 0x20*lower) < 0x20) - return wc - 0x20 + 0x40*lower; - if ((unsigned)wc - (0x1e922 - 0x22*lower) < 0x22) - return wc - 0x22 + 0x44*lower; - return wc; + return c0; } -wint_t towupper(wint_t wc) +wint_t towlower(wint_t wc) { - return (unsigned)wc < 128 ? toupper(wc) : __towcase(wc, 0); + return casemap(wc, 0); } -wint_t towlower(wint_t wc) +wint_t towupper(wint_t wc) { - return (unsigned)wc < 128 ? tolower(wc) : __towcase(wc, 1); + return casemap(wc, 1); } wint_t __towupper_l(wint_t c, locale_t l) diff --git a/libc-top-half/musl/src/ctype/wcwidth.c b/libc-top-half/musl/src/ctype/wcwidth.c index 49c40ee..36256a5 100644 --- a/libc-top-half/musl/src/ctype/wcwidth.c +++ b/libc-top-half/musl/src/ctype/wcwidth.c @@ -23,7 +23,7 @@ int wcwidth(wchar_t wc) return -1; if (wc-0x20000U < 0x20000) return 2; - if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100 < 0xef) + if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100U < 0xef) return 0; return 1; } diff --git a/libc-top-half/musl/src/ctype/wide.h b/libc-top-half/musl/src/ctype/wide.h index e4672b2..e403c9a 100644 --- a/libc-top-half/musl/src/ctype/wide.h +++ b/libc-top-half/musl/src/ctype/wide.h @@ -17,7 +17,7 @@ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,38,39,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,40,41,42,43,44,45,46,16,16,47,16,16,16,16,16, +16,16,16,16,16,16,16,40,41,42,43,44,45,46,47,16,48,49,16,16,16,16, 16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, @@ -31,10 +31,10 @@ 255,255,255,15,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,255,15,255,255,255,255, 255,255,255,127,254,255,255,255,255,255,255,255,255,255,127,254,255,255,255, -255,255,255,255,255,255,255,255,255,224,255,255,255,255,127,254,255,255,255, +255,255,255,255,255,255,255,255,255,224,255,255,255,255,255,254,255,255,255, 255,255,255,255,255,255,255,127,255,255,255,255,255,7,255,255,255,255,15,0, 255,255,255,255,255,127,255,255,255,255,255,0,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,127,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0, 0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,31,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255, @@ -43,13 +43,13 @@ 255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,255,3,0,0,255,255,255,255,247,255,127,15,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,255,255,255,255,255,255,255,255,255,255, 255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0, -0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,7,0,255,255,255,127,0,0,0,0,0,0,0, -0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,7,0,255,255,255,127,0,0,0,0,0, +0,7,0,240,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255, 15,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,64,254,7,0,0,0,0,0,0,0,0,0,0,0,0,7,0,255,255,255, 255,255,15,255,1,3,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255, @@ -58,6 +58,8 @@ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 159,255,255,255,255,255,255,255,63,0,120,255,255,255,0,0,4,0,0,96,0,16,0,0,0, 0,0,0,0,0,0,0,248,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,255,255, -255,255,255,255,255,255,63,16,7,0,0,24,240,1,0,0,255,255,255,255,255,127,255, -31,255,255,255,15,0,0,255,255,255,0,0,0,0,0,1,0,255,255,127,0,0, -0, +255,255,255,255,255,255,63,16,39,0,0,24,240,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,255,15,0, +0,0,224,255,255,255,255,255,255,255,255,255,255,255,255,123,252,255,255,255, +255,231,199,255,255,255,231,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,15,7,7,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0, diff --git a/libc-top-half/musl/src/fenv/riscv64/fenv.S b/libc-top-half/musl/src/fenv/riscv64/fenv.S index f149003..0ea78bf 100644 --- a/libc-top-half/musl/src/fenv/riscv64/fenv.S +++ b/libc-top-half/musl/src/fenv/riscv64/fenv.S @@ -45,8 +45,11 @@ fegetenv: .global fesetenv .type fesetenv, %function fesetenv: + li t2, -1 + li t1, 0 + beq a0, t2, 1f lw t1, 0(a0) - fscsr t0, t1 +1: fscsr t1 li a0, 0 ret diff --git a/libc-top-half/musl/src/internal/dynlink.h b/libc-top-half/musl/src/internal/dynlink.h index ffd06b0..764e3a1 100644 --- a/libc-top-half/musl/src/internal/dynlink.h +++ b/libc-top-half/musl/src/internal/dynlink.h @@ -96,7 +96,6 @@ struct fdpic_dummy_loadmap { #define DYN_CNT 32 typedef void (*stage2_func)(unsigned char *, size_t *); -typedef void (*stage3_func)(size_t *); hidden void *__dlsym(void *restrict, const char *restrict, void *restrict); diff --git a/libc-top-half/musl/src/internal/floatscan.c b/libc-top-half/musl/src/internal/floatscan.c index 0fbea30..ec50fe0 100644 --- a/libc-top-half/musl/src/internal/floatscan.c +++ b/libc-top-half/musl/src/internal/floatscan.c @@ -37,9 +37,6 @@ #define MASK (KMAX-1) -#define CONCAT2(x,y) x ## y -#define CONCAT(x,y) CONCAT2(x,y) - static long long scanexp(FILE *f, int pok) { int c; @@ -332,7 +329,7 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po y -= bias; if ((e2+LDBL_MANT_DIG & INT_MAX) > emax-5) { - if (fabsl(y) >= CONCAT(0x1p, LDBL_MANT_DIG)) { + if (fabsl(y) >= 2/LDBL_EPSILON) { if (denormal && bits==LDBL_MANT_DIG+e2-emin) denormal = 0; y *= 0.5; diff --git a/libc-top-half/musl/src/internal/syscall.h b/libc-top-half/musl/src/internal/syscall.h index 9f2784d..975a003 100644 --- a/libc-top-half/musl/src/internal/syscall.h +++ b/libc-top-half/musl/src/internal/syscall.h @@ -193,6 +193,45 @@ hidden long __syscall_ret(unsigned long), #define SYS_sendfile SYS_sendfile64 #endif +#ifndef SYS_timer_settime +#define SYS_timer_settime SYS_timer_settime32 +#endif + +#ifndef SYS_timer_gettime +#define SYS_timer_gettime SYS_timer_gettime32 +#endif + +#ifndef SYS_timerfd_settime +#define SYS_timerfd_settime SYS_timerfd_settime32 +#endif + +#ifndef SYS_timerfd_gettime +#define SYS_timerfd_gettime SYS_timerfd_gettime32 +#endif + +#ifndef SYS_clock_settime +#define SYS_clock_settime SYS_clock_settime32 +#endif + +#ifndef SYS_clock_gettime +#define SYS_clock_gettime SYS_clock_gettime32 +#endif + +#ifndef SYS_clock_getres +#define SYS_clock_getres SYS_clock_getres_time32 +#endif + +#ifndef SYS_clock_nanosleep +#define SYS_clock_nanosleep SYS_clock_nanosleep_time32 +#endif + +#ifndef SYS_gettimeofday +#define SYS_gettimeofday SYS_gettimeofday_time32 +#endif + +#ifndef SYS_settimeofday +#define SYS_settimeofday SYS_settimeofday_time32 +#endif /* Ensure that the plain syscall names are defined even for "time64-only" * archs. These facilitate callers passing null time arguments, and make @@ -306,6 +345,13 @@ hidden long __syscall_ret(unsigned long), #define SO_SNDTIMEO_OLD 21 #endif +#define SO_TIMESTAMP_OLD 29 +#define SO_TIMESTAMPNS_OLD 35 +#define SO_TIMESTAMPING_OLD 37 +#define SCM_TIMESTAMP_OLD SO_TIMESTAMP_OLD +#define SCM_TIMESTAMPNS_OLD SO_TIMESTAMPNS_OLD +#define SCM_TIMESTAMPING_OLD SO_TIMESTAMPING_OLD + #ifndef SIOCGSTAMP_OLD #define SIOCGSTAMP_OLD 0x8906 #endif diff --git a/libc-top-half/musl/src/ldso/__dlsym.c b/libc-top-half/musl/src/ldso/__dlsym.c index 8ac0a33..0384f97 100644 --- a/libc-top-half/musl/src/ldso/__dlsym.c +++ b/libc-top-half/musl/src/ldso/__dlsym.c @@ -8,3 +8,7 @@ static void *stub_dlsym(void *restrict p, const char *restrict s, void *restrict } weak_alias(stub_dlsym, __dlsym); + +#if _REDIR_TIME64 +weak_alias(stub_dlsym, __dlsym_redir_time64); +#endif diff --git a/libc-top-half/musl/src/ldso/arm/dlsym_time64.S b/libc-top-half/musl/src/ldso/arm/dlsym_time64.S new file mode 100644 index 0000000..bb2e704 --- /dev/null +++ b/libc-top-half/musl/src/ldso/arm/dlsym_time64.S @@ -0,0 +1,3 @@ +#define __dlsym __dlsym_redir_time64 +#define dlsym __dlsym_time64 +#include "dlsym.s" diff --git a/libc-top-half/musl/src/ldso/i386/dlsym_time64.S b/libc-top-half/musl/src/ldso/i386/dlsym_time64.S new file mode 100644 index 0000000..bb2e704 --- /dev/null +++ b/libc-top-half/musl/src/ldso/i386/dlsym_time64.S @@ -0,0 +1,3 @@ +#define __dlsym __dlsym_redir_time64 +#define dlsym __dlsym_time64 +#include "dlsym.s" diff --git a/libc-top-half/musl/src/ldso/m68k/dlsym_time64.S b/libc-top-half/musl/src/ldso/m68k/dlsym_time64.S new file mode 100644 index 0000000..bb2e704 --- /dev/null +++ b/libc-top-half/musl/src/ldso/m68k/dlsym_time64.S @@ -0,0 +1,3 @@ +#define __dlsym __dlsym_redir_time64 +#define dlsym __dlsym_time64 +#include "dlsym.s" diff --git a/libc-top-half/musl/src/ldso/microblaze/dlsym_time64.S b/libc-top-half/musl/src/ldso/microblaze/dlsym_time64.S new file mode 100644 index 0000000..bb2e704 --- /dev/null +++ b/libc-top-half/musl/src/ldso/microblaze/dlsym_time64.S @@ -0,0 +1,3 @@ +#define __dlsym __dlsym_redir_time64 +#define dlsym __dlsym_time64 +#include "dlsym.s" diff --git a/libc-top-half/musl/src/ldso/mips/dlsym_time64.S b/libc-top-half/musl/src/ldso/mips/dlsym_time64.S new file mode 100644 index 0000000..bb2e704 --- /dev/null +++ b/libc-top-half/musl/src/ldso/mips/dlsym_time64.S @@ -0,0 +1,3 @@ +#define __dlsym __dlsym_redir_time64 +#define dlsym __dlsym_time64 +#include "dlsym.s" diff --git a/libc-top-half/musl/src/ldso/mipsn32/dlsym_time64.S b/libc-top-half/musl/src/ldso/mipsn32/dlsym_time64.S new file mode 100644 index 0000000..bb2e704 --- /dev/null +++ b/libc-top-half/musl/src/ldso/mipsn32/dlsym_time64.S @@ -0,0 +1,3 @@ +#define __dlsym __dlsym_redir_time64 +#define dlsym __dlsym_time64 +#include "dlsym.s" diff --git a/libc-top-half/musl/src/ldso/or1k/dlsym_time64.S b/libc-top-half/musl/src/ldso/or1k/dlsym_time64.S new file mode 100644 index 0000000..bb2e704 --- /dev/null +++ b/libc-top-half/musl/src/ldso/or1k/dlsym_time64.S @@ -0,0 +1,3 @@ +#define __dlsym __dlsym_redir_time64 +#define dlsym __dlsym_time64 +#include "dlsym.s" diff --git a/libc-top-half/musl/src/ldso/powerpc/dlsym_time64.S b/libc-top-half/musl/src/ldso/powerpc/dlsym_time64.S new file mode 100644 index 0000000..bb2e704 --- /dev/null +++ b/libc-top-half/musl/src/ldso/powerpc/dlsym_time64.S @@ -0,0 +1,3 @@ +#define __dlsym __dlsym_redir_time64 +#define dlsym __dlsym_time64 +#include "dlsym.s" diff --git a/libc-top-half/musl/src/ldso/sh/dlsym_time64.S b/libc-top-half/musl/src/ldso/sh/dlsym_time64.S new file mode 100644 index 0000000..bb2e704 --- /dev/null +++ b/libc-top-half/musl/src/ldso/sh/dlsym_time64.S @@ -0,0 +1,3 @@ +#define __dlsym __dlsym_redir_time64 +#define dlsym __dlsym_time64 +#include "dlsym.s" diff --git a/libc-top-half/musl/src/linux/clock_adjtime.c b/libc-top-half/musl/src/linux/clock_adjtime.c index 2f53139..23eb872 100644 --- a/libc-top-half/musl/src/linux/clock_adjtime.c +++ b/libc-top-half/musl/src/linux/clock_adjtime.c @@ -94,21 +94,56 @@ int clock_adjtime (clockid_t clock_id, struct timex *utx) return __syscall_ret(-ENOTSUP); #endif if (sizeof(time_t) > sizeof(long)) { - union { - struct timex utx; - struct ktimex ktx; - } u = { *utx }; - u.ktx.time_sec = utx->time.tv_sec; - u.ktx.time_usec = utx->time.tv_usec; + struct ktimex ktx = { + .modes = utx->modes, + .offset = utx->offset, + .freq = utx->freq, + .maxerror = utx->maxerror, + .esterror = utx->esterror, + .status = utx->status, + .constant = utx->constant, + .precision = utx->precision, + .tolerance = utx->tolerance, + .time_sec = utx->time.tv_sec, + .time_usec = utx->time.tv_usec, + .tick = utx->tick, + .ppsfreq = utx->ppsfreq, + .jitter = utx->jitter, + .shift = utx->shift, + .stabil = utx->stabil, + .jitcnt = utx->jitcnt, + .calcnt = utx->calcnt, + .errcnt = utx->errcnt, + .stbcnt = utx->stbcnt, + .tai = utx->tai, + }; #ifdef SYS_adjtimex - if (clock_id==CLOCK_REALTIME) r = __syscall(SYS_adjtimex, &u); + if (clock_id==CLOCK_REALTIME) r = __syscall(SYS_adjtimex, &ktx); else #endif - r = __syscall(SYS_clock_adjtime, clock_id, &u); + r = __syscall(SYS_clock_adjtime, clock_id, &ktx); if (r>=0) { - *utx = u.utx; - utx->time.tv_sec = u.ktx.time_sec; - utx->time.tv_usec = u.ktx.time_usec; + utx->modes = ktx.modes; + utx->offset = ktx.offset; + utx->freq = ktx.freq; + utx->maxerror = ktx.maxerror; + utx->esterror = ktx.esterror; + utx->status = ktx.status; + utx->constant = ktx.constant; + utx->precision = ktx.precision; + utx->tolerance = ktx.tolerance; + utx->time.tv_sec = ktx.time_sec; + utx->time.tv_usec = ktx.time_usec; + utx->tick = ktx.tick; + utx->ppsfreq = ktx.ppsfreq; + utx->jitter = ktx.jitter; + utx->shift = ktx.shift; + utx->stabil = ktx.stabil; + utx->jitcnt = ktx.jitcnt; + utx->calcnt = ktx.calcnt; + utx->errcnt = ktx.errcnt; + utx->stbcnt = ktx.stbcnt; + utx->tai = ktx.tai; } return __syscall_ret(r); } diff --git a/libc-top-half/musl/src/linux/wait4.c b/libc-top-half/musl/src/linux/wait4.c index 97f12cc..83650e3 100644 --- a/libc-top-half/musl/src/linux/wait4.c +++ b/libc-top-half/musl/src/linux/wait4.c @@ -1,9 +1,39 @@ #define _GNU_SOURCE #include #include +#include +#include #include "syscall.h" -pid_t wait4(pid_t pid, int *status, int options, struct rusage *usage) +pid_t wait4(pid_t pid, int *status, int options, struct rusage *ru) { - return syscall(SYS_wait4, pid, status, options, usage); + int r; +#ifdef SYS_wait4_time64 + if (ru) { + long long kru64[18]; + r = __syscall(SYS_wait4_time64, pid, status, options, kru64); + if (!r) { + ru->ru_utime = (struct timeval) + { .tv_sec = kru64[0], .tv_usec = kru64[1] }; + ru->ru_stime = (struct timeval) + { .tv_sec = kru64[2], .tv_usec = kru64[3] }; + char *slots = (char *)&ru->ru_maxrss; + for (int i=0; i<14; i++) + *(long *)(slots + i*sizeof(long)) = kru64[4+i]; + } + if (SYS_wait4_time64 == SYS_wait4 || r != -ENOSYS) + return __syscall_ret(r); + } +#endif + char *dest = ru ? (char *)&ru->ru_maxrss - 4*sizeof(long) : 0; + r = __syscall(SYS_wait4, pid, status, options, dest); + if (r>0 && ru && sizeof(time_t) > sizeof(long)) { + long kru[4]; + memcpy(kru, dest, 4*sizeof(long)); + ru->ru_utime = (struct timeval) + { .tv_sec = kru[0], .tv_usec = kru[1] }; + ru->ru_stime = (struct timeval) + { .tv_sec = kru[2], .tv_usec = kru[3] }; + } + return __syscall_ret(r); } diff --git a/libc-top-half/musl/src/math/i386/acos.s b/libc-top-half/musl/src/math/i386/acos.s index 47f365e..af423a2 100644 --- a/libc-top-half/musl/src/math/i386/acos.s +++ b/libc-top-half/musl/src/math/i386/acos.s @@ -1,22 +1,10 @@ # use acos(x) = atan2(fabs(sqrt((1-x)*(1+x))), x) -.global acosf -.type acosf,@function -acosf: - flds 4(%esp) - jmp 1f - -.global acosl -.type acosl,@function -acosl: - fldt 4(%esp) - jmp 1f - .global acos .type acos,@function acos: fldl 4(%esp) -1: fld %st(0) + fld %st(0) fld1 fsub %st(0),%st(1) fadd %st(2) @@ -25,4 +13,6 @@ acos: fabs # fix sign of zero (matters in downward rounding mode) fxch %st(1) fpatan + fstpl 4(%esp) + fldl 4(%esp) ret diff --git a/libc-top-half/musl/src/math/i386/acosf.s b/libc-top-half/musl/src/math/i386/acosf.s index 6c95509..d2cdfdb 100644 --- a/libc-top-half/musl/src/math/i386/acosf.s +++ b/libc-top-half/musl/src/math/i386/acosf.s @@ -1 +1,16 @@ -# see acos.s +.global acosf +.type acosf,@function +acosf: + flds 4(%esp) + fld %st(0) + fld1 + fsub %st(0),%st(1) + fadd %st(2) + fmulp + fsqrt + fabs # fix sign of zero (matters in downward rounding mode) + fxch %st(1) + fpatan + fstps 4(%esp) + flds 4(%esp) + ret diff --git a/libc-top-half/musl/src/math/i386/acosl.s b/libc-top-half/musl/src/math/i386/acosl.s index 6c95509..599c823 100644 --- a/libc-top-half/musl/src/math/i386/acosl.s +++ b/libc-top-half/musl/src/math/i386/acosl.s @@ -1 +1,14 @@ -# see acos.s +.global acosl +.type acosl,@function +acosl: + fldt 4(%esp) + fld %st(0) + fld1 + fsub %st(0),%st(1) + fadd %st(2) + fmulp + fsqrt + fabs # fix sign of zero (matters in downward rounding mode) + fxch %st(1) + fpatan + ret diff --git a/libc-top-half/musl/src/math/i386/asin.s b/libc-top-half/musl/src/math/i386/asin.s index 920d967..2bc8356 100644 --- a/libc-top-half/musl/src/math/i386/asin.s +++ b/libc-top-half/musl/src/math/i386/asin.s @@ -1,23 +1,3 @@ -.global asinf -.type asinf,@function -asinf: - flds 4(%esp) - mov 4(%esp),%eax - add %eax,%eax - cmp $0x01000000,%eax - jae 1f - # subnormal x, return x with underflow - fld %st(0) - fmul %st(1) - fstps 4(%esp) - ret - -.global asinl -.type asinl,@function -asinl: - fldt 4(%esp) - jmp 1f - .global asin .type asin,@function asin: @@ -25,15 +5,17 @@ asin: mov 8(%esp),%eax add %eax,%eax cmp $0x00200000,%eax - jae 1f - # subnormal x, return x with underflow - fsts 4(%esp) - ret -1: fld %st(0) + jb 1f + fld %st(0) fld1 fsub %st(0),%st(1) fadd %st(2) fmulp fsqrt fpatan + fstpl 4(%esp) + fldl 4(%esp) + ret + # subnormal x, return x with underflow +1: fsts 4(%esp) ret diff --git a/libc-top-half/musl/src/math/i386/asinf.s b/libc-top-half/musl/src/math/i386/asinf.s index e07bf59..0590975 100644 --- a/libc-top-half/musl/src/math/i386/asinf.s +++ b/libc-top-half/musl/src/math/i386/asinf.s @@ -1 +1,23 @@ -# see asin.s +.global asinf +.type asinf,@function +asinf: + flds 4(%esp) + mov 4(%esp),%eax + add %eax,%eax + cmp $0x01000000,%eax + jb 1f + fld %st(0) + fld1 + fsub %st(0),%st(1) + fadd %st(2) + fmulp + fsqrt + fpatan + fstps 4(%esp) + flds 4(%esp) + ret + # subnormal x, return x with underflow +1: fld %st(0) + fmul %st(1) + fstps 4(%esp) + ret diff --git a/libc-top-half/musl/src/math/i386/asinl.s b/libc-top-half/musl/src/math/i386/asinl.s index e07bf59..e973fc8 100644 --- a/libc-top-half/musl/src/math/i386/asinl.s +++ b/libc-top-half/musl/src/math/i386/asinl.s @@ -1 +1,12 @@ -# see asin.s +.global asinl +.type asinl,@function +asinl: + fldt 4(%esp) + fld %st(0) + fld1 + fsub %st(0),%st(1) + fadd %st(2) + fmulp + fsqrt + fpatan + ret diff --git a/libc-top-half/musl/src/math/i386/atan.s b/libc-top-half/musl/src/math/i386/atan.s index a26feae..2c57f6b 100644 --- a/libc-top-half/musl/src/math/i386/atan.s +++ b/libc-top-half/musl/src/math/i386/atan.s @@ -8,6 +8,8 @@ atan: jb 1f fld1 fpatan + fstpl 4(%esp) + fldl 4(%esp) ret # subnormal x, return x with underflow 1: fsts 4(%esp) diff --git a/libc-top-half/musl/src/math/i386/atan2.s b/libc-top-half/musl/src/math/i386/atan2.s index 76b95f3..8bc441b 100644 --- a/libc-top-half/musl/src/math/i386/atan2.s +++ b/libc-top-half/musl/src/math/i386/atan2.s @@ -4,7 +4,8 @@ atan2: fldl 4(%esp) fldl 12(%esp) fpatan - fstl 4(%esp) + fstpl 4(%esp) + fldl 4(%esp) mov 8(%esp),%eax add %eax,%eax cmp $0x00200000,%eax diff --git a/libc-top-half/musl/src/math/i386/atan2f.s b/libc-top-half/musl/src/math/i386/atan2f.s index c9408a9..3908c86 100644 --- a/libc-top-half/musl/src/math/i386/atan2f.s +++ b/libc-top-half/musl/src/math/i386/atan2f.s @@ -4,7 +4,8 @@ atan2f: flds 4(%esp) flds 8(%esp) fpatan - fsts 4(%esp) + fstps 4(%esp) + flds 4(%esp) mov 4(%esp),%eax add %eax,%eax cmp $0x01000000,%eax diff --git a/libc-top-half/musl/src/math/i386/atanf.s b/libc-top-half/musl/src/math/i386/atanf.s index 893beac..c2cbe2e 100644 --- a/libc-top-half/musl/src/math/i386/atanf.s +++ b/libc-top-half/musl/src/math/i386/atanf.s @@ -8,6 +8,8 @@ atanf: jb 1f fld1 fpatan + fstps 4(%esp) + flds 4(%esp) ret # subnormal x, return x with underflow 1: fld %st(0) diff --git a/libc-top-half/musl/src/math/i386/exp2.s b/libc-top-half/musl/src/math/i386/exp2.s deleted file mode 100644 index f335a3e..0000000 --- a/libc-top-half/musl/src/math/i386/exp2.s +++ /dev/null @@ -1 +0,0 @@ -# see exp.s diff --git a/libc-top-half/musl/src/math/i386/exp2f.s b/libc-top-half/musl/src/math/i386/exp2f.s deleted file mode 100644 index f335a3e..0000000 --- a/libc-top-half/musl/src/math/i386/exp2f.s +++ /dev/null @@ -1 +0,0 @@ -# see exp.s diff --git a/libc-top-half/musl/src/math/i386/exp2l.s b/libc-top-half/musl/src/math/i386/exp2l.s index f335a3e..8125761 100644 --- a/libc-top-half/musl/src/math/i386/exp2l.s +++ b/libc-top-half/musl/src/math/i386/exp2l.s @@ -1 +1 @@ -# see exp.s +# see exp_ld.s diff --git a/libc-top-half/musl/src/math/i386/exp.s b/libc-top-half/musl/src/math/i386/exp_ld.s similarity index 67% rename from libc-top-half/musl/src/math/i386/exp.s rename to libc-top-half/musl/src/math/i386/exp_ld.s index df87c49..99cba01 100644 --- a/libc-top-half/musl/src/math/i386/exp.s +++ b/libc-top-half/musl/src/math/i386/exp_ld.s @@ -1,35 +1,8 @@ -.global expm1f -.type expm1f,@function -expm1f: - flds 4(%esp) - mov 4(%esp),%eax - add %eax,%eax - cmp $0x01000000,%eax - jae 1f - # subnormal x, return x with underflow - fld %st(0) - fmul %st(1) - fstps 4(%esp) - ret - .global expm1l .type expm1l,@function expm1l: fldt 4(%esp) - jmp 1f - -.global expm1 -.type expm1,@function -expm1: - fldl 4(%esp) - mov 8(%esp),%eax - add %eax,%eax - cmp $0x00200000,%eax - jae 1f - # subnormal x, return x with underflow - fsts 4(%esp) - ret -1: fldl2e + fldl2e fmulp mov $0xc2820000,%eax push %eax @@ -59,12 +32,6 @@ expm1: fsubrp ret -.global exp2f -.type exp2f,@function -exp2f: - flds 4(%esp) - jmp 1f - .global exp2l .global __exp2l .hidden __exp2l @@ -72,26 +39,6 @@ exp2f: exp2l: __exp2l: fldt 4(%esp) - jmp 1f - -.global expf -.type expf,@function -expf: - flds 4(%esp) - jmp 2f - -.global exp -.type exp,@function -exp: - fldl 4(%esp) -2: fldl2e - fmulp - jmp 1f - -.global exp2 -.type exp2,@function -exp2: - fldl 4(%esp) 1: sub $12,%esp fld %st(0) fstpt (%esp) diff --git a/libc-top-half/musl/src/math/i386/expf.s b/libc-top-half/musl/src/math/i386/expf.s deleted file mode 100644 index f335a3e..0000000 --- a/libc-top-half/musl/src/math/i386/expf.s +++ /dev/null @@ -1 +0,0 @@ -# see exp.s diff --git a/libc-top-half/musl/src/math/i386/expm1.s b/libc-top-half/musl/src/math/i386/expm1.s deleted file mode 100644 index f335a3e..0000000 --- a/libc-top-half/musl/src/math/i386/expm1.s +++ /dev/null @@ -1 +0,0 @@ -# see exp.s diff --git a/libc-top-half/musl/src/math/i386/expm1f.s b/libc-top-half/musl/src/math/i386/expm1f.s deleted file mode 100644 index f335a3e..0000000 --- a/libc-top-half/musl/src/math/i386/expm1f.s +++ /dev/null @@ -1 +0,0 @@ -# see exp.s diff --git a/libc-top-half/musl/src/math/i386/expm1l.s b/libc-top-half/musl/src/math/i386/expm1l.s index f335a3e..8125761 100644 --- a/libc-top-half/musl/src/math/i386/expm1l.s +++ b/libc-top-half/musl/src/math/i386/expm1l.s @@ -1 +1 @@ -# see exp.s +# see exp_ld.s diff --git a/libc-top-half/musl/src/math/i386/log.s b/libc-top-half/musl/src/math/i386/log.s index fcccf03..08c5992 100644 --- a/libc-top-half/musl/src/math/i386/log.s +++ b/libc-top-half/musl/src/math/i386/log.s @@ -4,4 +4,6 @@ log: fldln2 fldl 4(%esp) fyl2x + fstpl 4(%esp) + fldl 4(%esp) ret diff --git a/libc-top-half/musl/src/math/i386/log10.s b/libc-top-half/musl/src/math/i386/log10.s index 28eb5b2..120e91e 100644 --- a/libc-top-half/musl/src/math/i386/log10.s +++ b/libc-top-half/musl/src/math/i386/log10.s @@ -4,4 +4,6 @@ log10: fldlg2 fldl 4(%esp) fyl2x + fstpl 4(%esp) + fldl 4(%esp) ret diff --git a/libc-top-half/musl/src/math/i386/log10f.s b/libc-top-half/musl/src/math/i386/log10f.s index c0c0c67..b055493 100644 --- a/libc-top-half/musl/src/math/i386/log10f.s +++ b/libc-top-half/musl/src/math/i386/log10f.s @@ -4,4 +4,6 @@ log10f: fldlg2 flds 4(%esp) fyl2x + fstps 4(%esp) + flds 4(%esp) ret diff --git a/libc-top-half/musl/src/math/i386/log1p.s b/libc-top-half/musl/src/math/i386/log1p.s index 354f391..f3c95f8 100644 --- a/libc-top-half/musl/src/math/i386/log1p.s +++ b/libc-top-half/musl/src/math/i386/log1p.s @@ -10,10 +10,14 @@ log1p: cmp $0x00100000,%eax jb 2f fyl2xp1 + fstpl 4(%esp) + fldl 4(%esp) ret 1: fld1 faddp fyl2x + fstpl 4(%esp) + fldl 4(%esp) ret # subnormal x, return x with underflow 2: fsts 4(%esp) diff --git a/libc-top-half/musl/src/math/i386/log1pf.s b/libc-top-half/musl/src/math/i386/log1pf.s index 4d3484c..9f13d95 100644 --- a/libc-top-half/musl/src/math/i386/log1pf.s +++ b/libc-top-half/musl/src/math/i386/log1pf.s @@ -10,10 +10,14 @@ log1pf: cmp $0x00800000,%eax jb 2f fyl2xp1 + fstps 4(%esp) + flds 4(%esp) ret 1: fld1 faddp fyl2x + fstps 4(%esp) + flds 4(%esp) ret # subnormal x, return x with underflow 2: fxch diff --git a/libc-top-half/musl/src/math/i386/log2.s b/libc-top-half/musl/src/math/i386/log2.s index 1508803..7eff0b6 100644 --- a/libc-top-half/musl/src/math/i386/log2.s +++ b/libc-top-half/musl/src/math/i386/log2.s @@ -4,4 +4,6 @@ log2: fld1 fldl 4(%esp) fyl2x + fstpl 4(%esp) + fldl 4(%esp) ret diff --git a/libc-top-half/musl/src/math/i386/log2f.s b/libc-top-half/musl/src/math/i386/log2f.s index 00cdce7..b32fa2f 100644 --- a/libc-top-half/musl/src/math/i386/log2f.s +++ b/libc-top-half/musl/src/math/i386/log2f.s @@ -4,4 +4,6 @@ log2f: fld1 flds 4(%esp) fyl2x + fstps 4(%esp) + flds 4(%esp) ret diff --git a/libc-top-half/musl/src/math/i386/logf.s b/libc-top-half/musl/src/math/i386/logf.s index da7ff3a..4d0346a 100644 --- a/libc-top-half/musl/src/math/i386/logf.s +++ b/libc-top-half/musl/src/math/i386/logf.s @@ -4,4 +4,6 @@ logf: fldln2 flds 4(%esp) fyl2x + fstps 4(%esp) + flds 4(%esp) ret diff --git a/libc-top-half/musl/src/math/mips/fabs.c b/libc-top-half/musl/src/math/mips/fabs.c new file mode 100644 index 0000000..0a5aa3b --- /dev/null +++ b/libc-top-half/musl/src/math/mips/fabs.c @@ -0,0 +1,16 @@ +#if !defined(__mips_soft_float) && defined(__mips_abs2008) + +#include + +double fabs(double x) +{ + double r; + __asm__("abs.d %0,%1" : "=f"(r) : "f"(x)); + return r; +} + +#else + +#include "../fabs.c" + +#endif diff --git a/libc-top-half/musl/src/math/mips/fabsf.c b/libc-top-half/musl/src/math/mips/fabsf.c new file mode 100644 index 0000000..35307be --- /dev/null +++ b/libc-top-half/musl/src/math/mips/fabsf.c @@ -0,0 +1,16 @@ +#if !defined(__mips_soft_float) && defined(__mips_abs2008) + +#include + +float fabsf(float x) +{ + float r; + __asm__("abs.s %0,%1" : "=f"(r) : "f"(x)); + return r; +} + +#else + +#include "../fabsf.c" + +#endif diff --git a/libc-top-half/musl/src/math/mips/sqrt.c b/libc-top-half/musl/src/math/mips/sqrt.c new file mode 100644 index 0000000..595c9db --- /dev/null +++ b/libc-top-half/musl/src/math/mips/sqrt.c @@ -0,0 +1,16 @@ +#if !defined(__mips_soft_float) && __mips >= 3 + +#include + +double sqrt(double x) +{ + double r; + __asm__("sqrt.d %0,%1" : "=f"(r) : "f"(x)); + return r; +} + +#else + +#include "../sqrt.c" + +#endif diff --git a/libc-top-half/musl/src/math/mips/sqrtf.c b/libc-top-half/musl/src/math/mips/sqrtf.c new file mode 100644 index 0000000..84090d2 --- /dev/null +++ b/libc-top-half/musl/src/math/mips/sqrtf.c @@ -0,0 +1,16 @@ +#if !defined(__mips_soft_float) && __mips >= 2 + +#include + +float sqrtf(float x) +{ + float r; + __asm__("sqrt.s %0,%1" : "=f"(r) : "f"(x)); + return r; +} + +#else + +#include "../sqrtf.c" + +#endif diff --git a/libc-top-half/musl/src/math/powerpc/fabs.c b/libc-top-half/musl/src/math/powerpc/fabs.c index f6ec443..0efc21e 100644 --- a/libc-top-half/musl/src/math/powerpc/fabs.c +++ b/libc-top-half/musl/src/math/powerpc/fabs.c @@ -1,6 +1,6 @@ #include -#ifdef _SOFT_FLOAT +#if defined(_SOFT_FLOAT) || defined(BROKEN_PPC_D_ASM) #include "../fabs.c" diff --git a/libc-top-half/musl/src/math/powerpc/fma.c b/libc-top-half/musl/src/math/powerpc/fma.c index fd268f5..135c990 100644 --- a/libc-top-half/musl/src/math/powerpc/fma.c +++ b/libc-top-half/musl/src/math/powerpc/fma.c @@ -1,6 +1,6 @@ #include -#ifdef _SOFT_FLOAT +#if defined(_SOFT_FLOAT) || defined(BROKEN_PPC_D_ASM) #include "../fma.c" diff --git a/libc-top-half/musl/src/math/x32/lrintl.s b/libc-top-half/musl/src/math/x32/lrintl.s index ee97d1c..d4355c3 100644 --- a/libc-top-half/musl/src/math/x32/lrintl.s +++ b/libc-top-half/musl/src/math/x32/lrintl.s @@ -2,6 +2,6 @@ .type lrintl,@function lrintl: fldt 8(%esp) - fistpll 8(%esp) - mov 8(%esp),%rax + fistpl 8(%esp) + movl 8(%esp),%eax ret diff --git a/libc-top-half/musl/src/misc/getrusage.c b/libc-top-half/musl/src/misc/getrusage.c index 0aaf0ac..8e03e2e 100644 --- a/libc-top-half/musl/src/misc/getrusage.c +++ b/libc-top-half/musl/src/misc/getrusage.c @@ -1,7 +1,35 @@ #include +#include +#include #include "syscall.h" int getrusage(int who, struct rusage *ru) { - return syscall(SYS_getrusage, who, ru); + int r; +#ifdef SYS_getrusage_time64 + long long kru64[18]; + r = __syscall(SYS_getrusage_time64, who, kru64); + if (!r) { + ru->ru_utime = (struct timeval) + { .tv_sec = kru64[0], .tv_usec = kru64[1] }; + ru->ru_stime = (struct timeval) + { .tv_sec = kru64[2], .tv_usec = kru64[3] }; + char *slots = (char *)&ru->ru_maxrss; + for (int i=0; i<14; i++) + *(long *)(slots + i*sizeof(long)) = kru64[4+i]; + } + if (SYS_getrusage_time64 == SYS_getrusage || r != -ENOSYS) + return __syscall_ret(r); +#endif + char *dest = (char *)&ru->ru_maxrss - 4*sizeof(long); + r = __syscall(SYS_getrusage, who, dest); + if (!r && sizeof(time_t) > sizeof(long)) { + long kru[4]; + memcpy(kru, dest, 4*sizeof(long)); + ru->ru_utime = (struct timeval) + { .tv_sec = kru[0], .tv_usec = kru[1] }; + ru->ru_stime = (struct timeval) + { .tv_sec = kru[2], .tv_usec = kru[3] }; + } + return __syscall_ret(r); } diff --git a/libc-top-half/musl/src/misc/ioctl.c b/libc-top-half/musl/src/misc/ioctl.c index 6f31d4b..8947751 100644 --- a/libc-top-half/musl/src/misc/ioctl.c +++ b/libc-top-half/musl/src/misc/ioctl.c @@ -3,8 +3,115 @@ #include #include #include +#include +#include #include "syscall.h" +#define alignof(t) offsetof(struct { char c; t x; }, x) + +#define W 1 +#define R 2 +#define WR 3 + +struct ioctl_compat_map { + int new_req, old_req; + unsigned char old_size, dir, force_align, noffs; + unsigned char offsets[8]; +}; + +#define NINTH(a,b,c,d,e,f,g,h,i,...) i +#define COUNT(...) NINTH(__VA_ARGS__,8,7,6,5,4,3,2,1,0) +#define OFFS(...) COUNT(__VA_ARGS__), { __VA_ARGS__ } + +/* yields a type for a struct with original size n, with a misaligned + * timeval/timespec expanded from 32- to 64-bit. for use with ioctl + * number producing macros; only size of result is meaningful. */ +#define new_misaligned(n) struct { int i; time_t t; char c[(n)-4]; } + +static const struct ioctl_compat_map compat_map[] = { + { SIOCGSTAMP, SIOCGSTAMP_OLD, 8, R, 0, OFFS(0, 4) }, + { SIOCGSTAMPNS, SIOCGSTAMPNS_OLD, 8, R, 0, OFFS(0, 4) }, + + /* SNDRV_TIMER_IOCTL_STATUS */ + { _IOR('T', 0x14, char[96]), _IOR('T', 0x14, 88), 88, R, 0, OFFS(0,4) }, + + /* SNDRV_PCM_IOCTL_STATUS[_EXT] */ + { _IOR('A', 0x20, char[128]), _IOR('A', 0x20, char[108]), 108, R, 1, OFFS(4,8,12,16,52,56,60,64) }, + { _IOWR('A', 0x24, char[128]), _IOWR('A', 0x24, char[108]), 108, WR, 1, OFFS(4,8,12,16,52,56,60,64) }, + + /* SNDRV_RAWMIDI_IOCTL_STATUS */ + { _IOWR('W', 0x20, char[48]), _IOWR('W', 0x20, char[36]), 36, WR, 1, OFFS(4,8) }, + + /* SNDRV_PCM_IOCTL_SYNC_PTR - with 3 subtables */ + { _IOWR('A', 0x23, char[136]), _IOWR('A', 0x23, char[132]), 0, WR, 1, 0 }, + { 0, 0, 4, WR, 1, 0 }, /* snd_pcm_sync_ptr (flags only) */ + { 0, 0, 32, WR, 1, OFFS(8,12,16,24,28) }, /* snd_pcm_mmap_status */ + { 0, 0, 8, WR, 1, OFFS(0,4) }, /* snd_pcm_mmap_control */ + + /* VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF, VIDIOC_PREPARE_BUF */ + { _IOWR('V', 9, new_misaligned(72)), _IOWR('V', 9, char[72]), 72, WR, 0, OFFS(20) }, + { _IOWR('V', 15, new_misaligned(72)), _IOWR('V', 15, char[72]), 72, WR, 0, OFFS(20) }, + { _IOWR('V', 17, new_misaligned(72)), _IOWR('V', 17, char[72]), 72, WR, 0, OFFS(20) }, + { _IOWR('V', 93, new_misaligned(72)), _IOWR('V', 93, char[72]), 72, WR, 0, OFFS(20) }, + + /* VIDIOC_DQEVENT */ + { _IOR('V', 89, new_misaligned(96)), _IOR('V', 89, char[96]), 96, R, 0, OFFS(76,80) }, + + /* VIDIOC_OMAP3ISP_STAT_REQ */ + { _IOWR('V', 192+6, char[32]), _IOWR('V', 192+6, char[24]), 22, WR, 0, OFFS(0,4) }, + + /* PPPIOCGIDLE */ + { _IOR('t', 63, char[16]), _IOR('t', 63, char[8]), 8, R, 0, OFFS(0,4) }, + + /* PPGETTIME, PPSETTIME */ + { _IOR('p', 0x95, char[16]), _IOR('p', 0x95, char[8]), 8, R, 0, OFFS(0,4) }, + { _IOW('p', 0x96, char[16]), _IOW('p', 0x96, char[8]), 8, W, 0, OFFS(0,4) }, + + /* LPSETTIMEOUT */ + { _IOW(0x6, 0xf, char[16]), 0x060f, 8, W, 0, OFFS(0,4) }, +}; + +static void convert_ioctl_struct(const struct ioctl_compat_map *map, char *old, char *new, int dir) +{ + int new_offset = 0; + int old_offset = 0; + int old_size = map->old_size; + if (!(dir & map->dir)) return; + if (!map->old_size) { + /* offsets hard-coded for SNDRV_PCM_IOCTL_SYNC_PTR; + * if another exception appears this needs changing. */ + convert_ioctl_struct(map+1, old, new, dir); + convert_ioctl_struct(map+2, old+4, new+8, dir); + convert_ioctl_struct(map+3, old+68, new+72, dir); + return; + } + for (int i=0; i < map->noffs; i++) { + int ts_offset = map->offsets[i]; + int len = ts_offset-old_offset; + if (dir==W) memcpy(old+old_offset, new+new_offset, len); + else memcpy(new+new_offset, old+old_offset, len); + new_offset += len; + old_offset += len; + long long new_ts; + long old_ts; + int align = map->force_align ? sizeof(time_t) : alignof(time_t); + new_offset += (align-1) & -new_offset; + if (dir==W) { + memcpy(&new_ts, new+new_offset, sizeof new_ts); + old_ts = new_ts; + memcpy(old+old_offset, &old_ts, sizeof old_ts); + } else { + memcpy(&old_ts, old+old_offset, sizeof old_ts); + new_ts = old_ts; + memcpy(new+new_offset, &new_ts, sizeof new_ts); + } + new_offset += sizeof new_ts; + old_offset += sizeof old_ts; + } + if (dir==W) memcpy(old+old_offset, new+new_offset, old_size-old_offset); + else memcpy(new+new_offset, old+old_offset, old_size-old_offset); +} + int ioctl(int fd, int req, ...) { void *arg; @@ -13,23 +120,18 @@ int ioctl(int fd, int req, ...) arg = va_arg(ap, void *); va_end(ap); int r = __syscall(SYS_ioctl, fd, req, arg); - if (r==-ENOTTY) switch (req) { - case SIOCGSTAMP: - case SIOCGSTAMPNS: - if (SIOCGSTAMP==SIOCGSTAMP_OLD) break; - if (req==SIOCGSTAMP) req=SIOCGSTAMP_OLD; - if (req==SIOCGSTAMPNS) req=SIOCGSTAMPNS_OLD; - long t32[2]; - r = __syscall(SYS_ioctl, fd, req, t32); - if (r<0) break; - if (req==SIOCGSTAMP_OLD) { - struct timeval *tv = arg; - tv->tv_sec = t32[0]; - tv->tv_usec = t32[1]; - } else { - struct timespec *ts = arg; - ts->tv_sec = t32[0]; - ts->tv_nsec = t32[1]; + if (SIOCGSTAMP != SIOCGSTAMP_OLD && req && r==-ENOTTY) { + for (int i=0; itv_sec = tv32[0]; tv->tv_usec = tv32[1]; *optlen = sizeof *tv; + break; + case SO_TIMESTAMP: + case SO_TIMESTAMPNS: + if (SO_TIMESTAMP == SO_TIMESTAMP_OLD) break; + if (optname==SO_TIMESTAMP) optname=SO_TIMESTAMP_OLD; + if (optname==SO_TIMESTAMPNS) optname=SO_TIMESTAMPNS_OLD; + r = __socketcall(getsockopt, fd, level, + optname, optval, optlen, 0); + break; } } return __syscall_ret(r); diff --git a/libc-top-half/musl/src/network/recvmmsg.c b/libc-top-half/musl/src/network/recvmmsg.c index d5dc6b5..2978e2f 100644 --- a/libc-top-half/musl/src/network/recvmmsg.c +++ b/libc-top-half/musl/src/network/recvmmsg.c @@ -8,6 +8,8 @@ #define IS32BIT(x) !((x)+0x80000000ULL>>32) #define CLAMP(x) (int)(IS32BIT(x) ? (x) : 0x7fffffffU+((0ULL+(x))>>63)) +hidden void __convert_scm_timestamps(struct msghdr *, socklen_t); + int recvmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int flags, struct timespec *timeout) { #if LONG_MAX > INT_MAX @@ -19,14 +21,18 @@ int recvmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int fla #ifdef SYS_recvmmsg_time64 time_t s = timeout ? timeout->tv_sec : 0; long ns = timeout ? timeout->tv_nsec : 0; - int r = -ENOSYS; - if (SYS_recvmmsg == SYS_recvmmsg_time64 || !IS32BIT(s)) - r = __syscall_cp(SYS_recvmmsg_time64, fd, msgvec, vlen, flags, + int r = __syscall_cp(SYS_recvmmsg_time64, fd, msgvec, vlen, flags, timeout ? ((long long[]){s, ns}) : 0); if (SYS_recvmmsg == SYS_recvmmsg_time64 || r!=-ENOSYS) return __syscall_ret(r); - return syscall_cp(SYS_recvmmsg, fd, msgvec, vlen, flags, + if (vlen > IOV_MAX) vlen = IOV_MAX; + socklen_t csize[vlen]; + for (int i=0; i #include +#include +#include +#include #include "syscall.h" +hidden void __convert_scm_timestamps(struct msghdr *, socklen_t); + +void __convert_scm_timestamps(struct msghdr *msg, socklen_t csize) +{ + if (SCM_TIMESTAMP == SCM_TIMESTAMP_OLD) return; + if (!msg->msg_control || !msg->msg_controllen) return; + + struct cmsghdr *cmsg, *last=0; + long tmp; + long long tvts[2]; + int type = 0; + + for (cmsg=CMSG_FIRSTHDR(msg); cmsg; cmsg=CMSG_NXTHDR(msg, cmsg)) { + if (cmsg->cmsg_level==SOL_SOCKET) switch (cmsg->cmsg_type) { + case SCM_TIMESTAMP_OLD: + if (type) break; + type = SCM_TIMESTAMP; + goto common; + case SCM_TIMESTAMPNS_OLD: + type = SCM_TIMESTAMPNS; + common: + memcpy(&tmp, CMSG_DATA(cmsg), sizeof tmp); + tvts[0] = tmp; + memcpy(&tmp, CMSG_DATA(cmsg) + sizeof tmp, sizeof tmp); + tvts[1] = tmp; + break; + } + last = cmsg; + } + if (!last || !type) return; + if (CMSG_SPACE(sizeof tvts) > csize-msg->msg_controllen) { + msg->msg_flags |= MSG_CTRUNC; + return; + } + msg->msg_controllen += CMSG_SPACE(sizeof tvts); + cmsg = CMSG_NXTHDR(msg, last); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = type; + cmsg->cmsg_len = CMSG_LEN(sizeof tvts); + memcpy(CMSG_DATA(cmsg), &tvts, sizeof tvts); +} + ssize_t recvmsg(int fd, struct msghdr *msg, int flags) { ssize_t r; + socklen_t orig_controllen = msg->msg_controllen; #if LONG_MAX > INT_MAX struct msghdr h, *orig = msg; if (msg) { @@ -14,6 +60,7 @@ ssize_t recvmsg(int fd, struct msghdr *msg, int flags) } #endif r = socketcall_cp(recvmsg, fd, msg, flags, 0, 0, 0); + if (r >= 0) __convert_scm_timestamps(msg, orig_controllen); #if LONG_MAX > INT_MAX if (orig) *orig = h; #endif diff --git a/libc-top-half/musl/src/network/setsockopt.c b/libc-top-half/musl/src/network/setsockopt.c index 2c188a9..612a194 100644 --- a/libc-top-half/musl/src/network/setsockopt.c +++ b/libc-top-half/musl/src/network/setsockopt.c @@ -31,6 +31,15 @@ int setsockopt(int fd, int level, int optname, const void *optval, socklen_t opt r = __socketcall(setsockopt, fd, level, optname, ((long[]){s, CLAMP(us)}), 2*sizeof(long), 0); + break; + case SO_TIMESTAMP: + case SO_TIMESTAMPNS: + if (SO_TIMESTAMP == SO_TIMESTAMP_OLD) break; + if (optname==SO_TIMESTAMP) optname=SO_TIMESTAMP_OLD; + if (optname==SO_TIMESTAMPNS) optname=SO_TIMESTAMPNS_OLD; + r = __socketcall(setsockopt, fd, level, + optname, optval, optlen, 0); + break; } } return __syscall_ret(r); diff --git a/libc-top-half/musl/src/signal/arm/sigsetjmp.s b/libc-top-half/musl/src/signal/arm/sigsetjmp.s index 318addb..69ebbf4 100644 --- a/libc-top-half/musl/src/signal/arm/sigsetjmp.s +++ b/libc-top-half/musl/src/signal/arm/sigsetjmp.s @@ -6,9 +6,10 @@ sigsetjmp: __sigsetjmp: tst r1,r1 - beq setjmp + bne 1f + b setjmp - str lr,[r0,#256] +1: str lr,[r0,#256] str r4,[r0,#260+8] mov r4,r0 diff --git a/libc-top-half/musl/src/stat/__xstat.c b/libc-top-half/musl/src/stat/__xstat.c index f630343..630936a 100644 --- a/libc-top-half/musl/src/stat/__xstat.c +++ b/libc-top-half/musl/src/stat/__xstat.c @@ -1,5 +1,7 @@ #include +#if !_REDIR_TIME64 + int __fxstat(int ver, int fd, struct stat *buf) { return fstat(fd, buf); @@ -25,6 +27,8 @@ weak_alias(__fxstatat, __fxstatat64); weak_alias(__lxstat, __lxstat64); weak_alias(__xstat, __xstat64); +#endif + int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev) { return mknod(path, mode, *dev); diff --git a/libc-top-half/musl/src/stat/fchmodat.c b/libc-top-half/musl/src/stat/fchmodat.c index be61bdf..4ee00b0 100644 --- a/libc-top-half/musl/src/stat/fchmodat.c +++ b/libc-top-half/musl/src/stat/fchmodat.c @@ -2,6 +2,7 @@ #include #include #include "syscall.h" +#include "kstat.h" int fchmodat(int fd, const char *path, mode_t mode, int flag) { @@ -10,7 +11,7 @@ int fchmodat(int fd, const char *path, mode_t mode, int flag) if (flag != AT_SYMLINK_NOFOLLOW) return __syscall_ret(-EINVAL); - struct stat st; + struct kstat st; int ret, fd2; char proc[15+3*sizeof(int)]; diff --git a/libc-top-half/musl/src/stat/fstat.c b/libc-top-half/musl/src/stat/fstat.c index 07f9a5d..9bbb46d 100644 --- a/libc-top-half/musl/src/stat/fstat.c +++ b/libc-top-half/musl/src/stat/fstat.c @@ -10,4 +10,6 @@ int fstat(int fd, struct stat *st) return fstatat(fd, "", st, AT_EMPTY_PATH); } +#if !_REDIR_TIME64 weak_alias(fstat, fstat64); +#endif diff --git a/libc-top-half/musl/src/stat/fstatat.c b/libc-top-half/musl/src/stat/fstatat.c index d915fa1..de165b5 100644 --- a/libc-top-half/musl/src/stat/fstatat.c +++ b/libc-top-half/musl/src/stat/fstatat.c @@ -57,6 +57,14 @@ static int fstatat_statx(int fd, const char *restrict path, struct stat *restric .st_mtim.tv_nsec = stx.stx_mtime.tv_nsec, .st_ctim.tv_sec = stx.stx_ctime.tv_sec, .st_ctim.tv_nsec = stx.stx_ctime.tv_nsec, +#if _REDIR_TIME64 + .__st_atim32.tv_sec = stx.stx_atime.tv_sec, + .__st_atim32.tv_nsec = stx.stx_atime.tv_nsec, + .__st_mtim32.tv_sec = stx.stx_mtime.tv_sec, + .__st_mtim32.tv_nsec = stx.stx_mtime.tv_nsec, + .__st_ctim32.tv_sec = stx.stx_ctime.tv_sec, + .__st_ctim32.tv_nsec = stx.stx_ctime.tv_nsec, +#endif }; return 0; } @@ -110,6 +118,14 @@ static int fstatat_kstat(int fd, const char *restrict path, struct stat *restric .st_mtim.tv_nsec = kst.st_mtime_nsec, .st_ctim.tv_sec = kst.st_ctime_sec, .st_ctim.tv_nsec = kst.st_ctime_nsec, +#if _REDIR_TIME64 + .__st_atim32.tv_sec = kst.st_atime_sec, + .__st_atim32.tv_nsec = kst.st_atime_nsec, + .__st_mtim32.tv_sec = kst.st_mtime_sec, + .__st_mtim32.tv_nsec = kst.st_mtime_nsec, + .__st_ctim32.tv_sec = kst.st_ctime_sec, + .__st_ctim32.tv_nsec = kst.st_ctime_nsec, +#endif }; return 0; @@ -126,4 +142,6 @@ int fstatat(int fd, const char *restrict path, struct stat *restrict st, int fla return __syscall_ret(ret); } +#if !_REDIR_TIME64 weak_alias(fstatat, fstatat64); +#endif diff --git a/libc-top-half/musl/src/stat/lstat.c b/libc-top-half/musl/src/stat/lstat.c index 9f95218..6fe004d 100644 --- a/libc-top-half/musl/src/stat/lstat.c +++ b/libc-top-half/musl/src/stat/lstat.c @@ -6,4 +6,6 @@ int lstat(const char *restrict path, struct stat *restrict buf) return fstatat(AT_FDCWD, path, buf, AT_SYMLINK_NOFOLLOW); } +#if !_REDIR_TIME64 weak_alias(lstat, lstat64); +#endif diff --git a/libc-top-half/musl/src/stat/stat.c b/libc-top-half/musl/src/stat/stat.c index 528870d..ea70efc 100644 --- a/libc-top-half/musl/src/stat/stat.c +++ b/libc-top-half/musl/src/stat/stat.c @@ -6,4 +6,6 @@ int stat(const char *restrict path, struct stat *restrict buf) return fstatat(AT_FDCWD, path, buf, 0); } +#if !_REDIR_TIME64 weak_alias(stat, stat64); +#endif diff --git a/libc-top-half/musl/src/stdio/tempnam.c b/libc-top-half/musl/src/stdio/tempnam.c index 84f9197..565df6b 100644 --- a/libc-top-half/musl/src/stdio/tempnam.c +++ b/libc-top-half/musl/src/stdio/tempnam.c @@ -6,6 +6,7 @@ #include #include #include "syscall.h" +#include "kstat.h" #define MAXTRIES 100 @@ -37,10 +38,10 @@ char *tempnam(const char *dir, const char *pfx) for (try=0; try #include #include "syscall.h" +#include "kstat.h" #define MAXTRIES 100 @@ -17,10 +18,10 @@ char *tmpnam(char *buf) for (try=0; tryflags &= ~F_EOF; FUNLOCK(f); - return c; + return (unsigned char)c; } diff --git a/libc-top-half/musl/src/string/arm/memcpy.c b/libc-top-half/musl/src/string/arm/memcpy.c index f703c9b..041614f 100644 --- a/libc-top-half/musl/src/string/arm/memcpy.c +++ b/libc-top-half/musl/src/string/arm/memcpy.c @@ -1,3 +1,3 @@ -#if __ARMEB__ || __thumb__ +#if __ARMEB__ #include "../memcpy.c" #endif diff --git a/libc-top-half/musl/src/string/arm/memcpy_le.S b/libc-top-half/musl/src/string/arm/memcpy_le.S index 9cfbcb2..7b35d30 100644 --- a/libc-top-half/musl/src/string/arm/memcpy_le.S +++ b/libc-top-half/musl/src/string/arm/memcpy_le.S @@ -1,4 +1,4 @@ -#if !__ARMEB__ && !__thumb__ +#if !__ARMEB__ /* * Copyright (C) 2008 The Android Open Source Project @@ -40,8 +40,9 @@ * This file has been modified from the original for use in musl libc. * The main changes are: addition of .type memcpy,%function to make the * code safely callable from thumb mode, adjusting the return - * instructions to be compatible with pre-thumb ARM cpus, and removal - * of prefetch code that is not compatible with older cpus. + * instructions to be compatible with pre-thumb ARM cpus, removal of + * prefetch code that is not compatible with older cpus and support for + * building as thumb 2. */ .syntax unified @@ -241,7 +242,8 @@ non_congruent: beq 2f ldr r5, [r1], #4 sub r2, r2, #4 - orr r4, r3, r5, lsl lr + mov r4, r5, lsl lr + orr r4, r4, r3 mov r3, r5, lsr r12 str r4, [r0], #4 cmp r2, #4 @@ -348,7 +350,8 @@ less_than_thirtytwo: 1: ldr r5, [r1], #4 sub r2, r2, #4 - orr r4, r3, r5, lsl lr + mov r4, r5, lsl lr + orr r4, r4, r3 mov r3, r5, lsr r12 str r4, [r0], #4 cmp r2, #4 diff --git a/libc-top-half/musl/src/time/__map_file.c b/libc-top-half/musl/src/time/__map_file.c index 9d37622..d3cefa8 100644 --- a/libc-top-half/musl/src/time/__map_file.c +++ b/libc-top-half/musl/src/time/__map_file.c @@ -2,10 +2,11 @@ #include #include #include "syscall.h" +#include "kstat.h" const char unsigned *__map_file(const char *pathname, size_t *size) { - struct stat st; + struct kstat st; const unsigned char *map = MAP_FAILED; int fd = sys_open(pathname, O_RDONLY|O_CLOEXEC|O_NONBLOCK); if (fd < 0) return 0; diff --git a/libc-top-half/musl/tools/add-cfi.i386.awk b/libc-top-half/musl/tools/add-cfi.i386.awk index 9162e30..d05037d 100644 --- a/libc-top-half/musl/tools/add-cfi.i386.awk +++ b/libc-top-half/musl/tools/add-cfi.i386.awk @@ -81,7 +81,7 @@ function adjust_sp_offset(delta) { in_function = 0 } } -/^\.type [a-zA-Z0-9_]+,\@function/ { +/^\.type [a-zA-Z0-9_]+,@function/ { functions[substr($2, 1, length($2)-10)] = 1 } # not interested in assembler directives beyond this, just pass them through diff --git a/libc-top-half/musl/tools/add-cfi.x86_64.awk b/libc-top-half/musl/tools/add-cfi.x86_64.awk index bbc90da..7e1513d 100644 --- a/libc-top-half/musl/tools/add-cfi.x86_64.awk +++ b/libc-top-half/musl/tools/add-cfi.x86_64.awk @@ -76,7 +76,7 @@ function adjust_sp_offset(delta) { in_function = 0 } } -/^\.type [a-zA-Z0-9_]+,\@function/ { +/^\.type [a-zA-Z0-9_]+,@function/ { functions[substr($2, 1, length($2)-10)] = 1 } # not interested in assembler directives beyond this, just pass them through -- 2.39.2