diff --git a/lib/libc/include/aarch64-linux-musl/bits/hwcap.h b/lib/libc/include/aarch64-linux-musl/bits/hwcap.h index 80a088ef35..4628bc7823 100644 --- a/lib/libc/include/aarch64-linux-musl/bits/hwcap.h +++ b/lib/libc/include/aarch64-linux-musl/bits/hwcap.h @@ -47,4 +47,6 @@ #define HWCAP2_I8MM (1 << 13) #define HWCAP2_BF16 (1 << 14) #define HWCAP2_DGH (1 << 15) -#define HWCAP2_RNG (1 << 16) \ No newline at end of file +#define HWCAP2_RNG (1 << 16) +#define HWCAP2_BTI (1 << 17) +#define HWCAP2_MTE (1 << 18) \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-musl/bits/mman.h b/lib/libc/include/aarch64-linux-musl/bits/mman.h new file mode 100644 index 0000000000..acfc36f243 --- /dev/null +++ b/lib/libc/include/aarch64-linux-musl/bits/mman.h @@ -0,0 +1,2 @@ +#define PROT_BTI 0x10 +#define PROT_MTE 0x20 \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-musl/bits/syscall.h b/lib/libc/include/aarch64-linux-musl/bits/syscall.h index b15eb8bfd0..d2a4e40aa8 100644 --- a/lib/libc/include/aarch64-linux-musl/bits/syscall.h +++ b/lib/libc/include/aarch64-linux-musl/bits/syscall.h @@ -293,6 +293,12 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define SYS_io_setup 0 #define SYS_io_destroy 1 @@ -588,4 +594,10 @@ #define SYS_close_range 436 #define SYS_openat2 437 #define SYS_pidfd_getfd 438 -#define SYS_faccessat2 439 \ No newline at end of file +#define SYS_faccessat2 439 +#define SYS_process_madvise 440 +#define SYS_epoll_pwait2 441 +#define SYS_mount_setattr 442 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_restrict_self 446 \ No newline at end of file diff --git a/lib/libc/include/arm-linux-musl/bits/syscall.h b/lib/libc/include/arm-linux-musl/bits/syscall.h index 479dd8a379..179b6df9f3 100644 --- a/lib/libc/include/arm-linux-musl/bits/syscall.h +++ b/lib/libc/include/arm-linux-musl/bits/syscall.h @@ -393,6 +393,12 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define __ARM_NR_breakpoint 0x0f0001 #define __ARM_NR_cacheflush 0x0f0002 @@ -795,4 +801,10 @@ #define SYS_close_range 436 #define SYS_openat2 437 #define SYS_pidfd_getfd 438 -#define SYS_faccessat2 439 \ No newline at end of file +#define SYS_faccessat2 439 +#define SYS_process_madvise 440 +#define SYS_epoll_pwait2 441 +#define SYS_mount_setattr 442 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_restrict_self 446 \ No newline at end of file diff --git a/lib/libc/include/generic-musl/ctype.h b/lib/libc/include/generic-musl/ctype.h index 7005220cea..a991158a6d 100644 --- a/lib/libc/include/generic-musl/ctype.h +++ b/lib/libc/include/generic-musl/ctype.h @@ -64,7 +64,9 @@ int isascii(int); int toascii(int); #define _tolower(a) ((a)|0x20) #define _toupper(a) ((a)&0x5f) +#ifndef __cplusplus #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128) +#endif #endif diff --git a/lib/libc/include/generic-musl/elf.h b/lib/libc/include/generic-musl/elf.h index ff7214ed48..6b2c83b6a8 100644 --- a/lib/libc/include/generic-musl/elf.h +++ b/lib/libc/include/generic-musl/elf.h @@ -686,6 +686,8 @@ typedef struct { #define NT_ARM_PAC_MASK 0x406 #define NT_ARM_PACA_KEYS 0x407 #define NT_ARM_PACG_KEYS 0x408 +#define NT_ARM_TAGGED_ADDR_CTRL 0x409 +#define NT_ARM_PAC_ENABLED_KEYS 0x40a #define NT_METAG_CBUF 0x500 #define NT_METAG_RPIPE 0x501 #define NT_METAG_TLS 0x502 diff --git a/lib/libc/include/generic-musl/locale.h b/lib/libc/include/generic-musl/locale.h index 61ffafb458..6328b5f058 100644 --- a/lib/libc/include/generic-musl/locale.h +++ b/lib/libc/include/generic-musl/locale.h @@ -7,7 +7,9 @@ extern "C" { #include -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/include/generic-musl/netinet/if_ether.h b/lib/libc/include/generic-musl/netinet/if_ether.h index d1c0a03570..f9169287f2 100644 --- a/lib/libc/include/generic-musl/netinet/if_ether.h +++ b/lib/libc/include/generic-musl/netinet/if_ether.h @@ -66,6 +66,7 @@ #define ETH_P_1588 0x88F7 #define ETH_P_NCSI 0x88F8 #define ETH_P_PRP 0x88FB +#define ETH_P_CFM 0x8902 #define ETH_P_FCOE 0x8906 #define ETH_P_TDLS 0x890D #define ETH_P_FIP 0x8914 diff --git a/lib/libc/include/generic-musl/netinet/in.h b/lib/libc/include/generic-musl/netinet/in.h index a57f3a6c7c..98202653c1 100644 --- a/lib/libc/include/generic-musl/netinet/in.h +++ b/lib/libc/include/generic-musl/netinet/in.h @@ -48,6 +48,7 @@ struct ipv6_mreq { #define INADDR_BROADCAST ((in_addr_t) 0xffffffff) #define INADDR_NONE ((in_addr_t) 0xffffffff) #define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) +#define INADDR_DUMMY ((in_addr_t) 0xc0000008) #define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) #define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) diff --git a/lib/libc/include/generic-musl/netinet/tcp.h b/lib/libc/include/generic-musl/netinet/tcp.h index 9f514e33af..3eb212c61a 100644 --- a/lib/libc/include/generic-musl/netinet/tcp.h +++ b/lib/libc/include/generic-musl/netinet/tcp.h @@ -80,6 +80,8 @@ enum { TCP_NLA_SRTT, TCP_NLA_TIMEOUT_REHASH, TCP_NLA_BYTES_NOTSENT, + TCP_NLA_EDT, + TCP_NLA_TTL, }; #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) @@ -281,12 +283,21 @@ struct tcp_repair_window { uint32_t rcv_wup; }; +#define TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT 0x1 + struct tcp_zerocopy_receive { uint64_t address; uint32_t length; uint32_t recv_skip_hint; uint32_t inq; int32_t err; + uint64_t copybuf_address; + int32_t copybuf_len; + uint32_t flags; + uint64_t msg_control; + uint64_t msg_controllen; + uint32_t msg_flags; + uint32_t reserved; }; #endif diff --git a/lib/libc/include/generic-musl/pthread.h b/lib/libc/include/generic-musl/pthread.h index c31099ec7f..9552460b4c 100644 --- a/lib/libc/include/generic-musl/pthread.h +++ b/lib/libc/include/generic-musl/pthread.h @@ -221,6 +221,7 @@ int pthread_getaffinity_np(pthread_t, size_t, struct cpu_set_t *); int pthread_setaffinity_np(pthread_t, size_t, const struct cpu_set_t *); int pthread_getattr_np(pthread_t, pthread_attr_t *); int pthread_setname_np(pthread_t, const char *); +int pthread_getname_np(pthread_t, char *, size_t); int pthread_getattr_default_np(pthread_attr_t *); int pthread_setattr_default_np(const pthread_attr_t *); int pthread_tryjoin_np(pthread_t, void **); diff --git a/lib/libc/include/generic-musl/setjmp.h b/lib/libc/include/generic-musl/setjmp.h index e956f67302..2ccc2ac822 100644 --- a/lib/libc/include/generic-musl/setjmp.h +++ b/lib/libc/include/generic-musl/setjmp.h @@ -15,25 +15,33 @@ typedef struct __jmp_buf_tag { unsigned long __ss[128/sizeof(long)]; } jmp_buf[1]; +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) +#define __setjmp_attr __attribute__((__returns_twice__)) +#else +#define __setjmp_attr +#endif + #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) typedef jmp_buf sigjmp_buf; -int sigsetjmp (sigjmp_buf, int); +int sigsetjmp (sigjmp_buf, int) __setjmp_attr; _Noreturn void siglongjmp (sigjmp_buf, int); #endif #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) -int _setjmp (jmp_buf); +int _setjmp (jmp_buf) __setjmp_attr; _Noreturn void _longjmp (jmp_buf, int); #endif -int setjmp (jmp_buf); +int setjmp (jmp_buf) __setjmp_attr; _Noreturn void longjmp (jmp_buf, int); #define setjmp setjmp +#undef __setjmp_attr + #ifdef __cplusplus } #endif diff --git a/lib/libc/include/generic-musl/signal.h b/lib/libc/include/generic-musl/signal.h index 779f4f0609..1fafc54e6f 100644 --- a/lib/libc/include/generic-musl/signal.h +++ b/lib/libc/include/generic-musl/signal.h @@ -75,6 +75,8 @@ typedef struct sigaltstack stack_t; #define SEGV_ACCERR 2 #define SEGV_BNDERR 3 #define SEGV_PKUERR 4 +#define SEGV_MTEAERR 8 +#define SEGV_MTESERR 9 #define BUS_ADRALN 1 #define BUS_ADRERR 2 @@ -176,6 +178,9 @@ struct sigaction { #define sa_handler __sa_handler.sa_handler #define sa_sigaction __sa_handler.sa_sigaction +#define SA_UNSUPPORTED 0x00000400 +#define SA_EXPOSE_TAGBITS 0x00000800 + struct sigevent { union sigval sigev_value; int sigev_signo; @@ -259,6 +264,9 @@ void (*sigset(int, void (*)(int)))(int); #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) #define NSIG _NSIG typedef void (*sig_t)(int); + +#define SYS_SECCOMP 1 +#define SYS_USER_DISPATCH 2 #endif #ifdef _GNU_SOURCE diff --git a/lib/libc/include/generic-musl/stdc-predef.h b/lib/libc/include/generic-musl/stdc-predef.h index 2ed5e520c9..7f0f90dc81 100644 --- a/lib/libc/include/generic-musl/stdc-predef.h +++ b/lib/libc/include/generic-musl/stdc-predef.h @@ -7,4 +7,7 @@ #define __STDC_IEC_559__ 1 #endif +#define __STDC_UTF_16__ 1 +#define __STDC_UTF_32__ 1 + #endif \ No newline at end of file diff --git a/lib/libc/include/generic-musl/stddef.h b/lib/libc/include/generic-musl/stddef.h index 758cb66c99..08cd52271d 100644 --- a/lib/libc/include/generic-musl/stddef.h +++ b/lib/libc/include/generic-musl/stddef.h @@ -1,7 +1,9 @@ #ifndef _STDDEF_H #define _STDDEF_H -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/include/generic-musl/stdio.h b/lib/libc/include/generic-musl/stdio.h index 92f52bd27e..3b82c24fd3 100644 --- a/lib/libc/include/generic-musl/stdio.h +++ b/lib/libc/include/generic-musl/stdio.h @@ -25,7 +25,9 @@ extern "C" { #include -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/include/generic-musl/stdlib.h b/lib/libc/include/generic-musl/stdlib.h index ee777fc915..eb6daf49e8 100644 --- a/lib/libc/include/generic-musl/stdlib.h +++ b/lib/libc/include/generic-musl/stdlib.h @@ -7,7 +7,9 @@ extern "C" { #include -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) @@ -146,6 +148,7 @@ int clearenv(void); #define WCOREDUMP(s) ((s) & 0x80) #define WIFCONTINUED(s) ((s) == 0xffff) void *reallocarray (void *, size_t, size_t); +void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *); #endif #ifdef _GNU_SOURCE diff --git a/lib/libc/include/generic-musl/string.h b/lib/libc/include/generic-musl/string.h index 3670e6e7a6..fdd4eb782d 100644 --- a/lib/libc/include/generic-musl/string.h +++ b/lib/libc/include/generic-musl/string.h @@ -7,7 +7,9 @@ extern "C" { #include -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/include/generic-musl/sys/membarrier.h b/lib/libc/include/generic-musl/sys/membarrier.h index b4559ee15e..73e8b2a19b 100644 --- a/lib/libc/include/generic-musl/sys/membarrier.h +++ b/lib/libc/include/generic-musl/sys/membarrier.h @@ -9,9 +9,13 @@ #define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED 16 #define MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE 32 #define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE 64 +#define MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ 128 +#define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ 256 #define MEMBARRIER_CMD_SHARED MEMBARRIER_CMD_GLOBAL +#define MEMBARRIER_CMD_FLAG_CPU 1 + int membarrier(int, int); #endif \ No newline at end of file diff --git a/lib/libc/include/generic-musl/sys/mman.h b/lib/libc/include/generic-musl/sys/mman.h index a620fffea1..4f82dd1ecd 100644 --- a/lib/libc/include/generic-musl/sys/mman.h +++ b/lib/libc/include/generic-musl/sys/mman.h @@ -40,6 +40,7 @@ extern "C" { #define MAP_HUGE_SHIFT 26 #define MAP_HUGE_MASK 0x3f +#define MAP_HUGE_16KB (14 << 26) #define MAP_HUGE_64KB (16 << 26) #define MAP_HUGE_512KB (19 << 26) #define MAP_HUGE_1MB (20 << 26) diff --git a/lib/libc/include/generic-musl/sys/mount.h b/lib/libc/include/generic-musl/sys/mount.h index a3836f2ff2..fc2b8333a4 100644 --- a/lib/libc/include/generic-musl/sys/mount.h +++ b/lib/libc/include/generic-musl/sys/mount.h @@ -31,6 +31,7 @@ extern "C" { #define MS_REMOUNT 32 #define MS_MANDLOCK 64 #define MS_DIRSYNC 128 +#define MS_NOSYMFOLLOW 256 #define MS_NOATIME 1024 #define MS_NODIRATIME 2048 #define MS_BIND 4096 diff --git a/lib/libc/include/generic-musl/sys/prctl.h b/lib/libc/include/generic-musl/sys/prctl.h index bceebd8bcf..76c0658671 100644 --- a/lib/libc/include/generic-musl/sys/prctl.h +++ b/lib/libc/include/generic-musl/sys/prctl.h @@ -157,10 +157,26 @@ struct prctl_mm_map { #define PR_SET_TAGGED_ADDR_CTRL 55 #define PR_GET_TAGGED_ADDR_CTRL 56 #define PR_TAGGED_ADDR_ENABLE (1UL << 0) +#define PR_MTE_TCF_SHIFT 1 +#define PR_MTE_TCF_NONE (0UL << 1) +#define PR_MTE_TCF_SYNC (1UL << 1) +#define PR_MTE_TCF_ASYNC (2UL << 1) +#define PR_MTE_TCF_MASK (3UL << 1) +#define PR_MTE_TAG_SHIFT 3 +#define PR_MTE_TAG_MASK (0xffffUL << 3) #define PR_SET_IO_FLUSHER 57 #define PR_GET_IO_FLUSHER 58 +#define PR_SET_SYSCALL_USER_DISPATCH 59 +#define PR_SYS_DISPATCH_OFF 0 +#define PR_SYS_DISPATCH_ON 1 +#define SYSCALL_DISPATCH_FILTER_ALLOW 0 +#define SYSCALL_DISPATCH_FILTER_BLOCK 1 + +#define PR_PAC_SET_ENABLED_KEYS 60 +#define PR_PAC_GET_ENABLED_KEYS 61 + int prctl (int, ...); #ifdef __cplusplus diff --git a/lib/libc/include/generic-musl/sys/ptrace.h b/lib/libc/include/generic-musl/sys/ptrace.h index 1f0c6890fe..09f65cbcae 100644 --- a/lib/libc/include/generic-musl/sys/ptrace.h +++ b/lib/libc/include/generic-musl/sys/ptrace.h @@ -42,6 +42,7 @@ extern "C" { #define PTRACE_SECCOMP_GET_FILTER 0x420c #define PTRACE_SECCOMP_GET_METADATA 0x420d #define PTRACE_GET_SYSCALL_INFO 0x420e +#define PTRACE_GET_RSEQ_CONFIGURATION 0x420f #define PT_READ_I PTRACE_PEEKTEXT #define PT_READ_D PTRACE_PEEKDATA @@ -130,6 +131,14 @@ struct __ptrace_syscall_info { }; }; +struct __ptrace_rseq_configuration { + uint64_t rseq_abi_pointer; + uint32_t rseq_abi_size; + uint32_t signature; + uint32_t flags; + uint32_t pad; +}; + long ptrace(int, ...); #ifdef __cplusplus diff --git a/lib/libc/include/generic-musl/sys/socket.h b/lib/libc/include/generic-musl/sys/socket.h index 957d3da9f0..8308d578fc 100644 --- a/lib/libc/include/generic-musl/sys/socket.h +++ b/lib/libc/include/generic-musl/sys/socket.h @@ -289,6 +289,8 @@ struct linger { #define SCM_TXTIME SO_TXTIME #define SO_BINDTOIFINDEX 62 #define SO_DETACH_REUSEPORT_BPF 68 +#define SO_PREFER_BUSY_POLL 69 +#define SO_BUSY_POLL_BUDGET 70 #ifndef SOL_SOCKET #define SOL_SOCKET 1 diff --git a/lib/libc/include/generic-musl/time.h b/lib/libc/include/generic-musl/time.h index 5a9f61eb4d..a5bb2d2b8a 100644 --- a/lib/libc/include/generic-musl/time.h +++ b/lib/libc/include/generic-musl/time.h @@ -7,7 +7,9 @@ extern "C" { #include -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/include/generic-musl/unistd.h b/lib/libc/include/generic-musl/unistd.h index c6f5698b4e..cb9b96959d 100644 --- a/lib/libc/include/generic-musl/unistd.h +++ b/lib/libc/include/generic-musl/unistd.h @@ -14,8 +14,12 @@ extern "C" { #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 +#define SEEK_DATA 3 +#define SEEK_HOLE 4 -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/include/generic-musl/wchar.h b/lib/libc/include/generic-musl/wchar.h index 9c11e0c77f..2557778921 100644 --- a/lib/libc/include/generic-musl/wchar.h +++ b/lib/libc/include/generic-musl/wchar.h @@ -38,7 +38,9 @@ extern "C" { #define WCHAR_MIN (-1-0x7fffffff+L'\0') #endif -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/include/i386-linux-musl/bits/syscall.h b/lib/libc/include/i386-linux-musl/bits/syscall.h index 4a727513c1..37130cf3f0 100644 --- a/lib/libc/include/i386-linux-musl/bits/syscall.h +++ b/lib/libc/include/i386-linux-musl/bits/syscall.h @@ -430,6 +430,12 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define SYS_restart_syscall 0 #define SYS_exit 1 @@ -860,4 +866,10 @@ #define SYS_close_range 436 #define SYS_openat2 437 #define SYS_pidfd_getfd 438 -#define SYS_faccessat2 439 \ No newline at end of file +#define SYS_faccessat2 439 +#define SYS_process_madvise 440 +#define SYS_epoll_pwait2 441 +#define SYS_mount_setattr 442 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_restrict_self 446 \ No newline at end of file diff --git a/lib/libc/include/m68k-linux-musl/bits/syscall.h b/lib/libc/include/m68k-linux-musl/bits/syscall.h index 01c5178ed8..b6b94a1fe5 100644 --- a/lib/libc/include/m68k-linux-musl/bits/syscall.h +++ b/lib/libc/include/m68k-linux-musl/bits/syscall.h @@ -410,6 +410,12 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define SYS_restart_syscall 0 #define SYS_exit 1 #define SYS_fork 2 @@ -821,4 +827,10 @@ #define SYS_close_range 436 #define SYS_openat2 437 #define SYS_pidfd_getfd 438 -#define SYS_faccessat2 439 \ No newline at end of file +#define SYS_faccessat2 439 +#define SYS_process_madvise 440 +#define SYS_epoll_pwait2 441 +#define SYS_mount_setattr 442 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_restrict_self 446 \ No newline at end of file diff --git a/lib/libc/include/mips-linux-musl/bits/syscall.h b/lib/libc/include/mips-linux-musl/bits/syscall.h index 982dcca465..fffb6b9ce3 100644 --- a/lib/libc/include/mips-linux-musl/bits/syscall.h +++ b/lib/libc/include/mips-linux-musl/bits/syscall.h @@ -412,6 +412,12 @@ #define __NR_openat2 4437 #define __NR_pidfd_getfd 4438 #define __NR_faccessat2 4439 +#define __NR_process_madvise 4440 +#define __NR_epoll_pwait2 4441 +#define __NR_mount_setattr 4442 +#define __NR_landlock_create_ruleset 4444 +#define __NR_landlock_add_rule 4445 +#define __NR_landlock_restrict_self 4446 #define SYS_syscall 4000 #define SYS_exit 4001 @@ -826,4 +832,10 @@ #define SYS_close_range 4436 #define SYS_openat2 4437 #define SYS_pidfd_getfd 4438 -#define SYS_faccessat2 4439 \ No newline at end of file +#define SYS_faccessat2 4439 +#define SYS_process_madvise 4440 +#define SYS_epoll_pwait2 4441 +#define SYS_mount_setattr 4442 +#define SYS_landlock_create_ruleset 4444 +#define SYS_landlock_add_rule 4445 +#define SYS_landlock_restrict_self 4446 \ No newline at end of file diff --git a/lib/libc/include/mips64-linux-musl/bits/syscall.h b/lib/libc/include/mips64-linux-musl/bits/syscall.h index 27a8226b71..30803a8e15 100644 --- a/lib/libc/include/mips64-linux-musl/bits/syscall.h +++ b/lib/libc/include/mips64-linux-musl/bits/syscall.h @@ -342,6 +342,12 @@ #define __NR_openat2 5437 #define __NR_pidfd_getfd 5438 #define __NR_faccessat2 5439 +#define __NR_process_madvise 5440 +#define __NR_epoll_pwait2 5441 +#define __NR_mount_setattr 5442 +#define __NR_landlock_create_ruleset 5444 +#define __NR_landlock_add_rule 5445 +#define __NR_landlock_restrict_self 5446 #define SYS_read 5000 #define SYS_write 5001 @@ -686,4 +692,10 @@ #define SYS_close_range 5436 #define SYS_openat2 5437 #define SYS_pidfd_getfd 5438 -#define SYS_faccessat2 5439 \ No newline at end of file +#define SYS_faccessat2 5439 +#define SYS_process_madvise 5440 +#define SYS_epoll_pwait2 5441 +#define SYS_mount_setattr 5442 +#define SYS_landlock_create_ruleset 5444 +#define SYS_landlock_add_rule 5445 +#define SYS_landlock_restrict_self 5446 \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-musl/bits/fenv.h b/lib/libc/include/powerpc-linux-musl/bits/fenv.h index f5f4597255..b3e0ba5135 100644 --- a/lib/libc/include/powerpc-linux-musl/bits/fenv.h +++ b/lib/libc/include/powerpc-linux-musl/bits/fenv.h @@ -1,4 +1,4 @@ -#ifdef _SOFT_FLOAT +#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) #define FE_ALL_EXCEPT 0 #define FE_TONEAREST 0 #else diff --git a/lib/libc/include/powerpc-linux-musl/bits/shm.h b/lib/libc/include/powerpc-linux-musl/bits/shm.h index e45c2ab19a..dae173193e 100644 --- a/lib/libc/include/powerpc-linux-musl/bits/shm.h +++ b/lib/libc/include/powerpc-linux-musl/bits/shm.h @@ -8,11 +8,11 @@ struct shmid_ds { unsigned long __shm_dtime_lo; unsigned long __shm_ctime_hi; unsigned long __shm_ctime_lo; + unsigned long __pad1; 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; diff --git a/lib/libc/include/powerpc-linux-musl/bits/syscall.h b/lib/libc/include/powerpc-linux-musl/bits/syscall.h index 3c935d00da..a309456d00 100644 --- a/lib/libc/include/powerpc-linux-musl/bits/syscall.h +++ b/lib/libc/include/powerpc-linux-musl/bits/syscall.h @@ -419,6 +419,12 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define SYS_restart_syscall 0 #define SYS_exit 1 @@ -840,4 +846,10 @@ #define SYS_close_range 436 #define SYS_openat2 437 #define SYS_pidfd_getfd 438 -#define SYS_faccessat2 439 \ No newline at end of file +#define SYS_faccessat2 439 +#define SYS_process_madvise 440 +#define SYS_epoll_pwait2 441 +#define SYS_mount_setattr 442 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_restrict_self 446 \ No newline at end of file diff --git a/lib/libc/include/powerpc64-linux-musl/bits/syscall.h b/lib/libc/include/powerpc64-linux-musl/bits/syscall.h index de64c3ef30..4e7c41165b 100644 --- a/lib/libc/include/powerpc64-linux-musl/bits/syscall.h +++ b/lib/libc/include/powerpc64-linux-musl/bits/syscall.h @@ -391,6 +391,12 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define SYS_restart_syscall 0 #define SYS_exit 1 @@ -784,4 +790,10 @@ #define SYS_close_range 436 #define SYS_openat2 437 #define SYS_pidfd_getfd 438 -#define SYS_faccessat2 439 \ No newline at end of file +#define SYS_faccessat2 439 +#define SYS_process_madvise 440 +#define SYS_epoll_pwait2 441 +#define SYS_mount_setattr 442 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_restrict_self 446 \ No newline at end of file diff --git a/lib/libc/include/riscv64-linux-musl/bits/syscall.h b/lib/libc/include/riscv64-linux-musl/bits/syscall.h index 27e10f5768..a19c2a5806 100644 --- a/lib/libc/include/riscv64-linux-musl/bits/syscall.h +++ b/lib/libc/include/riscv64-linux-musl/bits/syscall.h @@ -76,7 +76,7 @@ #define __NR_splice 76 #define __NR_tee 77 #define __NR_readlinkat 78 -#define __NR_fstatat 79 +#define __NR_newfstatat 79 #define __NR_fstat 80 #define __NR_sync 81 #define __NR_fsync 82 @@ -293,6 +293,12 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define __NR_sysriscv __NR_arch_specific_syscall #define __NR_riscv_flush_icache (__NR_sysriscv + 15) @@ -374,7 +380,7 @@ #define SYS_splice 76 #define SYS_tee 77 #define SYS_readlinkat 78 -#define SYS_fstatat 79 +#define SYS_newfstatat 79 #define SYS_fstat 80 #define SYS_sync 81 #define SYS_fsync 82 @@ -591,5 +597,11 @@ #define SYS_openat2 437 #define SYS_pidfd_getfd 438 #define SYS_faccessat2 439 +#define SYS_process_madvise 440 +#define SYS_epoll_pwait2 441 +#define SYS_mount_setattr 442 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_restrict_self 446 #define SYS_sysriscv __NR_arch_specific_syscall #define SYS_riscv_flush_icache (__NR_sysriscv + 15) \ No newline at end of file diff --git a/lib/libc/include/riscv64-linux-musl/bits/user.h b/lib/libc/include/riscv64-linux-musl/bits/user.h index ffeab50d0d..93ddf49b50 100644 --- a/lib/libc/include/riscv64-linux-musl/bits/user.h +++ b/lib/libc/include/riscv64-linux-musl/bits/user.h @@ -1,5 +1,6 @@ #include #define ELF_NGREG 32 +#define ELF_NFPREG 33 typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; typedef union __riscv_mc_fp_state elf_fpregset_t; \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-musl/bits/ptrace.h b/lib/libc/include/s390x-linux-musl/bits/ptrace.h index c30556e102..a47ef428f6 100644 --- a/lib/libc/include/s390x-linux-musl/bits/ptrace.h +++ b/lib/libc/include/s390x-linux-musl/bits/ptrace.h @@ -1,4 +1,7 @@ #define PTRACE_SINGLEBLOCK 12 +#define PTRACE_OLDSETOPTIONS 21 +#define PTRACE_SYSEMU 31 +#define PTRACE_SYSEMU_SINGLESTEP 32 #define PTRACE_PEEKUSR_AREA 0x5000 #define PTRACE_POKEUSR_AREA 0x5001 #define PTRACE_GET_LAST_BREAK 0x5006 diff --git a/lib/libc/include/s390x-linux-musl/bits/syscall.h b/lib/libc/include/s390x-linux-musl/bits/syscall.h index 2874c40203..90e978a74b 100644 --- a/lib/libc/include/s390x-linux-musl/bits/syscall.h +++ b/lib/libc/include/s390x-linux-musl/bits/syscall.h @@ -356,6 +356,12 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define SYS_exit 1 #define SYS_fork 2 @@ -714,4 +720,10 @@ #define SYS_close_range 436 #define SYS_openat2 437 #define SYS_pidfd_getfd 438 -#define SYS_faccessat2 439 \ No newline at end of file +#define SYS_faccessat2 439 +#define SYS_process_madvise 440 +#define SYS_epoll_pwait2 441 +#define SYS_mount_setattr 442 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_restrict_self 446 \ No newline at end of file diff --git a/lib/libc/include/x86_64-linux-musl/bits/syscall.h b/lib/libc/include/x86_64-linux-musl/bits/syscall.h index d91f553b77..f9dbc02026 100644 --- a/lib/libc/include/x86_64-linux-musl/bits/syscall.h +++ b/lib/libc/include/x86_64-linux-musl/bits/syscall.h @@ -349,6 +349,12 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define SYS_read 0 #define SYS_write 1 @@ -700,4 +706,10 @@ #define SYS_close_range 436 #define SYS_openat2 437 #define SYS_pidfd_getfd 438 -#define SYS_faccessat2 439 \ No newline at end of file +#define SYS_faccessat2 439 +#define SYS_process_madvise 440 +#define SYS_epoll_pwait2 441 +#define SYS_mount_setattr 442 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_restrict_self 446 \ No newline at end of file diff --git a/lib/libc/musl/COPYRIGHT b/lib/libc/musl/COPYRIGHT index e647237146..c1628e9ac8 100644 --- a/lib/libc/musl/COPYRIGHT +++ b/lib/libc/musl/COPYRIGHT @@ -127,10 +127,13 @@ Copyright © 2017-2018 Arm Limited and labelled as such in comments in the individual source files. All have been licensed under extremely permissive terms. -The ARM memcpy code (src/string/arm/memcpy_el.S) is Copyright © 2008 +The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008 The Android Open Source Project and is licensed under a two-clause BSD license. It was taken from Bionic libc, used on Android. +The AArch64 memcpy and memset code (src/string/aarch64/*) are +Copyright © 1999-2019, Arm Limited. + The implementation of DES for crypt (src/crypt/crypt_des.c) is Copyright © 1994 David Burren. It is licensed under a BSD license. diff --git a/lib/libc/musl/arch/aarch64/bits/hwcap.h b/lib/libc/musl/arch/aarch64/bits/hwcap.h index 7ab73f99b6..424cc4d4fc 100644 --- a/lib/libc/musl/arch/aarch64/bits/hwcap.h +++ b/lib/libc/musl/arch/aarch64/bits/hwcap.h @@ -48,3 +48,5 @@ #define HWCAP2_BF16 (1 << 14) #define HWCAP2_DGH (1 << 15) #define HWCAP2_RNG (1 << 16) +#define HWCAP2_BTI (1 << 17) +#define HWCAP2_MTE (1 << 18) diff --git a/lib/libc/musl/arch/aarch64/bits/mman.h b/lib/libc/musl/arch/aarch64/bits/mman.h new file mode 100644 index 0000000000..8fad5ceb0f --- /dev/null +++ b/lib/libc/musl/arch/aarch64/bits/mman.h @@ -0,0 +1,2 @@ +#define PROT_BTI 0x10 +#define PROT_MTE 0x20 diff --git a/lib/libc/musl/arch/aarch64/bits/syscall.h.in b/lib/libc/musl/arch/aarch64/bits/syscall.h.in index f9457c184a..5f420e6176 100644 --- a/lib/libc/musl/arch/aarch64/bits/syscall.h.in +++ b/lib/libc/musl/arch/aarch64/bits/syscall.h.in @@ -293,4 +293,10 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/lib/libc/musl/arch/arm/bits/syscall.h.in b/lib/libc/musl/arch/arm/bits/syscall.h.in index 7e2fc26697..048fdea797 100644 --- a/lib/libc/musl/arch/arm/bits/syscall.h.in +++ b/lib/libc/musl/arch/arm/bits/syscall.h.in @@ -393,6 +393,12 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define __ARM_NR_breakpoint 0x0f0001 #define __ARM_NR_cacheflush 0x0f0002 diff --git a/lib/libc/musl/arch/i386/arch.mak b/lib/libc/musl/arch/i386/arch.mak new file mode 100644 index 0000000000..aa4d05ceff --- /dev/null +++ b/lib/libc/musl/arch/i386/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/lib/libc/musl/arch/i386/bits/syscall.h.in b/lib/libc/musl/arch/i386/bits/syscall.h.in index abdb210d39..46ffe1d99a 100644 --- a/lib/libc/musl/arch/i386/bits/syscall.h.in +++ b/lib/libc/musl/arch/i386/bits/syscall.h.in @@ -430,4 +430,10 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/lib/libc/musl/arch/m68k/arch.mak b/lib/libc/musl/arch/m68k/arch.mak new file mode 100644 index 0000000000..aa4d05ceff --- /dev/null +++ b/lib/libc/musl/arch/m68k/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/lib/libc/musl/arch/m68k/atomic_arch.h b/lib/libc/musl/arch/m68k/atomic_arch.h new file mode 100644 index 0000000000..b369649a1a --- /dev/null +++ b/lib/libc/musl/arch/m68k/atomic_arch.h @@ -0,0 +1,8 @@ +#define a_cas a_cas +static inline int a_cas(volatile int *p, int t, int s) +{ + __asm__ __volatile__ ( + "cas.l %0, %2, (%1)" + : "+d"(t) : "a"(p), "d"(s) : "memory", "cc"); + return t; +} diff --git a/lib/libc/musl/arch/m68k/bits/alltypes.h.in b/lib/libc/musl/arch/m68k/bits/alltypes.h.in new file mode 100644 index 0000000000..f564690983 --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/alltypes.h.in @@ -0,0 +1,25 @@ +#define _REDIR_TIME64 1 +#define _Addr int +#define _Int64 long long +#define _Reg int + +#define __BYTE_ORDER 4321 +#define __LONG_MAX 0x7fffffffL + +#ifndef __cplusplus +#ifdef __WCHAR_TYPE__ +TYPEDEF __WCHAR_TYPE__ wchar_t; +#else +TYPEDEF long wchar_t; +#endif +#endif + +#if __mcffpu__ +TYPEDEF float float_t; +TYPEDEF double double_t; +#else +TYPEDEF long double float_t; +TYPEDEF long double double_t; +#endif + +TYPEDEF struct { long long __ll; long double __ld; } max_align_t; diff --git a/lib/libc/musl/arch/m68k/bits/fcntl.h b/lib/libc/musl/arch/m68k/bits/fcntl.h new file mode 100644 index 0000000000..f1c8400ffc --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/fcntl.h @@ -0,0 +1,40 @@ +#define O_CREAT 0100 +#define O_EXCL 0200 +#define O_NOCTTY 0400 +#define O_TRUNC 01000 +#define O_APPEND 02000 +#define O_NONBLOCK 04000 +#define O_DSYNC 010000 +#define O_SYNC 04010000 +#define O_RSYNC 04010000 +#define O_DIRECTORY 040000 +#define O_NOFOLLOW 0100000 +#define O_CLOEXEC 02000000 + +#define O_ASYNC 020000 +#define O_DIRECT 0200000 +#define O_LARGEFILE 0400000 +#define O_NOATIME 01000000 +#define O_PATH 010000000 +#define O_TMPFILE 020200000 +#define O_NDELAY O_NONBLOCK + +#define F_DUPFD 0 +#define F_GETFD 1 +#define F_SETFD 2 +#define F_GETFL 3 +#define F_SETFL 4 + +#define F_SETOWN 8 +#define F_GETOWN 9 +#define F_SETSIG 10 +#define F_GETSIG 11 + +#define F_GETLK 12 +#define F_SETLK 13 +#define F_SETLKW 14 + +#define F_SETOWN_EX 15 +#define F_GETOWN_EX 16 + +#define F_GETOWNER_UIDS 17 diff --git a/lib/libc/musl/arch/m68k/bits/fenv.h b/lib/libc/musl/arch/m68k/bits/fenv.h new file mode 100644 index 0000000000..c90a4a58af --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/fenv.h @@ -0,0 +1,29 @@ +#if __HAVE_68881__ || __mcffpu__ + +#define FE_INEXACT 8 +#define FE_DIVBYZERO 16 +#define FE_UNDERFLOW 32 +#define FE_OVERFLOW 64 +#define FE_INVALID 128 + +#define FE_ALL_EXCEPT 0xf8 + +#define FE_TONEAREST 0 +#define FE_TOWARDZERO 16 +#define FE_DOWNWARD 32 +#define FE_UPWARD 48 + +#else + +#define FE_ALL_EXCEPT 0 +#define FE_TONEAREST 0 + +#endif + +typedef unsigned fexcept_t; + +typedef struct { + unsigned __control_register, __status_register, __instruction_address; +} fenv_t; + +#define FE_DFL_ENV ((const fenv_t *) -1) diff --git a/lib/libc/musl/arch/m68k/bits/float.h b/lib/libc/musl/arch/m68k/bits/float.h new file mode 100644 index 0000000000..0e6899d583 --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/float.h @@ -0,0 +1,39 @@ +#if !__mcffpu__ + +#define FLT_EVAL_METHOD 2 + +#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L +#define LDBL_MIN 1.68105157155604675313e-4932L +#define LDBL_MAX 1.1897314953572317650e+4932L +#define LDBL_EPSILON 1.0842021724855044340e-19L + +#define LDBL_MANT_DIG 64 +#define LDBL_MIN_EXP (-16382) +#define LDBL_MAX_EXP 16384 + +#define LDBL_DIG 18 +#define LDBL_MIN_10_EXP (-4931) +#define LDBL_MAX_10_EXP 4932 + +#define DECIMAL_DIG 21 + +#else + +#define FLT_EVAL_METHOD 0 + +#define LDBL_TRUE_MIN 4.94065645841246544177e-324L +#define LDBL_MIN 2.22507385850720138309e-308L +#define LDBL_MAX 1.79769313486231570815e+308L +#define LDBL_EPSILON 2.22044604925031308085e-16L + +#define LDBL_MANT_DIG 53 +#define LDBL_MIN_EXP (-1021) +#define LDBL_MAX_EXP 1024 + +#define LDBL_DIG 15 +#define LDBL_MIN_10_EXP (-307) +#define LDBL_MAX_10_EXP 308 + +#define DECIMAL_DIG 17 + +#endif diff --git a/lib/libc/musl/arch/m68k/bits/ipcstat.h b/lib/libc/musl/arch/m68k/bits/ipcstat.h new file mode 100644 index 0000000000..4f4fcb0c5b --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/ipcstat.h @@ -0,0 +1 @@ +#define IPC_STAT 0x102 diff --git a/lib/libc/musl/arch/m68k/bits/msg.h b/lib/libc/musl/arch/m68k/bits/msg.h new file mode 100644 index 0000000000..7bbbb2bf43 --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/msg.h @@ -0,0 +1,18 @@ +struct msqid_ds { + struct ipc_perm msg_perm; + 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/lib/libc/musl/arch/m68k/bits/posix.h b/lib/libc/musl/arch/m68k/bits/posix.h new file mode 100644 index 0000000000..30a38714f3 --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/posix.h @@ -0,0 +1,2 @@ +#define _POSIX_V6_ILP32_OFFBIG 1 +#define _POSIX_V7_ILP32_OFFBIG 1 diff --git a/lib/libc/musl/arch/m68k/bits/ptrace.h b/lib/libc/musl/arch/m68k/bits/ptrace.h new file mode 100644 index 0000000000..da93e7a729 --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/ptrace.h @@ -0,0 +1,2 @@ +#define PTRACE_GET_THREAD_AREA 25 +#define PTRACE_SINGLEBLOCK 33 diff --git a/lib/libc/musl/arch/m68k/bits/reg.h b/lib/libc/musl/arch/m68k/bits/reg.h new file mode 100644 index 0000000000..99201f7094 --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/reg.h @@ -0,0 +1,45 @@ +#undef __WORDSIZE +#define __WORDSIZE 32 +#define PT_D1 0 +#define PT_D2 1 +#define PT_D3 2 +#define PT_D4 3 +#define PT_D5 4 +#define PT_D6 5 +#define PT_D7 6 +#define PT_A0 7 +#define PT_A1 8 +#define PT_A2 9 +#define PT_A3 10 +#define PT_A4 11 +#define PT_A5 12 +#define PT_A6 13 +#define PT_D0 14 +#define PT_USP 15 +#define PT_ORIG_D0 16 +#define PT_SR 17 +#define PT_PC 18 + +#if __mcffpu__ +#define PT_FP0 21 +#define PT_FP1 23 +#define PT_FP2 25 +#define PT_FP3 27 +#define PT_FP4 29 +#define PT_FP5 31 +#define PT_FP6 33 +#define PT_FP7 35 +#else +#define PT_FP0 21 +#define PT_FP1 24 +#define PT_FP2 27 +#define PT_FP3 30 +#define PT_FP4 33 +#define PT_FP5 36 +#define PT_FP6 39 +#define PT_FP7 42 +#endif + +#define PT_FPCR 45 +#define PT_FPSR 46 +#define PT_FPIAR 47 diff --git a/lib/libc/musl/arch/m68k/bits/sem.h b/lib/libc/musl/arch/m68k/bits/sem.h new file mode 100644 index 0000000000..d88338e695 --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/sem.h @@ -0,0 +1,13 @@ +struct semid_ds { + struct ipc_perm sem_perm; + 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/lib/libc/musl/arch/m68k/bits/setjmp.h b/lib/libc/musl/arch/m68k/bits/setjmp.h new file mode 100644 index 0000000000..5e091fb49b --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/setjmp.h @@ -0,0 +1 @@ +typedef unsigned long __jmp_buf[39]; diff --git a/lib/libc/musl/arch/m68k/bits/shm.h b/lib/libc/musl/arch/m68k/bits/shm.h new file mode 100644 index 0000000000..725fb46968 --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/shm.h @@ -0,0 +1,31 @@ +#define SHMLBA 4096 + +struct shmid_ds { + struct ipc_perm shm_perm; + size_t shm_segsz; + 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 { + unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4]; +}; + +struct shm_info { + int __used_ids; + unsigned long shm_tot, shm_rss, shm_swp; + unsigned long __swap_attempts, __swap_successes; +}; diff --git a/lib/libc/musl/arch/m68k/bits/signal.h b/lib/libc/musl/arch/m68k/bits/signal.h new file mode 100644 index 0000000000..2c369ca35c --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/signal.h @@ -0,0 +1,140 @@ +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define MINSIGSTKSZ 2048 +#define SIGSTKSZ 8192 +#endif + +#ifdef _GNU_SOURCE +enum { R_D0 = 0 }; +#define R_D0 R_D0 +enum { R_D1 = 1 }; +#define R_D1 R_D1 +enum { R_D2 = 2 }; +#define R_D2 R_D2 +enum { R_D3 = 3 }; +#define R_D3 R_D3 +enum { R_D4 = 4 }; +#define R_D4 R_D4 +enum { R_D5 = 5 }; +#define R_D5 R_D5 +enum { R_D6 = 6 }; +#define R_D6 R_D6 +enum { R_D7 = 7 }; +#define R_D7 R_D7 +enum { R_A0 = 8 }; +#define R_A0 R_A0 +enum { R_A1 = 9 }; +#define R_A1 R_A1 +enum { R_A2 = 10 }; +#define R_A2 R_A2 +enum { R_A3 = 11 }; +#define R_A3 R_A3 +enum { R_A4 = 12 }; +#define R_A4 R_A4 +enum { R_A5 = 13 }; +#define R_A5 R_A5 +enum { R_A6 = 14 }; +#define R_A6 R_A6 +enum { R_A7 = 15 }; +#define R_A7 R_A7 +enum { R_SP = 15 }; +#define R_SP R_SP +enum { R_PC = 16 }; +#define R_PC R_PC +enum { R_PS = 17 }; +#define R_PS R_PS +#endif + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + +struct sigcontext { + unsigned long sc_mask, sc_usp, sc_d0, sc_d1, sc_a0, sc_a1; + unsigned short sc_sr; + unsigned long sc_pc; + unsigned short sc_formatvec; + unsigned long sc_fpregs[6], sc_fpcntl[3]; + unsigned char sc_fpstate[216]; +}; + +typedef int greg_t, gregset_t[18]; +typedef struct { + int f_pcr, f_psr, f_fpiaddr, f_fpregs[8][3]; +} fpregset_t; + +typedef struct { + int version; + gregset_t gregs; + fpregset_t fpregs; +} mcontext_t; +#else +typedef struct { + int __version; + int __gregs[18]; + int __fpregs[27]; +} mcontext_t; +#endif + +struct sigaltstack { + void *ss_sp; + int ss_flags; + size_t ss_size; +}; + +typedef struct __ucontext { + unsigned long uc_flags; + struct __ucontext *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + long __reserved[80]; + sigset_t uc_sigmask; +} ucontext_t; + +#define SA_NOCLDSTOP 1 +#define SA_NOCLDWAIT 2 +#define SA_SIGINFO 4 +#define SA_ONSTACK 0x08000000 +#define SA_RESTART 0x10000000 +#define SA_NODEFER 0x40000000 +#define SA_RESETHAND 0x80000000 +#define SA_RESTORER 0x04000000 + +#endif + +#define SIGHUP 1 +#define SIGINT 2 +#define SIGQUIT 3 +#define SIGILL 4 +#define SIGTRAP 5 +#define SIGABRT 6 +#define SIGIOT SIGABRT +#define SIGBUS 7 +#define SIGFPE 8 +#define SIGKILL 9 +#define SIGUSR1 10 +#define SIGSEGV 11 +#define SIGUSR2 12 +#define SIGPIPE 13 +#define SIGALRM 14 +#define SIGTERM 15 +#define SIGSTKFLT 16 +#define SIGCHLD 17 +#define SIGCONT 18 +#define SIGSTOP 19 +#define SIGTSTP 20 +#define SIGTTIN 21 +#define SIGTTOU 22 +#define SIGURG 23 +#define SIGXCPU 24 +#define SIGXFSZ 25 +#define SIGVTALRM 26 +#define SIGPROF 27 +#define SIGWINCH 28 +#define SIGIO 29 +#define SIGPOLL 29 +#define SIGPWR 30 +#define SIGSYS 31 +#define SIGUNUSED SIGSYS + +#define _NSIG 65 diff --git a/lib/libc/musl/arch/m68k/bits/stat.h b/lib/libc/musl/arch/m68k/bits/stat.h new file mode 100644 index 0000000000..f87681471a --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/stat.h @@ -0,0 +1,25 @@ +/* copied from kernel definition, but with padding replaced + * by the corresponding correctly-sized userspace types. */ + +struct stat { + dev_t st_dev; + short __st_dev_padding; + long __st_ino_truncated; + mode_t st_mode; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + short __st_rdev_padding; + 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; +}; diff --git a/lib/libc/musl/arch/m68k/bits/stdint.h b/lib/libc/musl/arch/m68k/bits/stdint.h new file mode 100644 index 0000000000..d1b2712199 --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/stdint.h @@ -0,0 +1,20 @@ +typedef int32_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef uint32_t uint_fast16_t; +typedef uint32_t uint_fast32_t; + +#define INT_FAST16_MIN INT32_MIN +#define INT_FAST32_MIN INT32_MIN + +#define INT_FAST16_MAX INT32_MAX +#define INT_FAST32_MAX INT32_MAX + +#define UINT_FAST16_MAX UINT32_MAX +#define UINT_FAST32_MAX UINT32_MAX + +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX +#define SIZE_MAX UINT32_MAX diff --git a/lib/libc/musl/arch/m68k/bits/syscall.h.in b/lib/libc/musl/arch/m68k/bits/syscall.h.in new file mode 100644 index 0000000000..a0c6332330 --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/syscall.h.in @@ -0,0 +1,418 @@ +#define __NR_restart_syscall 0 +#define __NR_exit 1 +#define __NR_fork 2 +#define __NR_read 3 +#define __NR_write 4 +#define __NR_open 5 +#define __NR_close 6 +#define __NR_waitpid 7 +#define __NR_creat 8 +#define __NR_link 9 +#define __NR_unlink 10 +#define __NR_execve 11 +#define __NR_chdir 12 +#define __NR_time 13 +#define __NR_mknod 14 +#define __NR_chmod 15 +#define __NR_chown 16 +#define __NR_oldstat 18 +#define __NR_lseek 19 +#define __NR_getpid 20 +#define __NR_mount 21 +#define __NR_umount 22 +#define __NR_setuid 23 +#define __NR_getuid 24 +#define __NR_stime 25 +#define __NR_ptrace 26 +#define __NR_alarm 27 +#define __NR_oldfstat 28 +#define __NR_pause 29 +#define __NR_utime 30 +#define __NR_access 33 +#define __NR_nice 34 +#define __NR_sync 36 +#define __NR_kill 37 +#define __NR_rename 38 +#define __NR_mkdir 39 +#define __NR_rmdir 40 +#define __NR_dup 41 +#define __NR_pipe 42 +#define __NR_times 43 +#define __NR_brk 45 +#define __NR_setgid 46 +#define __NR_getgid 47 +#define __NR_signal 48 +#define __NR_geteuid 49 +#define __NR_getegid 50 +#define __NR_acct 51 +#define __NR_umount2 52 +#define __NR_ioctl 54 +#define __NR_fcntl 55 +#define __NR_setpgid 57 +#define __NR_umask 60 +#define __NR_chroot 61 +#define __NR_ustat 62 +#define __NR_dup2 63 +#define __NR_getppid 64 +#define __NR_getpgrp 65 +#define __NR_setsid 66 +#define __NR_sigaction 67 +#define __NR_sgetmask 68 +#define __NR_ssetmask 69 +#define __NR_setreuid 70 +#define __NR_setregid 71 +#define __NR_sigsuspend 72 +#define __NR_sigpending 73 +#define __NR_sethostname 74 +#define __NR_setrlimit 75 +#define __NR_getrlimit 76 +#define __NR_getrusage 77 +#define __NR_gettimeofday_time32 78 +#define __NR_settimeofday_time32 79 +#define __NR_getgroups 80 +#define __NR_setgroups 81 +#define __NR_select 82 +#define __NR_symlink 83 +#define __NR_oldlstat 84 +#define __NR_readlink 85 +#define __NR_uselib 86 +#define __NR_swapon 87 +#define __NR_reboot 88 +#define __NR_readdir 89 +#define __NR_mmap 90 +#define __NR_munmap 91 +#define __NR_truncate 92 +#define __NR_ftruncate 93 +#define __NR_fchmod 94 +#define __NR_fchown 95 +#define __NR_getpriority 96 +#define __NR_setpriority 97 +#define __NR_statfs 99 +#define __NR_fstatfs 100 +#define __NR_socketcall 102 +#define __NR_syslog 103 +#define __NR_setitimer 104 +#define __NR_getitimer 105 +#define __NR_stat 106 +#define __NR_lstat 107 +#define __NR_fstat 108 +#define __NR_vhangup 111 +#define __NR_wait4 114 +#define __NR_swapoff 115 +#define __NR_sysinfo 116 +#define __NR_ipc 117 +#define __NR_fsync 118 +#define __NR_sigreturn 119 +#define __NR_clone 120 +#define __NR_setdomainname 121 +#define __NR_uname 122 +#define __NR_cacheflush 123 +#define __NR_adjtimex 124 +#define __NR_mprotect 125 +#define __NR_sigprocmask 126 +#define __NR_create_module 127 +#define __NR_init_module 128 +#define __NR_delete_module 129 +#define __NR_get_kernel_syms 130 +#define __NR_quotactl 131 +#define __NR_getpgid 132 +#define __NR_fchdir 133 +#define __NR_bdflush 134 +#define __NR_sysfs 135 +#define __NR_personality 136 +#define __NR_setfsuid 138 +#define __NR_setfsgid 139 +#define __NR__llseek 140 +#define __NR_getdents 141 +#define __NR__newselect 142 +#define __NR_flock 143 +#define __NR_msync 144 +#define __NR_readv 145 +#define __NR_writev 146 +#define __NR_getsid 147 +#define __NR_fdatasync 148 +#define __NR__sysctl 149 +#define __NR_mlock 150 +#define __NR_munlock 151 +#define __NR_mlockall 152 +#define __NR_munlockall 153 +#define __NR_sched_setparam 154 +#define __NR_sched_getparam 155 +#define __NR_sched_setscheduler 156 +#define __NR_sched_getscheduler 157 +#define __NR_sched_yield 158 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_rr_get_interval 161 +#define __NR_nanosleep 162 +#define __NR_mremap 163 +#define __NR_setresuid 164 +#define __NR_getresuid 165 +#define __NR_getpagesize 166 +#define __NR_query_module 167 +#define __NR_poll 168 +#define __NR_nfsservctl 169 +#define __NR_setresgid 170 +#define __NR_getresgid 171 +#define __NR_prctl 172 +#define __NR_rt_sigreturn 173 +#define __NR_rt_sigaction 174 +#define __NR_rt_sigprocmask 175 +#define __NR_rt_sigpending 176 +#define __NR_rt_sigtimedwait 177 +#define __NR_rt_sigqueueinfo 178 +#define __NR_rt_sigsuspend 179 +#define __NR_pread64 180 +#define __NR_pwrite64 181 +#define __NR_lchown 182 +#define __NR_getcwd 183 +#define __NR_capget 184 +#define __NR_capset 185 +#define __NR_sigaltstack 186 +#define __NR_sendfile 187 +#define __NR_getpmsg 188 +#define __NR_putpmsg 189 +#define __NR_vfork 190 +#define __NR_ugetrlimit 191 +#define __NR_mmap2 192 +#define __NR_truncate64 193 +#define __NR_ftruncate64 194 +#define __NR_stat64 195 +#define __NR_lstat64 196 +#define __NR_fstat64 197 +#define __NR_chown32 198 +#define __NR_getuid32 199 +#define __NR_getgid32 200 +#define __NR_geteuid32 201 +#define __NR_getegid32 202 +#define __NR_setreuid32 203 +#define __NR_setregid32 204 +#define __NR_getgroups32 205 +#define __NR_setgroups32 206 +#define __NR_fchown32 207 +#define __NR_setresuid32 208 +#define __NR_getresuid32 209 +#define __NR_setresgid32 210 +#define __NR_getresgid32 211 +#define __NR_lchown32 212 +#define __NR_setuid32 213 +#define __NR_setgid32 214 +#define __NR_setfsuid32 215 +#define __NR_setfsgid32 216 +#define __NR_pivot_root 217 +#define __NR_getdents64 220 +#define __NR_gettid 221 +#define __NR_tkill 222 +#define __NR_setxattr 223 +#define __NR_lsetxattr 224 +#define __NR_fsetxattr 225 +#define __NR_getxattr 226 +#define __NR_lgetxattr 227 +#define __NR_fgetxattr 228 +#define __NR_listxattr 229 +#define __NR_llistxattr 230 +#define __NR_flistxattr 231 +#define __NR_removexattr 232 +#define __NR_lremovexattr 233 +#define __NR_fremovexattr 234 +#define __NR_futex 235 +#define __NR_sendfile64 236 +#define __NR_mincore 237 +#define __NR_madvise 238 +#define __NR_fcntl64 239 +#define __NR_readahead 240 +#define __NR_io_setup 241 +#define __NR_io_destroy 242 +#define __NR_io_getevents 243 +#define __NR_io_submit 244 +#define __NR_io_cancel 245 +#define __NR_fadvise64 246 +#define __NR_exit_group 247 +#define __NR_lookup_dcookie 248 +#define __NR_epoll_create 249 +#define __NR_epoll_ctl 250 +#define __NR_epoll_wait 251 +#define __NR_remap_file_pages 252 +#define __NR_set_tid_address 253 +#define __NR_timer_create 254 +#define __NR_timer_settime32 255 +#define __NR_timer_gettime32 256 +#define __NR_timer_getoverrun 257 +#define __NR_timer_delete 258 +#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 +#define __NR_utimes 266 +#define __NR_fadvise64_64 267 +#define __NR_mbind 268 +#define __NR_get_mempolicy 269 +#define __NR_set_mempolicy 270 +#define __NR_mq_open 271 +#define __NR_mq_unlink 272 +#define __NR_mq_timedsend 273 +#define __NR_mq_timedreceive 274 +#define __NR_mq_notify 275 +#define __NR_mq_getsetattr 276 +#define __NR_waitid 277 +#define __NR_add_key 279 +#define __NR_request_key 280 +#define __NR_keyctl 281 +#define __NR_ioprio_set 282 +#define __NR_ioprio_get 283 +#define __NR_inotify_init 284 +#define __NR_inotify_add_watch 285 +#define __NR_inotify_rm_watch 286 +#define __NR_migrate_pages 287 +#define __NR_openat 288 +#define __NR_mkdirat 289 +#define __NR_mknodat 290 +#define __NR_fchownat 291 +#define __NR_futimesat 292 +#define __NR_fstatat64 293 +#define __NR_unlinkat 294 +#define __NR_renameat 295 +#define __NR_linkat 296 +#define __NR_symlinkat 297 +#define __NR_readlinkat 298 +#define __NR_fchmodat 299 +#define __NR_faccessat 300 +#define __NR_pselect6 301 +#define __NR_ppoll 302 +#define __NR_unshare 303 +#define __NR_set_robust_list 304 +#define __NR_get_robust_list 305 +#define __NR_splice 306 +#define __NR_sync_file_range 307 +#define __NR_tee 308 +#define __NR_vmsplice 309 +#define __NR_move_pages 310 +#define __NR_sched_setaffinity 311 +#define __NR_sched_getaffinity 312 +#define __NR_kexec_load 313 +#define __NR_getcpu 314 +#define __NR_epoll_pwait 315 +#define __NR_utimensat 316 +#define __NR_signalfd 317 +#define __NR_timerfd_create 318 +#define __NR_eventfd 319 +#define __NR_fallocate 320 +#define __NR_timerfd_settime32 321 +#define __NR_timerfd_gettime32 322 +#define __NR_signalfd4 323 +#define __NR_eventfd2 324 +#define __NR_epoll_create1 325 +#define __NR_dup3 326 +#define __NR_pipe2 327 +#define __NR_inotify_init1 328 +#define __NR_preadv 329 +#define __NR_pwritev 330 +#define __NR_rt_tgsigqueueinfo 331 +#define __NR_perf_event_open 332 +#define __NR_get_thread_area 333 +#define __NR_set_thread_area 334 +#define __NR_atomic_cmpxchg_32 335 +#define __NR_atomic_barrier 336 +#define __NR_fanotify_init 337 +#define __NR_fanotify_mark 338 +#define __NR_prlimit64 339 +#define __NR_name_to_handle_at 340 +#define __NR_open_by_handle_at 341 +#define __NR_clock_adjtime 342 +#define __NR_syncfs 343 +#define __NR_setns 344 +#define __NR_process_vm_readv 345 +#define __NR_process_vm_writev 346 +#define __NR_kcmp 347 +#define __NR_finit_module 348 +#define __NR_sched_setattr 349 +#define __NR_sched_getattr 350 +#define __NR_renameat2 351 +#define __NR_getrandom 352 +#define __NR_memfd_create 353 +#define __NR_bpf 354 +#define __NR_execveat 355 +#define __NR_socket 356 +#define __NR_socketpair 357 +#define __NR_bind 358 +#define __NR_connect 359 +#define __NR_listen 360 +#define __NR_accept4 361 +#define __NR_getsockopt 362 +#define __NR_setsockopt 363 +#define __NR_getsockname 364 +#define __NR_getpeername 365 +#define __NR_sendto 366 +#define __NR_sendmsg 367 +#define __NR_recvfrom 368 +#define __NR_recvmsg 369 +#define __NR_shutdown 370 +#define __NR_recvmmsg 371 +#define __NR_sendmmsg 372 +#define __NR_userfaultfd 373 +#define __NR_membarrier 374 +#define __NR_mlock2 375 +#define __NR_copy_file_range 376 +#define __NR_preadv2 377 +#define __NR_pwritev2 378 +#define __NR_statx 379 +#define __NR_seccomp 380 +#define __NR_pkey_mprotect 381 +#define __NR_pkey_alloc 382 +#define __NR_pkey_free 383 +#define __NR_rseq 384 +#define __NR_semget 393 +#define __NR_semctl 394 +#define __NR_shmget 395 +#define __NR_shmctl 396 +#define __NR_shmat 397 +#define __NR_shmdt 398 +#define __NR_msgget 399 +#define __NR_msgsnd 400 +#define __NR_msgrcv 401 +#define __NR_msgctl 402 +#define __NR_clock_gettime64 403 +#define __NR_clock_settime64 404 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres_time64 406 +#define __NR_clock_nanosleep_time64 407 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime64 409 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime64 411 +#define __NR_utimensat_time64 412 +#define __NR_pselect6_time64 413 +#define __NR_ppoll_time64 414 +#define __NR_io_pgetevents_time64 416 +#define __NR_recvmmsg_time64 417 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_timedreceive_time64 419 +#define __NR_semtimedop_time64 420 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_futex_time64 422 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_pidfd_send_signal 424 +#define __NR_io_uring_setup 425 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_open_tree 428 +#define __NR_move_mount 429 +#define __NR_fsopen 430 +#define __NR_fsconfig 431 +#define __NR_fsmount 432 +#define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 +#define __NR_close_range 436 +#define __NR_openat2 437 +#define __NR_pidfd_getfd 438 +#define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/lib/libc/musl/arch/m68k/bits/user.h b/lib/libc/musl/arch/m68k/bits/user.h new file mode 100644 index 0000000000..6a4439196b --- /dev/null +++ b/lib/libc/musl/arch/m68k/bits/user.h @@ -0,0 +1,38 @@ +#undef __WORDSIZE +#define __WORDSIZE 32 + +struct user_m68kfp_struct { + unsigned long fpregs[24], fpcntl[3]; +}; + +struct user_regs_struct { + long d1, d2, d3, d4, d5, d6, d7; + long a0, a1, a2, a3, a4, a5, a6; + long d0, usp, orig_d0; + short stkadj, sr; + long pc; + short fmtvec, __pad; +}; + +struct user { + struct user_regs_struct regs; + int u_fpvalid; + struct user_m68kfp_struct m68kfp; + unsigned long u_tsize, u_dsize, u_ssize, start_code, start_stack; + long signal; + int reserved; + unsigned long u_ar0; + struct user_m68kfp_struct *u_fpstate; + unsigned long magic; + 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) +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) diff --git a/lib/libc/musl/arch/m68k/crt_arch.h b/lib/libc/musl/arch/m68k/crt_arch.h new file mode 100644 index 0000000000..48a42f29e2 --- /dev/null +++ b/lib/libc/musl/arch/m68k/crt_arch.h @@ -0,0 +1,14 @@ +__asm__( +".text\n" +".weak _DYNAMIC \n" +".hidden _DYNAMIC \n" +".global " START "\n" +START ":\n" +" suba.l %fp,%fp \n" +" movea.l %sp,%a0 \n" +" lea _DYNAMIC-.-8,%a1 \n" +" pea (%pc,%a1) \n" +" pea (%a0) \n" +" lea " START "_c-.-8,%a1 \n" +" jsr (%pc,%a1) \n" +); diff --git a/lib/libc/musl/arch/m68k/kstat.h b/lib/libc/musl/arch/m68k/kstat.h new file mode 100644 index 0000000000..ac13e272ce --- /dev/null +++ b/lib/libc/musl/arch/m68k/kstat.h @@ -0,0 +1,21 @@ +struct kstat { + dev_t st_dev; + short __st_dev_padding; + long __st_ino_truncated; + mode_t st_mode; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + short __st_rdev_padding; + off_t st_size; + blksize_t st_blksize; + blkcnt_t st_blocks; + long st_atime_sec; + long st_atime_nsec; + long st_mtime_sec; + long st_mtime_nsec; + long st_ctime_sec; + long st_ctime_nsec; + ino_t st_ino; +}; diff --git a/lib/libc/musl/arch/m68k/pthread_arch.h b/lib/libc/musl/arch/m68k/pthread_arch.h new file mode 100644 index 0000000000..5bea4e1adc --- /dev/null +++ b/lib/libc/musl/arch/m68k/pthread_arch.h @@ -0,0 +1,12 @@ +static inline uintptr_t __get_tp() +{ + return __syscall(SYS_get_thread_area); +} + +#define TLS_ABOVE_TP +#define GAP_ABOVE_TP 0 + +#define TP_OFFSET 0x7000 +#define DTP_OFFSET 0x8000 + +#define MC_PC gregs[R_PC] diff --git a/lib/libc/musl/arch/m68k/reloc.h b/lib/libc/musl/arch/m68k/reloc.h new file mode 100644 index 0000000000..f920b39e03 --- /dev/null +++ b/lib/libc/musl/arch/m68k/reloc.h @@ -0,0 +1,30 @@ +#if __HAVE_68881__ +#define FP_SUFFIX "" +#elif __mcffpu__ +#define FP_SUFFIX "-fp64" +#else +#define FP_SUFFIX "-sf" +#endif + +#define LDSO_ARCH "m68k" FP_SUFFIX + +#define TPOFF_K (-0x7000) + +#define REL_SYMBOLIC R_68K_32 +#define REL_OFFSET R_68K_PC32 +#define REL_GOT R_68K_GLOB_DAT +#define REL_PLT R_68K_JMP_SLOT +#define REL_RELATIVE R_68K_RELATIVE +#define REL_COPY R_68K_COPY +#define REL_DTPMOD R_68K_TLS_DTPMOD32 +#define REL_DTPOFF R_68K_TLS_DTPREL32 +#define REL_TPOFF R_68K_TLS_TPREL32 + +#define CRTJMP(pc,sp) __asm__ __volatile__( \ + "move.l %1,%%sp ; jmp (%0)" : : "r"(pc), "r"(sp) : "memory" ) + +#define GETFUNCSYM(fp, sym, got) __asm__ ( \ + ".hidden " #sym "\n" \ + "lea " #sym "-.-8,%0 \n" \ + "lea (%%pc,%0),%0 \n" \ + : "=a"(*fp) : : "memory" ) diff --git a/lib/libc/musl/arch/m68k/syscall_arch.h b/lib/libc/musl/arch/m68k/syscall_arch.h new file mode 100644 index 0000000000..6a9d0ae8e4 --- /dev/null +++ b/lib/libc/musl/arch/m68k/syscall_arch.h @@ -0,0 +1,90 @@ +#define __SYSCALL_LL_E(x) \ +((union { long long ll; long l[2]; }){ .ll = x }).l[0], \ +((union { long long ll; long l[2]; }){ .ll = x }).l[1] +#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x)) + +static __inline long __syscall0(long n) +{ + register unsigned long d0 __asm__("d0") = n; + __asm__ __volatile__ ("trap #0" : "+r"(d0) + : + : "memory"); + return d0; +} + +static inline long __syscall1(long n, long a) +{ + register unsigned long d0 __asm__("d0") = n; + register unsigned long d1 __asm__("d1") = a; + __asm__ __volatile__ ("trap #0" : "+r"(d0) + : "r"(d1) + : "memory"); + return d0; +} + +static inline long __syscall2(long n, long a, long b) +{ + register unsigned long d0 __asm__("d0") = n; + register unsigned long d1 __asm__("d1") = a; + register unsigned long d2 __asm__("d2") = b; + __asm__ __volatile__ ("trap #0" : "+r"(d0) + : "r"(d1), "r"(d2) + : "memory"); + return d0; +} + +static inline long __syscall3(long n, long a, long b, long c) +{ + register unsigned long d0 __asm__("d0") = n; + register unsigned long d1 __asm__("d1") = a; + register unsigned long d2 __asm__("d2") = b; + register unsigned long d3 __asm__("d3") = c; + __asm__ __volatile__ ("trap #0" : "+r"(d0) + : "r"(d1), "r"(d2), "r"(d3) + : "memory"); + return d0; +} + +static inline long __syscall4(long n, long a, long b, long c, long d) +{ + register unsigned long d0 __asm__("d0") = n; + register unsigned long d1 __asm__("d1") = a; + register unsigned long d2 __asm__("d2") = b; + register unsigned long d3 __asm__("d3") = c; + register unsigned long d4 __asm__("d4") = d; + __asm__ __volatile__ ("trap #0" : "+r"(d0) + : "r"(d1), "r"(d2), "r"(d3), "r"(d4) + : "memory"); + return d0; +} + +static inline long __syscall5(long n, long a, long b, long c, long d, long e) +{ + register unsigned long d0 __asm__("d0") = n; + register unsigned long d1 __asm__("d1") = a; + register unsigned long d2 __asm__("d2") = b; + register unsigned long d3 __asm__("d3") = c; + register unsigned long d4 __asm__("d4") = d; + register unsigned long d5 __asm__("d5") = e; + __asm__ __volatile__ ("trap #0" : "+r"(d0) + : "r"(d1), "r"(d2), "r"(d3), "r"(d4), "r"(d5) + : "memory"); + return d0; +} + +static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f) +{ + register unsigned long d0 __asm__("d0") = n; + register unsigned long d1 __asm__("d1") = a; + register unsigned long d2 __asm__("d2") = b; + register unsigned long d3 __asm__("d3") = c; + register unsigned long d4 __asm__("d4") = d; + register unsigned long d5 __asm__("d5") = e; + register unsigned long a0 __asm__("a0") = f; + __asm__ __volatile__ ("trap #0" : "+r"(d0) + : "r"(d1), "r"(d2), "r"(d3), "r"(d4), "r"(d5), "r"(a0) + : "memory"); + return d0; +} + +#define SYSCALL_IPC_BROKEN_MODE diff --git a/lib/libc/musl/arch/mips/arch.mak b/lib/libc/musl/arch/mips/arch.mak new file mode 100644 index 0000000000..aa4d05ceff --- /dev/null +++ b/lib/libc/musl/arch/mips/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/lib/libc/musl/arch/mips/bits/syscall.h.in b/lib/libc/musl/arch/mips/bits/syscall.h.in index 2bb03f067a..63e3503a6b 100644 --- a/lib/libc/musl/arch/mips/bits/syscall.h.in +++ b/lib/libc/musl/arch/mips/bits/syscall.h.in @@ -412,4 +412,10 @@ #define __NR_openat2 4437 #define __NR_pidfd_getfd 4438 #define __NR_faccessat2 4439 +#define __NR_process_madvise 4440 +#define __NR_epoll_pwait2 4441 +#define __NR_mount_setattr 4442 +#define __NR_landlock_create_ruleset 4444 +#define __NR_landlock_add_rule 4445 +#define __NR_landlock_restrict_self 4446 diff --git a/lib/libc/musl/arch/mips/pthread_arch.h b/lib/libc/musl/arch/mips/pthread_arch.h index c45347ab92..376b77415a 100644 --- a/lib/libc/musl/arch/mips/pthread_arch.h +++ b/lib/libc/musl/arch/mips/pthread_arch.h @@ -1,10 +1,9 @@ static inline uintptr_t __get_tp() { -#if __mips_isa_rev < 2 register uintptr_t tp __asm__("$3"); +#if __mips_isa_rev < 2 __asm__ (".word 0x7c03e83b" : "=r" (tp) ); #else - uintptr_t tp; __asm__ ("rdhwr %0, $29" : "=r" (tp) ); #endif return tp; diff --git a/lib/libc/musl/arch/mips64/bits/syscall.h.in b/lib/libc/musl/arch/mips64/bits/syscall.h.in index 045e8238ad..b89965d11a 100644 --- a/lib/libc/musl/arch/mips64/bits/syscall.h.in +++ b/lib/libc/musl/arch/mips64/bits/syscall.h.in @@ -342,4 +342,10 @@ #define __NR_openat2 5437 #define __NR_pidfd_getfd 5438 #define __NR_faccessat2 5439 +#define __NR_process_madvise 5440 +#define __NR_epoll_pwait2 5441 +#define __NR_mount_setattr 5442 +#define __NR_landlock_create_ruleset 5444 +#define __NR_landlock_add_rule 5445 +#define __NR_landlock_restrict_self 5446 diff --git a/lib/libc/musl/arch/powerpc/arch.mak b/lib/libc/musl/arch/powerpc/arch.mak new file mode 100644 index 0000000000..aa4d05ceff --- /dev/null +++ b/lib/libc/musl/arch/powerpc/arch.mak @@ -0,0 +1 @@ +COMPAT_SRC_DIRS = compat/time32 diff --git a/lib/libc/musl/arch/powerpc/bits/fenv.h b/lib/libc/musl/arch/powerpc/bits/fenv.h index c5a3e5c5c7..5b15c69a3a 100644 --- a/lib/libc/musl/arch/powerpc/bits/fenv.h +++ b/lib/libc/musl/arch/powerpc/bits/fenv.h @@ -1,4 +1,4 @@ -#ifdef _SOFT_FLOAT +#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) #define FE_ALL_EXCEPT 0 #define FE_TONEAREST 0 #else diff --git a/lib/libc/musl/arch/powerpc/bits/shm.h b/lib/libc/musl/arch/powerpc/bits/shm.h index fb1d4020f6..7f1ca17ebf 100644 --- a/lib/libc/musl/arch/powerpc/bits/shm.h +++ b/lib/libc/musl/arch/powerpc/bits/shm.h @@ -8,11 +8,11 @@ struct shmid_ds { unsigned long __shm_dtime_lo; unsigned long __shm_ctime_hi; unsigned long __shm_ctime_lo; + unsigned long __pad1; 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; diff --git a/lib/libc/musl/arch/powerpc/bits/syscall.h.in b/lib/libc/musl/arch/powerpc/bits/syscall.h.in index 5c6fae3e58..b1605a58f1 100644 --- a/lib/libc/musl/arch/powerpc/bits/syscall.h.in +++ b/lib/libc/musl/arch/powerpc/bits/syscall.h.in @@ -419,4 +419,10 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/lib/libc/musl/arch/powerpc/reloc.h b/lib/libc/musl/arch/powerpc/reloc.h index 527b6b7cdc..fdfbf827e8 100644 --- a/lib/libc/musl/arch/powerpc/reloc.h +++ b/lib/libc/musl/arch/powerpc/reloc.h @@ -1,4 +1,4 @@ -#ifdef _SOFT_FLOAT +#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) #define FP_SUFFIX "-sf" #else #define FP_SUFFIX "" diff --git a/lib/libc/musl/arch/powerpc64/bits/syscall.h.in b/lib/libc/musl/arch/powerpc64/bits/syscall.h.in index edf73d3d6b..b3a8fba092 100644 --- a/lib/libc/musl/arch/powerpc64/bits/syscall.h.in +++ b/lib/libc/musl/arch/powerpc64/bits/syscall.h.in @@ -391,4 +391,10 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/lib/libc/musl/arch/riscv64/bits/syscall.h.in b/lib/libc/musl/arch/riscv64/bits/syscall.h.in index 5def016b12..b534afe81c 100644 --- a/lib/libc/musl/arch/riscv64/bits/syscall.h.in +++ b/lib/libc/musl/arch/riscv64/bits/syscall.h.in @@ -76,7 +76,7 @@ #define __NR_splice 76 #define __NR_tee 77 #define __NR_readlinkat 78 -#define __NR_fstatat 79 +#define __NR_newfstatat 79 #define __NR_fstat 80 #define __NR_sync 81 #define __NR_fsync 82 @@ -293,6 +293,12 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define __NR_sysriscv __NR_arch_specific_syscall #define __NR_riscv_flush_icache (__NR_sysriscv + 15) diff --git a/lib/libc/musl/arch/riscv64/bits/user.h b/lib/libc/musl/arch/riscv64/bits/user.h index 2da743eaf8..0d37de0b04 100644 --- a/lib/libc/musl/arch/riscv64/bits/user.h +++ b/lib/libc/musl/arch/riscv64/bits/user.h @@ -1,5 +1,6 @@ #include #define ELF_NGREG 32 +#define ELF_NFPREG 33 typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; typedef union __riscv_mc_fp_state elf_fpregset_t; diff --git a/lib/libc/musl/arch/s390x/bits/ptrace.h b/lib/libc/musl/arch/s390x/bits/ptrace.h index d50e326211..a06cb0778f 100644 --- a/lib/libc/musl/arch/s390x/bits/ptrace.h +++ b/lib/libc/musl/arch/s390x/bits/ptrace.h @@ -1,4 +1,7 @@ #define PTRACE_SINGLEBLOCK 12 +#define PTRACE_OLDSETOPTIONS 21 +#define PTRACE_SYSEMU 31 +#define PTRACE_SYSEMU_SINGLESTEP 32 #define PTRACE_PEEKUSR_AREA 0x5000 #define PTRACE_POKEUSR_AREA 0x5001 #define PTRACE_GET_LAST_BREAK 0x5006 diff --git a/lib/libc/musl/arch/s390x/bits/syscall.h.in b/lib/libc/musl/arch/s390x/bits/syscall.h.in index fb2e60e30b..dfc384792a 100644 --- a/lib/libc/musl/arch/s390x/bits/syscall.h.in +++ b/lib/libc/musl/arch/s390x/bits/syscall.h.in @@ -356,4 +356,10 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/lib/libc/musl/arch/x86_64/bits/syscall.h.in b/lib/libc/musl/arch/x86_64/bits/syscall.h.in index a611795104..c3882de7e7 100644 --- a/lib/libc/musl/arch/x86_64/bits/syscall.h.in +++ b/lib/libc/musl/arch/x86_64/bits/syscall.h.in @@ -349,4 +349,10 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/lib/libc/musl/include/ctype.h b/lib/libc/musl/include/ctype.h index 7936536f57..32bcef4dab 100644 --- a/lib/libc/musl/include/ctype.h +++ b/lib/libc/musl/include/ctype.h @@ -64,7 +64,9 @@ int isascii(int); int toascii(int); #define _tolower(a) ((a)|0x20) #define _toupper(a) ((a)&0x5f) +#ifndef __cplusplus #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128) +#endif #endif diff --git a/lib/libc/musl/include/elf.h b/lib/libc/musl/include/elf.h index b5e7befb02..86e2f0bb7d 100644 --- a/lib/libc/musl/include/elf.h +++ b/lib/libc/musl/include/elf.h @@ -686,6 +686,8 @@ typedef struct { #define NT_ARM_PAC_MASK 0x406 #define NT_ARM_PACA_KEYS 0x407 #define NT_ARM_PACG_KEYS 0x408 +#define NT_ARM_TAGGED_ADDR_CTRL 0x409 +#define NT_ARM_PAC_ENABLED_KEYS 0x40a #define NT_METAG_CBUF 0x500 #define NT_METAG_RPIPE 0x501 #define NT_METAG_TLS 0x502 diff --git a/lib/libc/musl/include/locale.h b/lib/libc/musl/include/locale.h index ce384381c6..11106fea87 100644 --- a/lib/libc/musl/include/locale.h +++ b/lib/libc/musl/include/locale.h @@ -7,7 +7,9 @@ extern "C" { #include -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/musl/include/netinet/if_ether.h b/lib/libc/musl/include/netinet/if_ether.h index 55a2ff1b17..3479f511bf 100644 --- a/lib/libc/musl/include/netinet/if_ether.h +++ b/lib/libc/musl/include/netinet/if_ether.h @@ -66,6 +66,7 @@ #define ETH_P_1588 0x88F7 #define ETH_P_NCSI 0x88F8 #define ETH_P_PRP 0x88FB +#define ETH_P_CFM 0x8902 #define ETH_P_FCOE 0x8906 #define ETH_P_TDLS 0x890D #define ETH_P_FIP 0x8914 diff --git a/lib/libc/musl/include/netinet/in.h b/lib/libc/musl/include/netinet/in.h index f9594339f0..fb628b61a9 100644 --- a/lib/libc/musl/include/netinet/in.h +++ b/lib/libc/musl/include/netinet/in.h @@ -48,6 +48,7 @@ struct ipv6_mreq { #define INADDR_BROADCAST ((in_addr_t) 0xffffffff) #define INADDR_NONE ((in_addr_t) 0xffffffff) #define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) +#define INADDR_DUMMY ((in_addr_t) 0xc0000008) #define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) #define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) diff --git a/lib/libc/musl/include/netinet/tcp.h b/lib/libc/musl/include/netinet/tcp.h index b7b997f5fd..fad1d84494 100644 --- a/lib/libc/musl/include/netinet/tcp.h +++ b/lib/libc/musl/include/netinet/tcp.h @@ -80,6 +80,8 @@ enum { TCP_NLA_SRTT, TCP_NLA_TIMEOUT_REHASH, TCP_NLA_BYTES_NOTSENT, + TCP_NLA_EDT, + TCP_NLA_TTL, }; #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) @@ -281,12 +283,21 @@ struct tcp_repair_window { uint32_t rcv_wup; }; +#define TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT 0x1 + struct tcp_zerocopy_receive { uint64_t address; uint32_t length; uint32_t recv_skip_hint; uint32_t inq; int32_t err; + uint64_t copybuf_address; + int32_t copybuf_len; + uint32_t flags; + uint64_t msg_control; + uint64_t msg_controllen; + uint32_t msg_flags; + uint32_t reserved; }; #endif diff --git a/lib/libc/musl/include/pthread.h b/lib/libc/musl/include/pthread.h index 0492f26a6b..89fd9ff7c1 100644 --- a/lib/libc/musl/include/pthread.h +++ b/lib/libc/musl/include/pthread.h @@ -221,6 +221,7 @@ int pthread_getaffinity_np(pthread_t, size_t, struct cpu_set_t *); int pthread_setaffinity_np(pthread_t, size_t, const struct cpu_set_t *); int pthread_getattr_np(pthread_t, pthread_attr_t *); int pthread_setname_np(pthread_t, const char *); +int pthread_getname_np(pthread_t, char *, size_t); int pthread_getattr_default_np(pthread_attr_t *); int pthread_setattr_default_np(const pthread_attr_t *); int pthread_tryjoin_np(pthread_t, void **); diff --git a/lib/libc/musl/include/setjmp.h b/lib/libc/musl/include/setjmp.h index 2d43abf84f..1976af231b 100644 --- a/lib/libc/musl/include/setjmp.h +++ b/lib/libc/musl/include/setjmp.h @@ -15,25 +15,33 @@ typedef struct __jmp_buf_tag { unsigned long __ss[128/sizeof(long)]; } jmp_buf[1]; +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) +#define __setjmp_attr __attribute__((__returns_twice__)) +#else +#define __setjmp_attr +#endif + #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) typedef jmp_buf sigjmp_buf; -int sigsetjmp (sigjmp_buf, int); +int sigsetjmp (sigjmp_buf, int) __setjmp_attr; _Noreturn void siglongjmp (sigjmp_buf, int); #endif #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) -int _setjmp (jmp_buf); +int _setjmp (jmp_buf) __setjmp_attr; _Noreturn void _longjmp (jmp_buf, int); #endif -int setjmp (jmp_buf); +int setjmp (jmp_buf) __setjmp_attr; _Noreturn void longjmp (jmp_buf, int); #define setjmp setjmp +#undef __setjmp_attr + #ifdef __cplusplus } #endif diff --git a/lib/libc/musl/include/signal.h b/lib/libc/musl/include/signal.h index 9ed929e4f2..c347f8610a 100644 --- a/lib/libc/musl/include/signal.h +++ b/lib/libc/musl/include/signal.h @@ -75,6 +75,8 @@ typedef struct sigaltstack stack_t; #define SEGV_ACCERR 2 #define SEGV_BNDERR 3 #define SEGV_PKUERR 4 +#define SEGV_MTEAERR 8 +#define SEGV_MTESERR 9 #define BUS_ADRALN 1 #define BUS_ADRERR 2 @@ -176,6 +178,9 @@ struct sigaction { #define sa_handler __sa_handler.sa_handler #define sa_sigaction __sa_handler.sa_sigaction +#define SA_UNSUPPORTED 0x00000400 +#define SA_EXPOSE_TAGBITS 0x00000800 + struct sigevent { union sigval sigev_value; int sigev_signo; @@ -259,6 +264,9 @@ void (*sigset(int, void (*)(int)))(int); #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) #define NSIG _NSIG typedef void (*sig_t)(int); + +#define SYS_SECCOMP 1 +#define SYS_USER_DISPATCH 2 #endif #ifdef _GNU_SOURCE diff --git a/lib/libc/musl/include/stdc-predef.h b/lib/libc/musl/include/stdc-predef.h index f8cd4b8911..af1a27998f 100644 --- a/lib/libc/musl/include/stdc-predef.h +++ b/lib/libc/musl/include/stdc-predef.h @@ -7,4 +7,7 @@ #define __STDC_IEC_559__ 1 #endif +#define __STDC_UTF_16__ 1 +#define __STDC_UTF_32__ 1 + #endif diff --git a/lib/libc/musl/include/stddef.h b/lib/libc/musl/include/stddef.h index bd75385350..f25b86396e 100644 --- a/lib/libc/musl/include/stddef.h +++ b/lib/libc/musl/include/stddef.h @@ -1,7 +1,9 @@ #ifndef _STDDEF_H #define _STDDEF_H -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/musl/include/stdio.h b/lib/libc/musl/include/stdio.h index 3604198c3e..d1ed01f03f 100644 --- a/lib/libc/musl/include/stdio.h +++ b/lib/libc/musl/include/stdio.h @@ -25,7 +25,9 @@ extern "C" { #include -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/musl/include/stdlib.h b/lib/libc/musl/include/stdlib.h index b54a051fe9..b507ca33b4 100644 --- a/lib/libc/musl/include/stdlib.h +++ b/lib/libc/musl/include/stdlib.h @@ -7,7 +7,9 @@ extern "C" { #include -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) @@ -146,6 +148,7 @@ int clearenv(void); #define WCOREDUMP(s) ((s) & 0x80) #define WIFCONTINUED(s) ((s) == 0xffff) void *reallocarray (void *, size_t, size_t); +void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *); #endif #ifdef _GNU_SOURCE diff --git a/lib/libc/musl/include/string.h b/lib/libc/musl/include/string.h index 795a2abcd9..43ad0942ed 100644 --- a/lib/libc/musl/include/string.h +++ b/lib/libc/musl/include/string.h @@ -7,7 +7,9 @@ extern "C" { #include -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/musl/include/sys/membarrier.h b/lib/libc/musl/include/sys/membarrier.h index 10cb31083c..11193eda15 100644 --- a/lib/libc/musl/include/sys/membarrier.h +++ b/lib/libc/musl/include/sys/membarrier.h @@ -9,9 +9,13 @@ #define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED 16 #define MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE 32 #define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE 64 +#define MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ 128 +#define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ 256 #define MEMBARRIER_CMD_SHARED MEMBARRIER_CMD_GLOBAL +#define MEMBARRIER_CMD_FLAG_CPU 1 + int membarrier(int, int); #endif diff --git a/lib/libc/musl/include/sys/mman.h b/lib/libc/musl/include/sys/mman.h index 4d603e9104..80a3baae23 100644 --- a/lib/libc/musl/include/sys/mman.h +++ b/lib/libc/musl/include/sys/mman.h @@ -40,6 +40,7 @@ extern "C" { #define MAP_HUGE_SHIFT 26 #define MAP_HUGE_MASK 0x3f +#define MAP_HUGE_16KB (14 << 26) #define MAP_HUGE_64KB (16 << 26) #define MAP_HUGE_512KB (19 << 26) #define MAP_HUGE_1MB (20 << 26) diff --git a/lib/libc/musl/include/sys/mount.h b/lib/libc/musl/include/sys/mount.h index 57a89c09ec..09bd6e9dfe 100644 --- a/lib/libc/musl/include/sys/mount.h +++ b/lib/libc/musl/include/sys/mount.h @@ -31,6 +31,7 @@ extern "C" { #define MS_REMOUNT 32 #define MS_MANDLOCK 64 #define MS_DIRSYNC 128 +#define MS_NOSYMFOLLOW 256 #define MS_NOATIME 1024 #define MS_NODIRATIME 2048 #define MS_BIND 4096 diff --git a/lib/libc/musl/include/sys/prctl.h b/lib/libc/musl/include/sys/prctl.h index 4b9fcc0508..087a75c9da 100644 --- a/lib/libc/musl/include/sys/prctl.h +++ b/lib/libc/musl/include/sys/prctl.h @@ -157,10 +157,26 @@ struct prctl_mm_map { #define PR_SET_TAGGED_ADDR_CTRL 55 #define PR_GET_TAGGED_ADDR_CTRL 56 #define PR_TAGGED_ADDR_ENABLE (1UL << 0) +#define PR_MTE_TCF_SHIFT 1 +#define PR_MTE_TCF_NONE (0UL << 1) +#define PR_MTE_TCF_SYNC (1UL << 1) +#define PR_MTE_TCF_ASYNC (2UL << 1) +#define PR_MTE_TCF_MASK (3UL << 1) +#define PR_MTE_TAG_SHIFT 3 +#define PR_MTE_TAG_MASK (0xffffUL << 3) #define PR_SET_IO_FLUSHER 57 #define PR_GET_IO_FLUSHER 58 +#define PR_SET_SYSCALL_USER_DISPATCH 59 +#define PR_SYS_DISPATCH_OFF 0 +#define PR_SYS_DISPATCH_ON 1 +#define SYSCALL_DISPATCH_FILTER_ALLOW 0 +#define SYSCALL_DISPATCH_FILTER_BLOCK 1 + +#define PR_PAC_SET_ENABLED_KEYS 60 +#define PR_PAC_GET_ENABLED_KEYS 61 + int prctl (int, ...); #ifdef __cplusplus diff --git a/lib/libc/musl/include/sys/ptrace.h b/lib/libc/musl/include/sys/ptrace.h index 5d62a9859a..c72e3c061c 100644 --- a/lib/libc/musl/include/sys/ptrace.h +++ b/lib/libc/musl/include/sys/ptrace.h @@ -42,6 +42,7 @@ extern "C" { #define PTRACE_SECCOMP_GET_FILTER 0x420c #define PTRACE_SECCOMP_GET_METADATA 0x420d #define PTRACE_GET_SYSCALL_INFO 0x420e +#define PTRACE_GET_RSEQ_CONFIGURATION 0x420f #define PT_READ_I PTRACE_PEEKTEXT #define PT_READ_D PTRACE_PEEKDATA @@ -130,6 +131,14 @@ struct __ptrace_syscall_info { }; }; +struct __ptrace_rseq_configuration { + uint64_t rseq_abi_pointer; + uint32_t rseq_abi_size; + uint32_t signature; + uint32_t flags; + uint32_t pad; +}; + long ptrace(int, ...); #ifdef __cplusplus diff --git a/lib/libc/musl/include/sys/socket.h b/lib/libc/musl/include/sys/socket.h index 38f5bb17b3..6dc1e40adf 100644 --- a/lib/libc/musl/include/sys/socket.h +++ b/lib/libc/musl/include/sys/socket.h @@ -289,6 +289,8 @@ struct linger { #define SCM_TXTIME SO_TXTIME #define SO_BINDTOIFINDEX 62 #define SO_DETACH_REUSEPORT_BPF 68 +#define SO_PREFER_BUSY_POLL 69 +#define SO_BUSY_POLL_BUDGET 70 #ifndef SOL_SOCKET #define SOL_SOCKET 1 diff --git a/lib/libc/musl/include/time.h b/lib/libc/musl/include/time.h index 5494df1836..3d94837205 100644 --- a/lib/libc/musl/include/time.h +++ b/lib/libc/musl/include/time.h @@ -7,7 +7,9 @@ extern "C" { #include -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/musl/include/unistd.h b/lib/libc/musl/include/unistd.h index 1306402603..212263a7e8 100644 --- a/lib/libc/musl/include/unistd.h +++ b/lib/libc/musl/include/unistd.h @@ -14,8 +14,12 @@ extern "C" { #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 +#define SEEK_DATA 3 +#define SEEK_HOLE 4 -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/musl/include/wchar.h b/lib/libc/musl/include/wchar.h index 88eb55b18c..ed5d774dfa 100644 --- a/lib/libc/musl/include/wchar.h +++ b/lib/libc/musl/include/wchar.h @@ -38,7 +38,9 @@ extern "C" { #define WCHAR_MIN (-1-0x7fffffff+L'\0') #endif -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) diff --git a/lib/libc/musl/libc.S b/lib/libc/musl/libc.S index 14970ca0ea..e24603b6e1 100644 --- a/lib/libc/musl/libc.S +++ b/lib/libc/musl/libc.S @@ -27,48 +27,48 @@ aio_read64: .globl aio_read .type aio_read, %function; aio_read: -.globl aio_write -.type aio_write, %function; -aio_write: .weak aio_write64 .type aio_write64, %function; aio_write64: -.globl aio_fsync -.type aio_fsync, %function; -aio_fsync: +.globl aio_write +.type aio_write, %function; +aio_write: .weak aio_fsync64 .type aio_fsync64, %function; aio_fsync64: -.weak aio_return64 -.type aio_return64, %function; -aio_return64: +.globl aio_fsync +.type aio_fsync, %function; +aio_fsync: .globl aio_return .type aio_return, %function; aio_return: -.globl aio_error -.type aio_error, %function; -aio_error: +.weak aio_return64 +.type aio_return64, %function; +aio_return64: .weak aio_error64 .type aio_error64, %function; aio_error64: -.globl aio_cancel -.type aio_cancel, %function; -aio_cancel: +.globl aio_error +.type aio_error, %function; +aio_error: .weak aio_cancel64 .type aio_cancel64, %function; aio_cancel64: -.globl aio_suspend -.type aio_suspend, %function; -aio_suspend: +.globl aio_cancel +.type aio_cancel, %function; +aio_cancel: .weak aio_suspend64 .type aio_suspend64, %function; aio_suspend64: -.globl lio_listio -.type lio_listio, %function; -lio_listio: +.globl aio_suspend +.type aio_suspend, %function; +aio_suspend: .weak lio_listio64 .type lio_listio64, %function; lio_listio64: +.globl lio_listio +.type lio_listio, %function; +lio_listio: .globl cabs .type cabs, %function; cabs: @@ -327,12 +327,12 @@ isalnum_l: .globl isalpha .type isalpha, %function; isalpha: -.weak isalpha_l -.type isalpha_l, %function; -isalpha_l: .globl __isalpha_l .type __isalpha_l, %function; __isalpha_l: +.weak isalpha_l +.type isalpha_l, %function; +isalpha_l: .globl isascii .type isascii, %function; isascii: @@ -348,21 +348,21 @@ isblank_l: .globl iscntrl .type iscntrl, %function; iscntrl: -.weak iscntrl_l -.type iscntrl_l, %function; -iscntrl_l: .globl __iscntrl_l .type __iscntrl_l, %function; __iscntrl_l: +.weak iscntrl_l +.type iscntrl_l, %function; +iscntrl_l: .globl isdigit .type isdigit, %function; isdigit: -.weak isdigit_l -.type isdigit_l, %function; -isdigit_l: .globl __isdigit_l .type __isdigit_l, %function; __isdigit_l: +.weak isdigit_l +.type isdigit_l, %function; +isdigit_l: .globl isgraph .type isgraph, %function; isgraph: @@ -375,96 +375,96 @@ isgraph_l: .globl islower .type islower, %function; islower: -.weak islower_l -.type islower_l, %function; -islower_l: .globl __islower_l .type __islower_l, %function; __islower_l: +.weak islower_l +.type islower_l, %function; +islower_l: .globl isprint .type isprint, %function; isprint: -.weak isprint_l -.type isprint_l, %function; -isprint_l: .globl __isprint_l .type __isprint_l, %function; __isprint_l: +.weak isprint_l +.type isprint_l, %function; +isprint_l: .globl ispunct .type ispunct, %function; ispunct: -.weak ispunct_l -.type ispunct_l, %function; -ispunct_l: .globl __ispunct_l .type __ispunct_l, %function; __ispunct_l: +.weak ispunct_l +.type ispunct_l, %function; +ispunct_l: .globl isspace .type isspace, %function; isspace: -.weak isspace_l -.type isspace_l, %function; -isspace_l: .globl __isspace_l .type __isspace_l, %function; __isspace_l: +.weak isspace_l +.type isspace_l, %function; +isspace_l: .globl isupper .type isupper, %function; isupper: -.weak isupper_l -.type isupper_l, %function; -isupper_l: .globl __isupper_l .type __isupper_l, %function; __isupper_l: +.weak isupper_l +.type isupper_l, %function; +isupper_l: .globl iswalnum .type iswalnum, %function; iswalnum: -.globl __iswalnum_l -.type __iswalnum_l, %function; -__iswalnum_l: .weak iswalnum_l .type iswalnum_l, %function; iswalnum_l: +.globl __iswalnum_l +.type __iswalnum_l, %function; +__iswalnum_l: .globl iswalpha .type iswalpha, %function; iswalpha: -.globl __iswalpha_l -.type __iswalpha_l, %function; -__iswalpha_l: .weak iswalpha_l .type iswalpha_l, %function; iswalpha_l: +.globl __iswalpha_l +.type __iswalpha_l, %function; +__iswalpha_l: .globl iswblank .type iswblank, %function; iswblank: -.globl __iswblank_l -.type __iswblank_l, %function; -__iswblank_l: .weak iswblank_l .type iswblank_l, %function; iswblank_l: +.globl __iswblank_l +.type __iswblank_l, %function; +__iswblank_l: .globl iswcntrl .type iswcntrl, %function; iswcntrl: -.globl __iswcntrl_l -.type __iswcntrl_l, %function; -__iswcntrl_l: .weak iswcntrl_l .type iswcntrl_l, %function; iswcntrl_l: +.globl __iswcntrl_l +.type __iswcntrl_l, %function; +__iswcntrl_l: .globl iswctype .type iswctype, %function; iswctype: .globl wctype .type wctype, %function; wctype: -.globl __iswctype_l -.type __iswctype_l, %function; -__iswctype_l: .weak iswctype_l .type iswctype_l, %function; iswctype_l: +.globl __iswctype_l +.type __iswctype_l, %function; +__iswctype_l: .globl __wctype_l .type __wctype_l, %function; __wctype_l: @@ -474,21 +474,21 @@ wctype_l: .globl iswdigit .type iswdigit, %function; iswdigit: -.globl __iswdigit_l -.type __iswdigit_l, %function; -__iswdigit_l: .weak iswdigit_l .type iswdigit_l, %function; iswdigit_l: +.globl __iswdigit_l +.type __iswdigit_l, %function; +__iswdigit_l: .globl iswgraph .type iswgraph, %function; iswgraph: -.globl __iswgraph_l -.type __iswgraph_l, %function; -__iswgraph_l: .weak iswgraph_l .type iswgraph_l, %function; iswgraph_l: +.globl __iswgraph_l +.type __iswgraph_l, %function; +__iswgraph_l: .globl iswlower .type iswlower, %function; iswlower: @@ -501,57 +501,57 @@ __iswlower_l: .globl iswprint .type iswprint, %function; iswprint: -.globl __iswprint_l -.type __iswprint_l, %function; -__iswprint_l: .weak iswprint_l .type iswprint_l, %function; iswprint_l: +.globl __iswprint_l +.type __iswprint_l, %function; +__iswprint_l: .globl iswpunct .type iswpunct, %function; iswpunct: -.globl __iswpunct_l -.type __iswpunct_l, %function; -__iswpunct_l: .weak iswpunct_l .type iswpunct_l, %function; iswpunct_l: +.globl __iswpunct_l +.type __iswpunct_l, %function; +__iswpunct_l: .globl iswspace .type iswspace, %function; iswspace: -.globl __iswspace_l -.type __iswspace_l, %function; -__iswspace_l: .weak iswspace_l .type iswspace_l, %function; iswspace_l: +.globl __iswspace_l +.type __iswspace_l, %function; +__iswspace_l: .globl iswupper .type iswupper, %function; iswupper: -.globl __iswupper_l -.type __iswupper_l, %function; -__iswupper_l: .weak iswupper_l .type iswupper_l, %function; iswupper_l: +.globl __iswupper_l +.type __iswupper_l, %function; +__iswupper_l: .globl iswxdigit .type iswxdigit, %function; iswxdigit: -.globl __iswxdigit_l -.type __iswxdigit_l, %function; -__iswxdigit_l: .weak iswxdigit_l .type iswxdigit_l, %function; iswxdigit_l: +.globl __iswxdigit_l +.type __iswxdigit_l, %function; +__iswxdigit_l: .globl isxdigit .type isxdigit, %function; isxdigit: -.globl __isxdigit_l -.type __isxdigit_l, %function; -__isxdigit_l: .weak isxdigit_l .type isxdigit_l, %function; isxdigit_l: +.globl __isxdigit_l +.type __isxdigit_l, %function; +__isxdigit_l: .globl toascii .type toascii, %function; toascii: @@ -567,24 +567,24 @@ tolower_l: .globl toupper .type toupper, %function; toupper: -.weak toupper_l -.type toupper_l, %function; -toupper_l: .globl __toupper_l .type __toupper_l, %function; __toupper_l: +.weak toupper_l +.type toupper_l, %function; +toupper_l: .globl towlower .type towlower, %function; towlower: .globl towupper .type towupper, %function; towupper: -.globl __towupper_l -.type __towupper_l, %function; -__towupper_l: .weak towupper_l .type towupper_l, %function; towupper_l: +.globl __towupper_l +.type __towupper_l, %function; +__towupper_l: .globl __towlower_l .type __towlower_l, %function; __towlower_l: @@ -660,12 +660,12 @@ seekdir: .globl telldir .type telldir, %function; telldir: -.globl versionsort -.type versionsort, %function; -versionsort: .weak versionsort64 .type versionsort64, %function; versionsort64: +.globl versionsort +.type versionsort, %function; +versionsort: .weak _init .type _init, %function; _init: @@ -735,12 +735,12 @@ exit: .globl quick_exit .type quick_exit, %function; quick_exit: -.globl creat -.type creat, %function; -creat: .weak creat64 .type creat64, %function; creat64: +.globl creat +.type creat, %function; +creat: .globl fcntl .type fcntl, %function; fcntl: @@ -750,24 +750,24 @@ open64: .globl open .type open, %function; open: -.weak openat64 -.type openat64, %function; -openat64: .globl openat .type openat, %function; openat: -.weak posix_fadvise64 -.type posix_fadvise64, %function; -posix_fadvise64: +.weak openat64 +.type openat64, %function; +openat64: .globl posix_fadvise .type posix_fadvise, %function; posix_fadvise: -.weak posix_fallocate64 -.type posix_fallocate64, %function; -posix_fallocate64: +.weak posix_fadvise64 +.type posix_fadvise64, %function; +posix_fadvise64: .globl posix_fallocate .type posix_fallocate, %function; posix_fallocate: +.weak posix_fallocate64 +.type posix_fallocate64, %function; +posix_fallocate64: .globl __flt_rounds .type __flt_rounds, %function; __flt_rounds: @@ -891,12 +891,12 @@ euidaccess: .weak eaccess .type eaccess, %function; eaccess: -.weak ftw64 -.type ftw64, %function; -ftw64: .globl ftw .type ftw, %function; ftw: +.weak ftw64 +.type ftw64, %function; +ftw64: .globl futimes .type futimes, %function; futimes: @@ -930,48 +930,48 @@ lutimes: .globl ulimit .type ulimit, %function; ulimit: -.weak endutent -.type endutent, %function; -endutent: .globl endutxent .type endutxent, %function; endutxent: -.weak setutent -.type setutent, %function; -setutent: +.weak endutent +.type endutent, %function; +endutent: .globl setutxent .type setutxent, %function; setutxent: +.weak setutent +.type setutent, %function; +setutent: .globl getutxent .type getutxent, %function; getutxent: .weak getutent .type getutent, %function; getutent: -.weak getutid -.type getutid, %function; -getutid: .globl getutxid .type getutxid, %function; getutxid: +.weak getutid +.type getutid, %function; +getutid: .weak getutline .type getutline, %function; getutline: .globl getutxline .type getutxline, %function; getutxline: -.weak pututline -.type pututline, %function; -pututline: .globl pututxline .type pututxline, %function; pututxline: -.weak updwtmp -.type updwtmp, %function; -updwtmp: +.weak pututline +.type pututline, %function; +pututline: .globl updwtmpx .type updwtmpx, %function; updwtmpx: +.weak updwtmp +.type updwtmp, %function; +updwtmp: .weak utmpxname .type utmpxname, %function; utmpxname: @@ -1042,12 +1042,12 @@ eventfd_read: .globl eventfd_write .type eventfd_write, %function; eventfd_write: -.weak fallocate64 -.type fallocate64, %function; -fallocate64: .globl fallocate .type fallocate, %function; fallocate: +.weak fallocate64 +.type fallocate64, %function; +fallocate64: .globl fanotify_init .type fanotify_init, %function; fanotify_init: @@ -1156,12 +1156,12 @@ remap_file_pages: .globl sbrk .type sbrk, %function; sbrk: -.globl sendfile -.type sendfile, %function; -sendfile: .weak sendfile64 .type sendfile64, %function; sendfile64: +.globl sendfile +.type sendfile, %function; +sendfile: .globl setfsgid .type setfsgid, %function; setfsgid: @@ -1297,18 +1297,18 @@ dngettext: .globl dgettext .type dgettext, %function; dgettext: -.weak duplocale -.type duplocale, %function; -duplocale: .globl __duplocale .type __duplocale, %function; __duplocale: -.weak __freelocale -.type __freelocale, %function; -__freelocale: +.weak duplocale +.type duplocale, %function; +duplocale: .globl freelocale .type freelocale, %function; freelocale: +.weak __freelocale +.type __freelocale, %function; +__freelocale: .globl iconv_open .type iconv_open, %function; iconv_open: @@ -1318,18 +1318,18 @@ iconv: .globl iconv_close .type iconv_close, %function; iconv_close: -.weak nl_langinfo_l -.type nl_langinfo_l, %function; -nl_langinfo_l: .globl __nl_langinfo_l .type __nl_langinfo_l, %function; __nl_langinfo_l: -.globl __nl_langinfo -.type __nl_langinfo, %function; -__nl_langinfo: +.weak nl_langinfo_l +.type nl_langinfo_l, %function; +nl_langinfo_l: .weak nl_langinfo .type nl_langinfo, %function; nl_langinfo: +.globl __nl_langinfo +.type __nl_langinfo, %function; +__nl_langinfo: .globl localeconv .type localeconv, %function; localeconv: @@ -1357,6 +1357,24 @@ strfmon_l: .globl strfmon .type strfmon, %function; strfmon: +.weak __strtof_l +.type __strtof_l, %function; +__strtof_l: +.globl strtof_l +.type strtof_l, %function; +strtof_l: +.globl strtod_l +.type strtod_l, %function; +strtod_l: +.weak __strtod_l +.type __strtod_l, %function; +__strtod_l: +.globl strtold_l +.type strtold_l, %function; +strtold_l: +.weak __strtold_l +.type __strtold_l, %function; +__strtold_l: .globl __strxfrm_l .type __strxfrm_l, %function; __strxfrm_l: @@ -1390,12 +1408,12 @@ wcscoll_l: .globl wcscoll .type wcscoll, %function; wcscoll: -.globl __wcsxfrm_l -.type __wcsxfrm_l, %function; -__wcsxfrm_l: .weak wcsxfrm_l .type wcsxfrm_l, %function; wcsxfrm_l: +.globl __wcsxfrm_l +.type __wcsxfrm_l, %function; +__wcsxfrm_l: .globl wcsxfrm .type wcsxfrm, %function; wcsxfrm: @@ -1567,12 +1585,12 @@ erfcl: .globl exp .type exp, %function; exp: -.weak pow10 -.type pow10, %function; -pow10: .globl exp10 .type exp10, %function; exp10: +.weak pow10 +.type pow10, %function; +pow10: .weak pow10f .type pow10f, %function; pow10f: @@ -1738,12 +1756,12 @@ lgammaf: .weak lgammaf_r .type lgammaf_r, %function; lgammaf_r: -.weak lgammal_r -.type lgammal_r, %function; -lgammal_r: .globl __lgammal_r .type __lgammal_r, %function; __lgammal_r: +.weak lgammal_r +.type lgammal_r, %function; +lgammal_r: .globl lgammal .type lgammal, %function; lgammal: @@ -1888,12 +1906,12 @@ remainder: .weak drem .type drem, %function; drem: -.weak dremf -.type dremf, %function; -dremf: .globl remainderf .type remainderf, %function; remainderf: +.weak dremf +.type dremf, %function; +dremf: .globl remainderl .type remainderl, %function; remainderl: @@ -2389,24 +2407,24 @@ dn_expand: .globl dn_skipname .type dn_skipname, %function; dn_skipname: -.weak setnetent -.type setnetent, %function; -setnetent: .globl sethostent .type sethostent, %function; sethostent: +.weak setnetent +.type setnetent, %function; +setnetent: .globl gethostent .type gethostent, %function; gethostent: .globl getnetent .type getnetent, %function; getnetent: -.globl endhostent -.type endhostent, %function; -endhostent: .weak endnetent .type endnetent, %function; endnetent: +.globl endhostent +.type endhostent, %function; +endhostent: .globl ether_aton_r .type ether_aton_r, %function; ether_aton_r: @@ -2701,12 +2719,12 @@ getpwnam_r: .globl getpwuid_r .type getpwuid_r, %function; getpwuid_r: -.weak endpwent -.type endpwent, %function; -endpwent: .globl setpwent .type setpwent, %function; setpwent: +.weak endpwent +.type endpwent, %function; +endpwent: .globl getpwent .type getpwent, %function; getpwent: @@ -2911,12 +2929,12 @@ waitpid: .globl fnmatch .type fnmatch, %function; fnmatch: -.globl glob -.type glob, %function; -glob: .weak glob64 .type glob64, %function; glob64: +.globl glob +.type glob, %function; +glob: .globl globfree .type globfree, %function; globfree: @@ -3031,9 +3049,6 @@ pselect: .globl select .type select, %function; select: -.globl _longjmp -.type _longjmp, %function; -_longjmp: #if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64) .globl __longjmp .type __longjmp, %function; @@ -3042,15 +3057,18 @@ __longjmp: .globl longjmp .type longjmp, %function; longjmp: +.globl _longjmp +.type _longjmp, %function; +_longjmp: .globl _setjmp .type _setjmp, %function; _setjmp: -.globl setjmp -.type setjmp, %function; -setjmp: .globl __setjmp .type __setjmp, %function; __setjmp: +.globl setjmp +.type setjmp, %function; +setjmp: .globl getitimer .type getitimer, %function; getitimer: @@ -3165,22 +3183,22 @@ sigwait: .globl sigwaitinfo .type sigwaitinfo, %function; sigwaitinfo: -WEAK64 __fxstat64 -.type __fxstat64, %function; -__fxstat64: #if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_powerpc) .globl __fxstat .type __fxstat, %function; __fxstat: #endif +WEAK64 __fxstat64 +.type __fxstat64, %function; +__fxstat64: +WEAK64 __fxstatat64 +.type __fxstatat64, %function; +__fxstatat64: #if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_powerpc) .globl __fxstatat .type __fxstatat, %function; __fxstatat: #endif -WEAK64 __fxstatat64 -.type __fxstatat64, %function; -__fxstatat64: WEAK64 __lxstat64 .type __lxstat64, %function; __lxstat64: @@ -3218,12 +3236,12 @@ fstat64: .globl fstat .type fstat, %function; fstat: -.globl fstatat -.type fstatat, %function; -fstatat: .weak fstatat64 .type fstatat64, %function; fstatat64: +.globl fstatat +.type fstatat, %function; +fstatat: .globl futimens .type futimens, %function; futimens: @@ -3233,12 +3251,12 @@ futimesat: .globl lchmod .type lchmod, %function; lchmod: -.weak lstat64 -.type lstat64, %function; -lstat64: .globl lstat .type lstat, %function; lstat: +.weak lstat64 +.type lstat64, %function; +lstat64: .globl mkdir .type mkdir, %function; mkdir: @@ -3263,30 +3281,30 @@ stat: .weak stat64 .type stat64, %function; stat64: -.weak statfs -.type statfs, %function; -statfs: .weak statfs64 .type statfs64, %function; statfs64: -.weak fstatfs -.type fstatfs, %function; -fstatfs: +.weak statfs +.type statfs, %function; +statfs: .weak fstatfs64 .type fstatfs64, %function; fstatfs64: +.weak fstatfs +.type fstatfs, %function; +fstatfs: .weak statvfs64 .type statvfs64, %function; statvfs64: .globl statvfs .type statvfs, %function; statvfs: -.weak fstatvfs64 -.type fstatvfs64, %function; -fstatvfs64: .globl fstatvfs .type fstatvfs, %function; fstatvfs: +.weak fstatvfs64 +.type fstatvfs64, %function; +fstatvfs64: .globl umask .type umask, %function; umask: @@ -3307,12 +3325,12 @@ __uflow: .globl asprintf .type asprintf, %function; asprintf: -.weak clearerr_unlocked -.type clearerr_unlocked, %function; -clearerr_unlocked: .globl clearerr .type clearerr, %function; clearerr: +.weak clearerr_unlocked +.type clearerr_unlocked, %function; +clearerr_unlocked: .globl dprintf .type dprintf, %function; dprintf: @@ -3367,27 +3385,27 @@ fclose: .weak _IO_feof_unlocked .type _IO_feof_unlocked, %function; _IO_feof_unlocked: -.globl feof -.type feof, %function; -feof: .weak feof_unlocked .type feof_unlocked, %function; feof_unlocked: -.globl ferror -.type ferror, %function; -ferror: +.globl feof +.type feof, %function; +feof: .weak ferror_unlocked .type ferror_unlocked, %function; ferror_unlocked: .weak _IO_ferror_unlocked .type _IO_ferror_unlocked, %function; _IO_ferror_unlocked: -.weak fflush_unlocked -.type fflush_unlocked, %function; -fflush_unlocked: +.globl ferror +.type ferror, %function; +ferror: .globl fflush .type fflush, %function; fflush: +.weak fflush_unlocked +.type fflush_unlocked, %function; +fflush_unlocked: .globl fgetc .type fgetc, %function; fgetc: @@ -3400,21 +3418,21 @@ fgetpos: .weak fgetpos64 .type fgetpos64, %function; fgetpos64: -.weak fgets_unlocked -.type fgets_unlocked, %function; -fgets_unlocked: .globl fgets .type fgets, %function; fgets: -.weak getwc_unlocked -.type getwc_unlocked, %function; -getwc_unlocked: -.weak fgetwc_unlocked -.type fgetwc_unlocked, %function; -fgetwc_unlocked: +.weak fgets_unlocked +.type fgets_unlocked, %function; +fgets_unlocked: .globl __fgetwc_unlocked .type __fgetwc_unlocked, %function; __fgetwc_unlocked: +.weak fgetwc_unlocked +.type fgetwc_unlocked, %function; +fgetwc_unlocked: +.weak getwc_unlocked +.type getwc_unlocked, %function; +getwc_unlocked: .globl fgetwc .type fgetwc, %function; fgetwc: @@ -3424,12 +3442,12 @@ fgetws_unlocked: .globl fgetws .type fgetws, %function; fgetws: -.weak fileno_unlocked -.type fileno_unlocked, %function; -fileno_unlocked: .globl fileno .type fileno, %function; fileno: +.weak fileno_unlocked +.type fileno_unlocked, %function; +fileno_unlocked: .globl flockfile .type flockfile, %function; flockfile: @@ -3451,30 +3469,30 @@ fprintf: .globl fputc .type fputc, %function; fputc: -.weak fputs_unlocked -.type fputs_unlocked, %function; -fputs_unlocked: .globl fputs .type fputs, %function; fputs: -.weak putwc_unlocked -.type putwc_unlocked, %function; -putwc_unlocked: -.weak fputwc_unlocked -.type fputwc_unlocked, %function; -fputwc_unlocked: +.weak fputs_unlocked +.type fputs_unlocked, %function; +fputs_unlocked: .globl __fputwc_unlocked .type __fputwc_unlocked, %function; __fputwc_unlocked: +.weak fputwc_unlocked +.type fputwc_unlocked, %function; +fputwc_unlocked: +.weak putwc_unlocked +.type putwc_unlocked, %function; +putwc_unlocked: .globl fputwc .type fputwc, %function; fputwc: -.globl fputws -.type fputws, %function; -fputws: .weak fputws_unlocked .type fputws_unlocked, %function; fputws_unlocked: +.globl fputws +.type fputws, %function; +fputws: .globl fread .type fread, %function; fread: @@ -3493,12 +3511,12 @@ __isoc99_fscanf: .globl fscanf .type fscanf, %function; fscanf: -.weak fseeko -.type fseeko, %function; -fseeko: .weak fseeko64 .type fseeko64, %function; fseeko64: +.weak fseeko +.type fseeko, %function; +fseeko: .globl fseek .type fseek, %function; fseek: @@ -3529,33 +3547,33 @@ fwide: .globl fwprintf .type fwprintf, %function; fwprintf: -.weak fwrite_unlocked -.type fwrite_unlocked, %function; -fwrite_unlocked: .globl fwrite .type fwrite, %function; fwrite: -.globl fwscanf -.type fwscanf, %function; -fwscanf: +.weak fwrite_unlocked +.type fwrite_unlocked, %function; +fwrite_unlocked: .weak __isoc99_fwscanf .type __isoc99_fwscanf, %function; __isoc99_fwscanf: +.globl fwscanf +.type fwscanf, %function; +fwscanf: .globl getc .type getc, %function; getc: .weak _IO_getc .type _IO_getc, %function; _IO_getc: -.weak _IO_getc_unlocked -.type _IO_getc_unlocked, %function; -_IO_getc_unlocked: -.globl getc_unlocked -.type getc_unlocked, %function; -getc_unlocked: .weak fgetc_unlocked .type fgetc_unlocked, %function; fgetc_unlocked: +.globl getc_unlocked +.type getc_unlocked, %function; +getc_unlocked: +.weak _IO_getc_unlocked +.type _IO_getc_unlocked, %function; +_IO_getc_unlocked: .globl getchar .type getchar, %function; getchar: @@ -3580,12 +3598,12 @@ getw: .globl getwc .type getwc, %function; getwc: -.globl getwchar -.type getwchar, %function; -getwchar: .weak getwchar_unlocked .type getwchar_unlocked, %function; getwchar_unlocked: +.globl getwchar +.type getwchar, %function; +getwchar: .globl open_memstream .type open_memstream, %function; open_memstream: @@ -3610,15 +3628,15 @@ putc: .weak _IO_putc .type _IO_putc, %function; _IO_putc: -.weak _IO_putc_unlocked -.type _IO_putc_unlocked, %function; -_IO_putc_unlocked: -.globl putc_unlocked -.type putc_unlocked, %function; -putc_unlocked: .weak fputc_unlocked .type fputc_unlocked, %function; fputc_unlocked: +.globl putc_unlocked +.type putc_unlocked, %function; +putc_unlocked: +.weak _IO_putc_unlocked +.type _IO_putc_unlocked, %function; +_IO_putc_unlocked: .globl putchar .type putchar, %function; putchar: @@ -3673,12 +3691,12 @@ snprintf: .globl sprintf .type sprintf, %function; sprintf: -.weak __isoc99_sscanf -.type __isoc99_sscanf, %function; -__isoc99_sscanf: .globl sscanf .type sscanf, %function; sscanf: +.weak __isoc99_sscanf +.type __isoc99_sscanf, %function; +__isoc99_sscanf: .globl swprintf .type swprintf, %function; swprintf: @@ -3691,12 +3709,12 @@ __isoc99_swscanf: .globl tempnam .type tempnam, %function; tempnam: -.globl tmpfile -.type tmpfile, %function; -tmpfile: .weak tmpfile64 .type tmpfile64, %function; tmpfile64: +.globl tmpfile +.type tmpfile, %function; +tmpfile: .globl tmpnam .type tmpnam, %function; tmpnam: @@ -3715,30 +3733,30 @@ vdprintf: .globl vfprintf .type vfprintf, %function; vfprintf: -.weak __isoc99_vfscanf -.type __isoc99_vfscanf, %function; -__isoc99_vfscanf: .globl vfscanf .type vfscanf, %function; vfscanf: +.weak __isoc99_vfscanf +.type __isoc99_vfscanf, %function; +__isoc99_vfscanf: .globl vfwprintf .type vfwprintf, %function; vfwprintf: -.globl vfwscanf -.type vfwscanf, %function; -vfwscanf: .weak __isoc99_vfwscanf .type __isoc99_vfwscanf, %function; __isoc99_vfwscanf: +.globl vfwscanf +.type vfwscanf, %function; +vfwscanf: .globl vprintf .type vprintf, %function; vprintf: -.weak __isoc99_vscanf -.type __isoc99_vscanf, %function; -__isoc99_vscanf: .globl vscanf .type vscanf, %function; vscanf: +.weak __isoc99_vscanf +.type __isoc99_vscanf, %function; +__isoc99_vscanf: .globl vsnprintf .type vsnprintf, %function; vsnprintf: @@ -3772,12 +3790,12 @@ __isoc99_vwscanf: .globl wprintf .type wprintf, %function; wprintf: -.weak __isoc99_wscanf -.type __isoc99_wscanf, %function; -__isoc99_wscanf: .globl wscanf .type wscanf, %function; wscanf: +.weak __isoc99_wscanf +.type __isoc99_wscanf, %function; +__isoc99_wscanf: .globl abs .type abs, %function; abs: @@ -3826,36 +3844,21 @@ llabs: .globl lldiv .type lldiv, %function; lldiv: +.weak qsort_r +.type qsort_r, %function; +qsort_r: .globl qsort .type qsort, %function; qsort: -.weak __strtof_l -.type __strtof_l, %function; -__strtof_l: -.weak strtof_l -.type strtof_l, %function; -strtof_l: .globl strtof .type strtof, %function; strtof: .globl strtod .type strtod, %function; strtod: -.weak __strtod_l -.type __strtod_l, %function; -__strtod_l: -.weak strtod_l -.type strtod_l, %function; -strtod_l: -.weak strtold_l -.type strtold_l, %function; -strtold_l: .globl strtold .type strtold, %function; strtold: -.weak __strtold_l -.type __strtold_l, %function; -__strtold_l: .globl strtoull .type strtoull, %function; strtoull: @@ -3868,12 +3871,12 @@ strtoll: .weak __strtoll_internal .type __strtoll_internal, %function; __strtoll_internal: -.globl strtoul -.type strtoul, %function; -strtoul: .weak __strtoul_internal .type __strtoul_internal, %function; __strtoul_internal: +.globl strtoul +.type strtoul, %function; +strtoul: .weak __strtol_internal .type __strtol_internal, %function; __strtol_internal: @@ -3973,12 +3976,12 @@ stpncpy: .globl strcasecmp .type strcasecmp, %function; strcasecmp: -.weak strcasecmp_l -.type strcasecmp_l, %function; -strcasecmp_l: .globl __strcasecmp_l .type __strcasecmp_l, %function; __strcasecmp_l: +.weak strcasecmp_l +.type strcasecmp_l, %function; +strcasecmp_l: .globl strcasestr .type strcasestr, %function; strcasestr: @@ -4003,12 +4006,12 @@ strcspn: .globl strdup .type strdup, %function; strdup: -.globl strerror_r -.type strerror_r, %function; -strerror_r: .weak __xpg_strerror_r .type __xpg_strerror_r, %function; __xpg_strerror_r: +.globl strerror_r +.type strerror_r, %function; +strerror_r: .globl strlcat .type strlcat, %function; strlcat: @@ -4165,24 +4168,24 @@ mkostemp: .weak mkostemp64 .type mkostemp64, %function; mkostemp64: -.weak mkostemps -.type mkostemps, %function; -mkostemps: .weak mkostemps64 .type mkostemps64, %function; mkostemps64: +.weak mkostemps +.type mkostemps, %function; +mkostemps: .globl mkstemp .type mkstemp, %function; mkstemp: .weak mkstemp64 .type mkstemp64, %function; mkstemp64: -.globl mkstemps -.type mkstemps, %function; -mkstemps: .weak mkstemps64 .type mkstemps64, %function; mkstemps64: +.globl mkstemps +.type mkstemps, %function; +mkstemps: .globl mktemp .type mktemp, %function; mktemp: @@ -4195,12 +4198,12 @@ cfgetispeed: .globl cfmakeraw .type cfmakeraw, %function; cfmakeraw: -.globl cfsetospeed -.type cfsetospeed, %function; -cfsetospeed: .weak cfsetspeed .type cfsetspeed, %function; cfsetspeed: +.globl cfsetospeed +.type cfsetospeed, %function; +cfsetospeed: .globl cfsetispeed .type cfsetispeed, %function; cfsetispeed: @@ -4438,15 +4441,18 @@ pthread_getconcurrency: .globl pthread_getcpuclockid .type pthread_getcpuclockid, %function; pthread_getcpuclockid: +.globl pthread_getname_np +.type pthread_getname_np, %function; +pthread_getname_np: .globl pthread_getschedparam .type pthread_getschedparam, %function; pthread_getschedparam: -.weak tss_get -.type tss_get, %function; -tss_get: .weak pthread_getspecific .type pthread_getspecific, %function; pthread_getspecific: +.weak tss_get +.type tss_get, %function; +tss_get: .weak pthread_join .type pthread_join, %function; pthread_join: @@ -4549,12 +4555,12 @@ pthread_rwlockattr_init: .globl pthread_rwlockattr_setpshared .type pthread_rwlockattr_setpshared, %function; pthread_rwlockattr_setpshared: -.weak pthread_self -.type pthread_self, %function; -pthread_self: .weak thrd_current .type thrd_current, %function; thrd_current: +.weak pthread_self +.type pthread_self, %function; +pthread_self: .globl pthread_setattr_default_np .type pthread_setattr_default_np, %function; pthread_setattr_default_np: @@ -4819,12 +4825,12 @@ fdatasync: .globl fsync .type fsync, %function; fsync: -.weak ftruncate64 -.type ftruncate64, %function; -ftruncate64: .globl ftruncate .type ftruncate, %function; ftruncate: +.weak ftruncate64 +.type ftruncate64, %function; +ftruncate64: .globl getcwd .type getcwd, %function; getcwd: @@ -4918,12 +4924,12 @@ pwrite: .weak pwrite64 .type pwrite64, %function; pwrite64: -.weak pwritev64 -.type pwritev64, %function; -pwritev64: .globl pwritev .type pwritev, %function; pwritev: +.weak pwritev64 +.type pwritev64, %function; +pwritev64: .globl read .type read, %function; read: @@ -5075,10 +5081,6 @@ _dl_debug_addr: .type ___environ, %object; .size ___environ, PTR_SIZE_BYTES ___environ: -.weak _environ -.type _environ, %object; -.size _environ, PTR_SIZE_BYTES -_environ: .globl __environ .type __environ, %object; .size __environ, PTR_SIZE_BYTES @@ -5087,6 +5089,10 @@ __environ: .type environ, %object; .size environ, PTR_SIZE_BYTES environ: +.weak _environ +.type _environ, %object; +.size _environ, PTR_SIZE_BYTES +_environ: .globl __stack_chk_guard .type __stack_chk_guard, %object; .size __stack_chk_guard, PTR_SIZE_BYTES diff --git a/lib/libc/musl/src/complex/cacosf.c b/lib/libc/musl/src/complex/cacosf.c index 2e048540fa..ed8acf0f5a 100644 --- a/lib/libc/musl/src/complex/cacosf.c +++ b/lib/libc/musl/src/complex/cacosf.c @@ -2,8 +2,10 @@ // FIXME +static const float float_pi_2 = M_PI_2; + float complex cacosf(float complex z) { z = casinf(z); - return CMPLXF((float)M_PI_2 - crealf(z), -cimagf(z)); + return CMPLXF(float_pi_2 - crealf(z), -cimagf(z)); } diff --git a/lib/libc/musl/src/complex/catanf.c b/lib/libc/musl/src/complex/catanf.c index ef3907a506..1d569f2dac 100644 --- a/lib/libc/musl/src/complex/catanf.c +++ b/lib/libc/musl/src/complex/catanf.c @@ -61,13 +61,15 @@ static const double DP1 = 3.140625; static const double DP2 = 9.67502593994140625E-4; static const double DP3 = 1.509957990978376432E-7; +static const float float_pi = M_PI; + static float _redupif(float xx) { float x, t; long i; x = xx; - t = x/(float)M_PI; + t = x/float_pi; if (t >= 0.0f) t += 0.5f; else diff --git a/lib/libc/musl/src/complex/cproj.c b/lib/libc/musl/src/complex/cproj.c index 9ae1e17c0d..d2b8f5a972 100644 --- a/lib/libc/musl/src/complex/cproj.c +++ b/lib/libc/musl/src/complex/cproj.c @@ -3,6 +3,6 @@ double complex cproj(double complex z) { if (isinf(creal(z)) || isinf(cimag(z))) - return CMPLX(INFINITY, copysign(0.0, creal(z))); + return CMPLX(INFINITY, copysign(0.0, cimag(z))); return z; } diff --git a/lib/libc/musl/src/complex/cprojf.c b/lib/libc/musl/src/complex/cprojf.c index 03fab339d9..15a874bb2f 100644 --- a/lib/libc/musl/src/complex/cprojf.c +++ b/lib/libc/musl/src/complex/cprojf.c @@ -3,6 +3,6 @@ float complex cprojf(float complex z) { if (isinf(crealf(z)) || isinf(cimagf(z))) - return CMPLXF(INFINITY, copysignf(0.0, crealf(z))); + return CMPLXF(INFINITY, copysignf(0.0, cimagf(z))); return z; } diff --git a/lib/libc/musl/src/complex/cprojl.c b/lib/libc/musl/src/complex/cprojl.c index 38a494c5c4..531ffa1c5e 100644 --- a/lib/libc/musl/src/complex/cprojl.c +++ b/lib/libc/musl/src/complex/cprojl.c @@ -9,7 +9,7 @@ long double complex cprojl(long double complex z) long double complex cprojl(long double complex z) { if (isinf(creall(z)) || isinf(cimagl(z))) - return CMPLXL(INFINITY, copysignl(0.0, creall(z))); + return CMPLXL(INFINITY, copysignl(0.0, cimagl(z))); return z; } #endif diff --git a/lib/libc/musl/src/ctype/nonspacing.h b/lib/libc/musl/src/ctype/nonspacing.h index 5d05a3d1a0..7746f3b603 100644 --- a/lib/libc/musl/src/ctype/nonspacing.h +++ b/lib/libc/musl/src/ctype/nonspacing.h @@ -1,23 +1,23 @@ -16,16,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,16,16,32,16,16,16,33,34,35, -36,37,38,39,16,16,40,16,16,16,16,16,16,16,16,16,16,16,41,42,16,16,43,16,16,16, +16,16,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,16,33,16,16,16,34,35,36, +37,38,39,40,16,16,41,16,16,16,16,16,16,16,16,16,16,16,42,43,16,16,44,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,16,16,16,44,16,45,46,47,48,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,45,16,46,47,48,49,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,50,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,51,16,16,52, +53,16,54,55,56,16,16,16,16,16,16,57,16,16,58,16,59,60,61,62,63,64,65,66,67,68, +69,70,16,71,72,73,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,74,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,75,76,16,16,16,77,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,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,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,16,16,16,16,16,16,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,16,16,16,16,16,16,78,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,79,80,16,16,16,16,16,16,16,81,16,16,16,16,16,82,83,84,16,16,16,16,16,85, +86,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, @@ -35,55 +35,57 @@ 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, -0,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,9,0,0,0,0,0,0,64,127, -229,31,248,159,0,0,0,0,0,0,255,127,0,0,0,0,0,0,0,0,15,0,0,0,0,0,208,23,4,0,0, -0,0,248,15,0,3,0,0,0,60,59,0,0,0,0,0,0,64,163,3,0,0,0,0,0,0,240,207,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,255,253,33,16,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, +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,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,0,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,9,0,0,0,0,0,0,64,127,229,31,248,159,0,0,0,0,0,0,255,127,0,0,0,0,0,0,0,0, +15,0,0,0,0,0,208,23,4,0,0,0,0,248,15,0,3,0,0,0,60,59,0,0,0,0,0,0,64,163,3,0,0, +0,0,0,0,240,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,255,253,33,16, +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, 251,0,248,0,0,0,124,0,0,0,0,0,0,223,255,0,0,0,0,0,0,0,0,0,0,0,0,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,128,3,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,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,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, -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,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,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, +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,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, +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,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,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,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/lib/libc/musl/src/env/__libc_start_main.c b/lib/libc/musl/src/env/__libc_start_main.c index 8fbe526271..c5b277bdcf 100644 --- a/lib/libc/musl/src/env/__libc_start_main.c +++ b/lib/libc/musl/src/env/__libc_start_main.c @@ -69,7 +69,8 @@ weak_alias(libc_start_init, __libc_start_init); typedef int lsm2_fn(int (*)(int,char **,char **), int, char **); static lsm2_fn libc_start_main_stage2; -int __libc_start_main(int (*main)(int,char **,char **), int argc, char **argv) +int __libc_start_main(int (*main)(int,char **,char **), int argc, char **argv, + void (*init_dummy)(), void(*fini_dummy)(), void(*ldso_dummy)()) { char **envp = argv+argc+1; diff --git a/lib/libc/musl/src/env/__stack_chk_fail.c b/lib/libc/musl/src/env/__stack_chk_fail.c index bf5a280ad9..e53526020f 100644 --- a/lib/libc/musl/src/env/__stack_chk_fail.c +++ b/lib/libc/musl/src/env/__stack_chk_fail.c @@ -9,6 +9,15 @@ void __init_ssp(void *entropy) if (entropy) memcpy(&__stack_chk_guard, entropy, sizeof(uintptr_t)); else __stack_chk_guard = (uintptr_t)&__stack_chk_guard * 1103515245; +#if UINTPTR_MAX >= 0xffffffffffffffff + /* Sacrifice 8 bits of entropy on 64bit to prevent leaking/ + * overwriting the canary via string-manipulation functions. + * The NULL byte is on the second byte so that off-by-ones can + * still be detected. Endianness is taken care of + * automatically. */ + ((char *)&__stack_chk_guard)[1] = 0; +#endif + __pthread_self()->canary = __stack_chk_guard; } diff --git a/lib/libc/musl/src/errno/__strerror.h b/lib/libc/musl/src/errno/__strerror.h index 2d992da554..14925907b5 100644 --- a/lib/libc/musl/src/errno/__strerror.h +++ b/lib/libc/musl/src/errno/__strerror.h @@ -102,3 +102,7 @@ E(EDQUOT, "Quota exceeded") E(ENOMEDIUM, "No medium found") E(EMEDIUMTYPE, "Wrong medium type") E(EMULTIHOP, "Multihop attempted") +E(ENOKEY, "Required key not available") +E(EKEYEXPIRED, "Key has expired") +E(EKEYREVOKED, "Key has been revoked") +E(EKEYREJECTED, "Key was rejected by service") diff --git a/lib/libc/musl/src/fenv/powerpc/fenv-sf.c b/lib/libc/musl/src/fenv/powerpc/fenv-sf.c index 85bef40f10..d4248f26f7 100644 --- a/lib/libc/musl/src/fenv/powerpc/fenv-sf.c +++ b/lib/libc/musl/src/fenv/powerpc/fenv-sf.c @@ -1,3 +1,3 @@ -#ifdef _SOFT_FLOAT +#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) #include "../fenv.c" #endif diff --git a/lib/libc/musl/src/fenv/powerpc/fenv.S b/lib/libc/musl/src/fenv/powerpc/fenv.S index 22cea216a0..55055d0b3a 100644 --- a/lib/libc/musl/src/fenv/powerpc/fenv.S +++ b/lib/libc/musl/src/fenv/powerpc/fenv.S @@ -1,4 +1,4 @@ -#ifndef _SOFT_FLOAT +#if !defined(_SOFT_FLOAT) && !defined(__NO_FPRS__) .global feclearexcept .type feclearexcept,@function feclearexcept: diff --git a/lib/libc/musl/src/include/stdlib.h b/lib/libc/musl/src/include/stdlib.h index e9da20158c..812b04de2f 100644 --- a/lib/libc/musl/src/include/stdlib.h +++ b/lib/libc/musl/src/include/stdlib.h @@ -8,6 +8,7 @@ hidden void __env_rm_add(char *, char *); hidden int __mkostemps(char *, int, int); hidden int __ptsname_r(int, char *, size_t); hidden char *__randname(char *); +hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *); hidden void *__libc_malloc(size_t); hidden void *__libc_malloc_impl(size_t); diff --git a/lib/libc/musl/src/internal/version.h b/lib/libc/musl/src/internal/version.h index b23e8e2963..a9327dd446 100644 --- a/lib/libc/musl/src/internal/version.h +++ b/lib/libc/musl/src/internal/version.h @@ -1 +1 @@ -#define VERSION "1.2.2" +#define VERSION "1.2.3" diff --git a/lib/libc/musl/src/ldso/dl_iterate_phdr.c b/lib/libc/musl/src/ldso/dl_iterate_phdr.c index 86c87ef835..9546dd3609 100644 --- a/lib/libc/musl/src/ldso/dl_iterate_phdr.c +++ b/lib/libc/musl/src/ldso/dl_iterate_phdr.c @@ -1,5 +1,6 @@ #include #include +#include "pthread_impl.h" #include "libc.h" #define AUX_CNT 38 @@ -35,7 +36,7 @@ static int static_dl_iterate_phdr(int(*callback)(struct dl_phdr_info *info, size info.dlpi_subs = 0; if (tls_phdr) { info.dlpi_tls_modid = 1; - info.dlpi_tls_data = (void *)(base + tls_phdr->p_vaddr); + info.dlpi_tls_data = __tls_get_addr((tls_mod_off_t[]){1,0}); } else { info.dlpi_tls_modid = 0; info.dlpi_tls_data = 0; diff --git a/lib/libc/musl/src/legacy/cuserid.c b/lib/libc/musl/src/legacy/cuserid.c index 4e78798ded..dcaf73d4e6 100644 --- a/lib/libc/musl/src/legacy/cuserid.c +++ b/lib/libc/musl/src/legacy/cuserid.c @@ -2,13 +2,21 @@ #include #include #include +#include char *cuserid(char *buf) { + static char usridbuf[L_cuserid]; struct passwd pw, *ppw; long pwb[256]; - if (getpwuid_r(geteuid(), &pw, (void *)pwb, sizeof pwb, &ppw)) - return 0; - snprintf(buf, L_cuserid, "%s", pw.pw_name); + if (buf) *buf = 0; + getpwuid_r(geteuid(), &pw, (void *)pwb, sizeof pwb, &ppw); + if (!ppw) + return buf; + size_t len = strnlen(pw.pw_name, L_cuserid); + if (len == L_cuserid) + return buf; + if (!buf) buf = usridbuf; + memcpy(buf, pw.pw_name, len+1); return buf; } diff --git a/lib/libc/musl/src/linux/epoll.c b/lib/libc/musl/src/linux/epoll.c index deff5b101a..93baa8147e 100644 --- a/lib/libc/musl/src/linux/epoll.c +++ b/lib/libc/musl/src/linux/epoll.c @@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev) int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs) { - int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8); + int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8); #ifdef SYS_epoll_wait - if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to); + if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to); #endif return __syscall_ret(r); } diff --git a/lib/libc/musl/src/locale/dcngettext.c b/lib/libc/musl/src/locale/dcngettext.c index d1e6c6d13a..0b53286db7 100644 --- a/lib/libc/musl/src/locale/dcngettext.c +++ b/lib/libc/musl/src/locale/dcngettext.c @@ -132,6 +132,9 @@ char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2, struct binding *q; int old_errno = errno; + /* match gnu gettext behaviour */ + if (!msgid1) goto notrans; + if ((unsigned)category >= LC_ALL) goto notrans; if (!domainname) domainname = __gettextdomain(); diff --git a/lib/libc/musl/src/locale/duplocale.c b/lib/libc/musl/src/locale/duplocale.c index 030b64cb0e..5ce33ae6de 100644 --- a/lib/libc/musl/src/locale/duplocale.c +++ b/lib/libc/musl/src/locale/duplocale.c @@ -3,6 +3,11 @@ #include "locale_impl.h" #include "libc.h" +#define malloc __libc_malloc +#define calloc undef +#define realloc undef +#define free undef + locale_t __duplocale(locale_t old) { locale_t new = malloc(sizeof *new); diff --git a/lib/libc/musl/src/locale/strtod_l.c b/lib/libc/musl/src/locale/strtod_l.c new file mode 100644 index 0000000000..574ba148e0 --- /dev/null +++ b/lib/libc/musl/src/locale/strtod_l.c @@ -0,0 +1,22 @@ +#define _GNU_SOURCE +#include +#include + +float strtof_l(const char *restrict s, char **restrict p, locale_t l) +{ + return strtof(s, p); +} + +double strtod_l(const char *restrict s, char **restrict p, locale_t l) +{ + return strtod(s, p); +} + +long double strtold_l(const char *restrict s, char **restrict p, locale_t l) +{ + return strtold(s, p); +} + +weak_alias(strtof_l, __strtof_l); +weak_alias(strtod_l, __strtod_l); +weak_alias(strtold_l, __strtold_l); diff --git a/lib/libc/musl/src/malloc/free.c b/lib/libc/musl/src/malloc/free.c index f17a952cb4..3944f7b28f 100644 --- a/lib/libc/musl/src/malloc/free.c +++ b/lib/libc/musl/src/malloc/free.c @@ -2,5 +2,5 @@ void free(void *p) { - return __libc_free(p); + __libc_free(p); } diff --git a/lib/libc/musl/src/malloc/mallocng/aligned_alloc.c b/lib/libc/musl/src/malloc/mallocng/aligned_alloc.c index 3411689600..e0862a83ae 100644 --- a/lib/libc/musl/src/malloc/mallocng/aligned_alloc.c +++ b/lib/libc/musl/src/malloc/mallocng/aligned_alloc.c @@ -22,6 +22,9 @@ void *aligned_alloc(size_t align, size_t len) if (align <= UNIT) align = UNIT; unsigned char *p = malloc(len + align - UNIT); + if (!p) + return 0; + struct meta *g = get_meta(p); int idx = get_slot_index(p); size_t stride = get_stride(g); diff --git a/lib/libc/musl/src/malloc/mallocng/free.c b/lib/libc/musl/src/malloc/mallocng/free.c index 40745f97da..418a085c18 100644 --- a/lib/libc/musl/src/malloc/mallocng/free.c +++ b/lib/libc/musl/src/malloc/mallocng/free.c @@ -119,7 +119,11 @@ void free(void *p) if (((uintptr_t)(start-1) ^ (uintptr_t)end) >= 2*PGSZ && g->last_idx) { unsigned char *base = start + (-(uintptr_t)start & (PGSZ-1)); size_t len = (end-base) & -PGSZ; - if (len) madvise(base, len, MADV_FREE); + if (len) { + int e = errno; + madvise(base, len, MADV_FREE); + errno = e; + } } // atomic free without locking if this is neither first or last slot @@ -139,5 +143,9 @@ void free(void *p) wrlock(); struct mapinfo mi = nontrivial_free(g, idx); unlock(); - if (mi.len) munmap(mi.base, mi.len); + if (mi.len) { + int e = errno; + munmap(mi.base, mi.len); + errno = e; + } } diff --git a/lib/libc/musl/src/malloc/oldmalloc/malloc.c b/lib/libc/musl/src/malloc/oldmalloc/malloc.c index 53f5f959ec..25d00d44de 100644 --- a/lib/libc/musl/src/malloc/oldmalloc/malloc.c +++ b/lib/libc/musl/src/malloc/oldmalloc/malloc.c @@ -11,7 +11,7 @@ #include "malloc_impl.h" #include "fork_impl.h" -#define malloc __libc_malloc +#define malloc __libc_malloc_impl #define realloc __libc_realloc #define free __libc_free @@ -481,12 +481,14 @@ void __bin_chunk(struct chunk *self) if (size > RECLAIM && (size^(size-osize)) > size-osize) { uintptr_t a = (uintptr_t)self + SIZE_ALIGN+PAGE_SIZE-1 & -PAGE_SIZE; uintptr_t b = (uintptr_t)next - SIZE_ALIGN & -PAGE_SIZE; + int e = errno; #if 1 __madvise((void *)a, b-a, MADV_DONTNEED); #else __mmap((void *)a, b-a, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0); #endif + errno = e; } unlock_bin(i); @@ -499,7 +501,9 @@ static void unmap_chunk(struct chunk *self) size_t len = CHUNK_SIZE(self) + extra; /* Crash on double free */ if (extra & 1) a_crash(); + int e = errno; __munmap(base, len); + errno = e; } void free(void *p) diff --git a/lib/libc/musl/src/math/acoshf.c b/lib/libc/musl/src/math/acoshf.c index 8a4ec4d57e..b773d48e2b 100644 --- a/lib/libc/musl/src/math/acoshf.c +++ b/lib/libc/musl/src/math/acoshf.c @@ -15,12 +15,12 @@ float acoshf(float x) uint32_t a = u.i & 0x7fffffff; if (a < 0x3f800000+(1<<23)) - /* |x| < 2, invalid if x < 1 or nan */ + /* |x| < 2, invalid if x < 1 */ /* up to 2ulp error in [1,1.125] */ return log1pf(x-1 + sqrtf((x-1)*(x-1)+2*(x-1))); - if (a < 0x3f800000+(12<<23)) - /* |x| < 0x1p12 */ + if (u.i < 0x3f800000+(12<<23)) + /* 2 <= x < 0x1p12 */ return logf(2*x - 1/(x+sqrtf(x*x-1))); - /* x >= 0x1p12 */ + /* x >= 0x1p12 or x <= -2 or nan */ return logf(x) + 0.693147180559945309417232121458176568f; } diff --git a/lib/libc/musl/src/math/expm1f.c b/lib/libc/musl/src/math/expm1f.c index 297e0b44a2..09a41afe7d 100644 --- a/lib/libc/musl/src/math/expm1f.c +++ b/lib/libc/musl/src/math/expm1f.c @@ -16,7 +16,6 @@ #include "libm.h" static const float -o_threshold = 8.8721679688e+01, /* 0x42b17180 */ ln2_hi = 6.9313812256e-01, /* 0x3f317180 */ ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */ invln2 = 1.4426950216e+00, /* 0x3fb8aa3b */ @@ -41,7 +40,7 @@ float expm1f(float x) return x; if (sign) return -1; - if (x > o_threshold) { + if (hx > 0x42b17217) { /* x > log(FLT_MAX) */ x *= 0x1p127f; return x; } diff --git a/lib/libc/musl/src/math/fmaf.c b/lib/libc/musl/src/math/fmaf.c index 80f5cd8a33..7c65acf1fc 100644 --- a/lib/libc/musl/src/math/fmaf.c +++ b/lib/libc/musl/src/math/fmaf.c @@ -77,17 +77,16 @@ float fmaf(float x, float y, float z) * If result is inexact, and exactly halfway between two float values, * we need to adjust the low-order bit in the direction of the error. */ -#ifdef FE_TOWARDZERO - fesetround(FE_TOWARDZERO); -#endif - volatile double vxy = xy; /* XXX work around gcc CSE bug */ - double adjusted_result = vxy + z; - fesetround(FE_TONEAREST); - if (result == adjusted_result) { - u.f = adjusted_result; + double err; + int neg = u.i >> 63; + if (neg == (z > xy)) + err = xy - result + z; + else + err = z - result + xy; + if (neg == (err < 0)) u.i++; - adjusted_result = u.f; - } - z = adjusted_result; + else + u.i--; + z = u.f; return z; } diff --git a/lib/libc/musl/src/math/powerpc/fabs.c b/lib/libc/musl/src/math/powerpc/fabs.c index 0efc21ef83..9453a3aa98 100644 --- a/lib/libc/musl/src/math/powerpc/fabs.c +++ b/lib/libc/musl/src/math/powerpc/fabs.c @@ -1,6 +1,6 @@ #include -#if defined(_SOFT_FLOAT) || defined(BROKEN_PPC_D_ASM) +#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) || defined(BROKEN_PPC_D_ASM) #include "../fabs.c" diff --git a/lib/libc/musl/src/math/powerpc/fabsf.c b/lib/libc/musl/src/math/powerpc/fabsf.c index d88b5911c0..2e9da588dd 100644 --- a/lib/libc/musl/src/math/powerpc/fabsf.c +++ b/lib/libc/musl/src/math/powerpc/fabsf.c @@ -1,6 +1,6 @@ #include -#ifdef _SOFT_FLOAT +#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) #include "../fabsf.c" diff --git a/lib/libc/musl/src/math/powerpc/fma.c b/lib/libc/musl/src/math/powerpc/fma.c index 135c990357..0eb2ba1ef5 100644 --- a/lib/libc/musl/src/math/powerpc/fma.c +++ b/lib/libc/musl/src/math/powerpc/fma.c @@ -1,6 +1,6 @@ #include -#if defined(_SOFT_FLOAT) || defined(BROKEN_PPC_D_ASM) +#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) || defined(BROKEN_PPC_D_ASM) #include "../fma.c" diff --git a/lib/libc/musl/src/math/powerpc/fmaf.c b/lib/libc/musl/src/math/powerpc/fmaf.c index a99a2a3ba1..dc1a749d98 100644 --- a/lib/libc/musl/src/math/powerpc/fmaf.c +++ b/lib/libc/musl/src/math/powerpc/fmaf.c @@ -1,6 +1,6 @@ #include -#ifdef _SOFT_FLOAT +#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) #include "../fmaf.c" diff --git a/lib/libc/musl/src/misc/ioctl.c b/lib/libc/musl/src/misc/ioctl.c index 492828119a..35804f026e 100644 --- a/lib/libc/musl/src/misc/ioctl.c +++ b/lib/libc/musl/src/misc/ioctl.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "syscall.h" #define alignof(t) offsetof(struct { char c; t x; }, x) @@ -53,7 +54,7 @@ static const struct ioctl_compat_map compat_map[] = { { _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 */ + { 0, 0, 4, WR, 1, 0 }, /* snd_pcm_mmap_control (each member) */ /* VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF, VIDIOC_PREPARE_BUF */ { _IOWR('V', 9, new_misaligned(68)), _IOWR('V', 9, char[68]), 68, WR, 1, OFFS(20, 24) }, @@ -90,7 +91,11 @@ static void convert_ioctl_struct(const struct ioctl_compat_map *map, char *old, * 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); + /* snd_pcm_mmap_control, special-cased due to kernel + * type definition having been botched. */ + int adj = BYTE_ORDER==BIG_ENDIAN ? 4 : 0; + convert_ioctl_struct(map+3, old+68, new+72+adj, dir); + convert_ioctl_struct(map+3, old+72, new+76+3*adj, dir); return; } for (int i=0; i < map->noffs; i++) { diff --git a/lib/libc/musl/src/passwd/nscd_query.c b/lib/libc/musl/src/passwd/nscd_query.c index d38e371bcd..dc3406b851 100644 --- a/lib/libc/musl/src/passwd/nscd_query.c +++ b/lib/libc/musl/src/passwd/nscd_query.c @@ -40,7 +40,15 @@ retry: buf[0] = NSCDVERSION; fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); - if (fd < 0) return NULL; + if (fd < 0) { + if (errno == EAFNOSUPPORT) { + f = fopen("/dev/null", "re"); + if (f) + errno = errno_save; + return f; + } + return 0; + } if(!(f = fdopen(fd, "r"))) { close(fd); diff --git a/lib/libc/musl/src/process/fdop.h b/lib/libc/musl/src/process/fdop.h index 5adf144387..7cf733b21d 100644 --- a/lib/libc/musl/src/process/fdop.h +++ b/lib/libc/musl/src/process/fdop.h @@ -10,3 +10,8 @@ struct fdop { mode_t mode; char path[]; }; + +#define malloc __libc_malloc +#define calloc __libc_calloc +#define realloc undef +#define free __libc_free diff --git a/lib/libc/musl/src/process/posix_spawn_file_actions_addclose.c b/lib/libc/musl/src/process/posix_spawn_file_actions_addclose.c index cdda597991..0c2ef8fa37 100644 --- a/lib/libc/musl/src/process/posix_spawn_file_actions_addclose.c +++ b/lib/libc/musl/src/process/posix_spawn_file_actions_addclose.c @@ -5,6 +5,7 @@ int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *fa, int fd) { + if (fd < 0) return EBADF; struct fdop *op = malloc(sizeof *op); if (!op) return ENOMEM; op->cmd = FDOP_CLOSE; diff --git a/lib/libc/musl/src/process/posix_spawn_file_actions_adddup2.c b/lib/libc/musl/src/process/posix_spawn_file_actions_adddup2.c index 0367498fd4..addca4d4f0 100644 --- a/lib/libc/musl/src/process/posix_spawn_file_actions_adddup2.c +++ b/lib/libc/musl/src/process/posix_spawn_file_actions_adddup2.c @@ -5,6 +5,7 @@ int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *fa, int srcfd, int fd) { + if (srcfd < 0 || fd < 0) return EBADF; struct fdop *op = malloc(sizeof *op); if (!op) return ENOMEM; op->cmd = FDOP_DUP2; diff --git a/lib/libc/musl/src/process/posix_spawn_file_actions_addfchdir.c b/lib/libc/musl/src/process/posix_spawn_file_actions_addfchdir.c index 436c683d25..e89ede8c3c 100644 --- a/lib/libc/musl/src/process/posix_spawn_file_actions_addfchdir.c +++ b/lib/libc/musl/src/process/posix_spawn_file_actions_addfchdir.c @@ -6,6 +6,7 @@ int posix_spawn_file_actions_addfchdir_np(posix_spawn_file_actions_t *fa, int fd) { + if (fd < 0) return EBADF; struct fdop *op = malloc(sizeof *op); if (!op) return ENOMEM; op->cmd = FDOP_FCHDIR; diff --git a/lib/libc/musl/src/process/posix_spawn_file_actions_addopen.c b/lib/libc/musl/src/process/posix_spawn_file_actions_addopen.c index 368922c76b..82bbcec9eb 100644 --- a/lib/libc/musl/src/process/posix_spawn_file_actions_addopen.c +++ b/lib/libc/musl/src/process/posix_spawn_file_actions_addopen.c @@ -6,6 +6,7 @@ int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *restrict fa, int fd, const char *restrict path, int flags, mode_t mode) { + if (fd < 0) return EBADF; struct fdop *op = malloc(sizeof *op + strlen(path) + 1); if (!op) return ENOMEM; op->cmd = FDOP_OPEN; diff --git a/lib/libc/musl/src/setjmp/powerpc/longjmp.S b/lib/libc/musl/src/setjmp/powerpc/longjmp.S index e598bd056e..611389fed9 100644 --- a/lib/libc/musl/src/setjmp/powerpc/longjmp.S +++ b/lib/libc/musl/src/setjmp/powerpc/longjmp.S @@ -37,7 +37,37 @@ longjmp: lwz 29, 72(3) lwz 30, 76(3) lwz 31, 80(3) -#ifndef _SOFT_FLOAT +#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) + mflr 0 + bl 1f + .hidden __hwcap + .long __hwcap-. +1: mflr 4 + lwz 5, 0(4) + lwzx 4, 4, 5 + andis. 4, 4, 0x80 + beq 1f + .long 0x11c35b01 /* evldd 14,88(3) */ + .long 0x11e36301 /* ... */ + .long 0x12036b01 + .long 0x12237301 + .long 0x12437b01 + .long 0x12638301 + .long 0x12838b01 + .long 0x12a39301 + .long 0x12c39b01 + .long 0x12e3a301 + .long 0x1303ab01 + .long 0x1323b301 + .long 0x1343bb01 + .long 0x1363c301 + .long 0x1383cb01 + .long 0x13a3d301 + .long 0x13c3db01 + .long 0x13e3e301 /* evldd 31,224(3) */ + .long 0x11a3eb01 /* evldd 13,232(3) */ +1: mtlr 0 +#else lfd 14,88(3) lfd 15,96(3) lfd 16,104(3) diff --git a/lib/libc/musl/src/setjmp/powerpc/setjmp.S b/lib/libc/musl/src/setjmp/powerpc/setjmp.S index cd91a207f5..f1fcce339e 100644 --- a/lib/libc/musl/src/setjmp/powerpc/setjmp.S +++ b/lib/libc/musl/src/setjmp/powerpc/setjmp.S @@ -37,7 +37,37 @@ setjmp: stw 29, 72(3) stw 30, 76(3) stw 31, 80(3) -#ifndef _SOFT_FLOAT +#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) + mflr 0 + bl 1f + .hidden __hwcap + .long __hwcap-. +1: mflr 4 + lwz 5, 0(4) + lwzx 4, 4, 5 + andis. 4, 4, 0x80 + beq 1f + .long 0x11c35b21 /* evstdd 14,88(3) */ + .long 0x11e36321 /* ... */ + .long 0x12036b21 + .long 0x12237321 + .long 0x12437b21 + .long 0x12638321 + .long 0x12838b21 + .long 0x12a39321 + .long 0x12c39b21 + .long 0x12e3a321 + .long 0x1303ab21 + .long 0x1323b321 + .long 0x1343bb21 + .long 0x1363c321 + .long 0x1383cb21 + .long 0x13a3d321 + .long 0x13c3db21 + .long 0x13e3e321 /* evstdd 31,224(3) */ + .long 0x11a3eb21 /* evstdd 13,232(3) */ +1: mtlr 0 +#else stfd 14,88(3) stfd 15,96(3) stfd 16,104(3) diff --git a/lib/libc/musl/src/signal/block.c b/lib/libc/musl/src/signal/block.c index d7f6100134..cc8698f0bb 100644 --- a/lib/libc/musl/src/signal/block.c +++ b/lib/libc/musl/src/signal/block.c @@ -3,9 +3,9 @@ #include static const unsigned long all_mask[] = { -#if ULONG_MAX == 0xffffffff && _NSIG == 129 +#if ULONG_MAX == 0xffffffff && _NSIG > 65 -1UL, -1UL, -1UL, -1UL -#elif ULONG_MAX == 0xffffffff +#elif ULONG_MAX == 0xffffffff || _NSIG > 65 -1UL, -1UL #else -1UL diff --git a/lib/libc/musl/src/stdio/fgetws.c b/lib/libc/musl/src/stdio/fgetws.c index b08b30491a..195cb4355a 100644 --- a/lib/libc/musl/src/stdio/fgetws.c +++ b/lib/libc/musl/src/stdio/fgetws.c @@ -1,6 +1,5 @@ #include "stdio_impl.h" #include -#include wint_t __fgetwc_unlocked(FILE *); @@ -12,10 +11,6 @@ wchar_t *fgetws(wchar_t *restrict s, int n, FILE *restrict f) FLOCK(f); - /* Setup a dummy errno so we can detect EILSEQ. This is - * the only way to catch encoding errors in the form of a - * partial character just before EOF. */ - errno = EAGAIN; for (; n; n--) { wint_t c = __fgetwc_unlocked(f); if (c == WEOF) break; @@ -23,7 +18,7 @@ wchar_t *fgetws(wchar_t *restrict s, int n, FILE *restrict f) if (c == '\n') break; } *p = 0; - if (ferror(f) || errno==EILSEQ) p = s; + if (ferror(f)) p = s; FUNLOCK(f); diff --git a/lib/libc/musl/src/stdio/fseek.c b/lib/libc/musl/src/stdio/fseek.c index 439308f757..c07f7e9526 100644 --- a/lib/libc/musl/src/stdio/fseek.c +++ b/lib/libc/musl/src/stdio/fseek.c @@ -1,7 +1,14 @@ #include "stdio_impl.h" +#include int __fseeko_unlocked(FILE *f, off_t off, int whence) { + /* Fail immediately for invalid whence argument. */ + if (whence != SEEK_CUR && whence != SEEK_SET && whence != SEEK_END) { + errno = EINVAL; + return -1; + } + /* Adjust relative offset for unread data in buffer, if any. */ if (whence == SEEK_CUR && f->rend) off -= f->rend - f->rpos; diff --git a/lib/libc/musl/src/stdio/getdelim.c b/lib/libc/musl/src/stdio/getdelim.c index d2f5b15ab1..df114441c7 100644 --- a/lib/libc/musl/src/stdio/getdelim.c +++ b/lib/libc/musl/src/stdio/getdelim.c @@ -55,9 +55,11 @@ ssize_t getdelim(char **restrict s, size_t *restrict n, int delim, FILE *restric *s = tmp; *n = m; } - memcpy(*s+i, f->rpos, k); - f->rpos += k; - i += k; + if (k) { + memcpy(*s+i, f->rpos, k); + f->rpos += k; + i += k; + } if (z) break; if ((c = getc_unlocked(f)) == EOF) { if (!i || !feof(f)) { diff --git a/lib/libc/musl/src/stdio/popen.c b/lib/libc/musl/src/stdio/popen.c index 92cb57ee93..3ec833941c 100644 --- a/lib/libc/musl/src/stdio/popen.c +++ b/lib/libc/musl/src/stdio/popen.c @@ -31,25 +31,12 @@ FILE *popen(const char *cmd, const char *mode) __syscall(SYS_close, p[1]); return NULL; } - FLOCK(f); - - /* If the child's end of the pipe happens to already be on the final - * fd number to which it will be assigned (either 0 or 1), it must - * be moved to a different fd. Otherwise, there is no safe way to - * remove the close-on-exec flag in the child without also creating - * a file descriptor leak race condition in the parent. */ - if (p[1-op] == 1-op) { - int tmp = fcntl(1-op, F_DUPFD_CLOEXEC, 0); - if (tmp < 0) { - e = errno; - goto fail; - } - __syscall(SYS_close, p[1-op]); - p[1-op] = tmp; - } e = ENOMEM; if (!posix_spawn_file_actions_init(&fa)) { + for (FILE *l = *__ofl_lock(); l; l=l->next) + if (l->pipe_pid && posix_spawn_file_actions_addclose(&fa, l->fd)) + goto fail; if (!posix_spawn_file_actions_adddup2(&fa, p[1-op], 1-op)) { if (!(e = posix_spawn(&pid, "/bin/sh", &fa, 0, (char *[]){ "sh", "-c", (char *)cmd, 0 }, __environ))) { @@ -58,13 +45,14 @@ FILE *popen(const char *cmd, const char *mode) if (!strchr(mode, 'e')) fcntl(p[op], F_SETFD, 0); __syscall(SYS_close, p[1-op]); - FUNLOCK(f); + __ofl_unlock(); return f; } } +fail: + __ofl_unlock(); posix_spawn_file_actions_destroy(&fa); } -fail: fclose(f); __syscall(SYS_close, p[1-op]); diff --git a/lib/libc/musl/src/stdlib/qsort.c b/lib/libc/musl/src/stdlib/qsort.c index da58fd3177..314ddc29da 100644 --- a/lib/libc/musl/src/stdlib/qsort.c +++ b/lib/libc/musl/src/stdlib/qsort.c @@ -24,6 +24,7 @@ /* Smoothsort, an adaptive variant of Heapsort. Memory usage: O(1). Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */ +#define _BSD_SOURCE #include #include #include @@ -31,7 +32,7 @@ #include "atomic.h" #define ntz(x) a_ctz_l((x)) -typedef int (*cmpfun)(const void *, const void *); +typedef int (*cmpfun)(const void *, const void *, void *); static inline int pntz(size_t p[2]) { int r = ntz(p[0] - 1); @@ -88,7 +89,7 @@ static inline void shr(size_t p[2], int n) p[1] >>= n; } -static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[]) +static void sift(unsigned char *head, size_t width, cmpfun cmp, void *arg, int pshift, size_t lp[]) { unsigned char *rt, *lf; unsigned char *ar[14 * sizeof(size_t) + 1]; @@ -99,10 +100,10 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size rt = head - width; lf = head - width - lp[pshift - 2]; - if((*cmp)(ar[0], lf) >= 0 && (*cmp)(ar[0], rt) >= 0) { + if(cmp(ar[0], lf, arg) >= 0 && cmp(ar[0], rt, arg) >= 0) { break; } - if((*cmp)(lf, rt) >= 0) { + if(cmp(lf, rt, arg) >= 0) { ar[i++] = lf; head = lf; pshift -= 1; @@ -115,7 +116,7 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size cycle(width, ar, i); } -static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[]) +static void trinkle(unsigned char *head, size_t width, cmpfun cmp, void *arg, size_t pp[2], int pshift, int trusty, size_t lp[]) { unsigned char *stepson, *rt, *lf; @@ -130,13 +131,13 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], ar[0] = head; while(p[0] != 1 || p[1] != 0) { stepson = head - lp[pshift]; - if((*cmp)(stepson, ar[0]) <= 0) { + if(cmp(stepson, ar[0], arg) <= 0) { break; } if(!trusty && pshift > 1) { rt = head - width; lf = head - width - lp[pshift - 2]; - if((*cmp)(rt, stepson) >= 0 || (*cmp)(lf, stepson) >= 0) { + if(cmp(rt, stepson, arg) >= 0 || cmp(lf, stepson, arg) >= 0) { break; } } @@ -150,11 +151,11 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], } if(!trusty) { cycle(width, ar, i); - sift(head, width, cmp, pshift, lp); + sift(head, width, cmp, arg, pshift, lp); } } -void qsort(void *base, size_t nel, size_t width, cmpfun cmp) +void __qsort_r(void *base, size_t nel, size_t width, cmpfun cmp, void *arg) { size_t lp[12*sizeof(size_t)]; size_t i, size = width * nel; @@ -173,16 +174,16 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp) while(head < high) { if((p[0] & 3) == 3) { - sift(head, width, cmp, pshift, lp); + sift(head, width, cmp, arg, pshift, lp); shr(p, 2); pshift += 2; } else { if(lp[pshift - 1] >= high - head) { - trinkle(head, width, cmp, p, pshift, 0, lp); + trinkle(head, width, cmp, arg, p, pshift, 0, lp); } else { - sift(head, width, cmp, pshift, lp); + sift(head, width, cmp, arg, pshift, lp); } - + if(pshift == 1) { shl(p, 1); pshift = 0; @@ -191,12 +192,12 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp) pshift = 1; } } - + p[0] |= 1; head += width; } - trinkle(head, width, cmp, p, pshift, 0, lp); + trinkle(head, width, cmp, arg, p, pshift, 0, lp); while(pshift != 1 || p[0] != 1 || p[1] != 0) { if(pshift <= 1) { @@ -208,11 +209,13 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp) pshift -= 2; p[0] ^= 7; shr(p, 1); - trinkle(head - lp[pshift] - width, width, cmp, p, pshift + 1, 1, lp); + trinkle(head - lp[pshift] - width, width, cmp, arg, p, pshift + 1, 1, lp); shl(p, 1); p[0] |= 1; - trinkle(head - width, width, cmp, p, pshift, 1, lp); + trinkle(head - width, width, cmp, arg, p, pshift, 1, lp); } head -= width; } } + +weak_alias(__qsort_r, qsort_r); diff --git a/lib/libc/musl/src/stdlib/qsort_nr.c b/lib/libc/musl/src/stdlib/qsort_nr.c new file mode 100644 index 0000000000..efe7ccecd1 --- /dev/null +++ b/lib/libc/musl/src/stdlib/qsort_nr.c @@ -0,0 +1,14 @@ +#define _BSD_SOURCE +#include + +typedef int (*cmpfun)(const void *, const void *); + +static int wrapper_cmp(const void *v1, const void *v2, void *cmp) +{ + return ((cmpfun)cmp)(v1, v2); +} + +void qsort(void *base, size_t nel, size_t width, cmpfun cmp) +{ + __qsort_r(base, nel, width, wrapper_cmp, cmp); +} diff --git a/lib/libc/musl/src/stdlib/strtod.c b/lib/libc/musl/src/stdlib/strtod.c index a5d0118a2d..39b9daada8 100644 --- a/lib/libc/musl/src/stdlib/strtod.c +++ b/lib/libc/musl/src/stdlib/strtod.c @@ -28,10 +28,3 @@ long double strtold(const char *restrict s, char **restrict p) { return strtox(s, p, 2); } - -weak_alias(strtof, strtof_l); -weak_alias(strtod, strtod_l); -weak_alias(strtold, strtold_l); -weak_alias(strtof, __strtof_l); -weak_alias(strtod, __strtod_l); -weak_alias(strtold, __strtold_l); diff --git a/lib/libc/musl/src/thread/pthread_getname_np.c b/lib/libc/musl/src/thread/pthread_getname_np.c new file mode 100644 index 0000000000..85504e45dc --- /dev/null +++ b/lib/libc/musl/src/thread/pthread_getname_np.c @@ -0,0 +1,25 @@ +#define _GNU_SOURCE +#include +#include +#include + +#include "pthread_impl.h" + +int pthread_getname_np(pthread_t thread, char *name, size_t len) +{ + int fd, cs, status = 0; + char f[sizeof "/proc/self/task//comm" + 3*sizeof(int)]; + + if (len < 16) return ERANGE; + + if (thread == pthread_self()) + return prctl(PR_GET_NAME, (unsigned long)name, 0UL, 0UL, 0UL) ? errno : 0; + + snprintf(f, sizeof f, "/proc/self/task/%d/comm", thread->tid); + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); + if ((fd = open(f, O_RDONLY|O_CLOEXEC)) < 0 || (len = read(fd, name, len)) == -1) status = errno; + else name[len-1] = 0; /* remove trailing new line only if successful */ + if (fd >= 0) close(fd); + pthread_setcancelstate(cs, 0); + return status; +} diff --git a/lib/libc/musl/src/thread/pthread_setname_np.c b/lib/libc/musl/src/thread/pthread_setname_np.c index 82d35e17ed..fc2d230618 100644 --- a/lib/libc/musl/src/thread/pthread_setname_np.c +++ b/lib/libc/musl/src/thread/pthread_setname_np.c @@ -19,7 +19,7 @@ int pthread_setname_np(pthread_t thread, const char *name) snprintf(f, sizeof f, "/proc/self/task/%d/comm", thread->tid); pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); - if ((fd = open(f, O_WRONLY)) < 0 || write(fd, name, len) < 0) status = errno; + if ((fd = open(f, O_WRONLY|O_CLOEXEC)) < 0 || write(fd, name, len) < 0) status = errno; if (fd >= 0) close(fd); pthread_setcancelstate(cs, 0); return status; diff --git a/lib/libc/musl/src/time/__tz.c b/lib/libc/musl/src/time/__tz.c index 09a6317e6b..c34b3eb755 100644 --- a/lib/libc/musl/src/time/__tz.c +++ b/lib/libc/musl/src/time/__tz.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "libc.h" #include "lock.h" #include "fork_impl.h" @@ -154,10 +155,21 @@ static void do_tzset() } if (old_tz) memcpy(old_tz, s, i+1); + int posix_form = 0; + if (*s != ':') { + p = s; + char dummy_name[TZNAME_MAX+1]; + getname(dummy_name, &p); + if (p!=s && (*p == '+' || *p == '-' || isdigit(*p) + || !strcmp(dummy_name, "UTC") + || !strcmp(dummy_name, "GMT"))) + posix_form = 1; + } + /* Non-suid can use an absolute tzfile pathname or a relative * pathame beginning with "."; in secure mode, only the * standard path will be searched. */ - if (*s == ':' || ((p=strchr(s, '/')) && !memchr(s, ',', p-s))) { + if (!posix_form) { if (*s == ':') s++; if (*s == '/' || *s == '.') { if (!libc.secure || !strcmp(s, "/etc/localtime")) @@ -281,22 +293,20 @@ static size_t scan_trans(long long t, int local, size_t *alt) n = (index-trans)>>scale; if (a == n-1) return -1; if (a == 0) { - x = zi_read32(trans + (a< +#include #include #include #include "syscall.h" @@ -12,5 +13,11 @@ int nice(int inc) prio += getpriority(PRIO_PROCESS, 0); if (prio > NZERO-1) prio = NZERO-1; if (prio < -NZERO) prio = -NZERO; - return setpriority(PRIO_PROCESS, 0, prio) ? -1 : prio; + if (setpriority(PRIO_PROCESS, 0, prio)) { + if (errno == EACCES) + errno = EPERM; + return -1; + } else { + return prio; + } } diff --git a/src/musl.zig b/src/musl.zig index c576dbec84..d061addc9a 100644 --- a/src/musl.zig +++ b/src/musl.zig @@ -118,7 +118,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { try addSrcFile(arena, &source_table, src_file); } - const time32_compat_arch_list = [_][]const u8{ "arm", "i386", "mips", "powerpc" }; + const time32_compat_arch_list = [_][]const u8{ "arm", "i386", "mips", "powerpc", "m68k" }; for (time32_compat_arch_list) |time32_compat_arch| { if (mem.eql(u8, arch_name, time32_compat_arch)) { for (compat_time32_files) |compat_time32_file| { @@ -766,6 +766,7 @@ const src_files = [_][]const u8{ "musl/src/locale/setlocale.c", "musl/src/locale/strcoll.c", "musl/src/locale/strfmon.c", + "musl/src/locale/strtod_l.c", "musl/src/locale/strxfrm.c", "musl/src/locale/textdomain.c", "musl/src/locale/uselocale.c", @@ -1780,6 +1781,7 @@ const src_files = [_][]const u8{ "musl/src/stdlib/llabs.c", "musl/src/stdlib/lldiv.c", "musl/src/stdlib/qsort.c", + "musl/src/stdlib/qsort_nr.c", "musl/src/stdlib/strtod.c", "musl/src/stdlib/strtol.c", "musl/src/stdlib/wcstod.c", @@ -1990,6 +1992,7 @@ const src_files = [_][]const u8{ "musl/src/thread/pthread_getattr_np.c", "musl/src/thread/pthread_getconcurrency.c", "musl/src/thread/pthread_getcpuclockid.c", + "musl/src/thread/pthread_getname_np.c", "musl/src/thread/pthread_getschedparam.c", "musl/src/thread/pthread_getspecific.c", "musl/src/thread/pthread_join.c", @@ -2208,6 +2211,7 @@ const src_files = [_][]const u8{ "musl/src/unistd/writev.c", "musl/src/unistd/x32/lseek.c", }; + const compat_time32_files = [_][]const u8{ "musl/compat/time32/__xstat.c", "musl/compat/time32/adjtime32.c", diff --git a/tools/gen_stubs.zig b/tools/gen_stubs.zig index 64889a1e72..c77818fdb4 100644 --- a/tools/gen_stubs.zig +++ b/tools/gen_stubs.zig @@ -550,10 +550,17 @@ fn fatal(comptime format: []const u8, args: anytype) noreturn { } const blacklisted_symbols = [_][]const u8{ + "__absvdi2", + "__absvsi2", + "__absvti2", "__adddf3", "__addkf3", + "__addodi4", + "__addosi4", + "__addoti4", "__addsf3", "__addtf3", + "__addxf3", "__ashldi3", "__ashlti3", "__ashrdi3", @@ -602,13 +609,23 @@ const blacklisted_symbols = [_][]const u8{ "__atomic_store_2", "__atomic_store_4", "__atomic_store_8", + "__bswapdi2", + "__bswapsi2", + "__bswapti2", + "__ceilh", + "__ceilx", "__clear_cache", "__clzdi2", "__clzsi2", "__clzti2", "__cmpdf2", + "__cmpdi2", "__cmpsf2", + "__cmpsi2", "__cmptf2", + "__cmpti2", + "__cosh", + "__cosx", "__ctzdi2", "__ctzsi2", "__ctzti2", @@ -621,18 +638,30 @@ const blacklisted_symbols = [_][]const u8{ "__divsi3", "__divtf3", "__divti3", + "__divxf3", "__dlstart", "__eqdf2", "__eqkf2", "__eqsf2", "__eqtf2", + "__eqxf2", + "__exp2h", + "__exp2x", + "__exph", + "__expx", "__extenddfkf2", "__extenddftf2", + "__extenddfxf2", "__extendhfsf2", "__extendhftf2", + "__extendhfxf2", "__extendsfdf2", "__extendsfkf2", "__extendsftf2", + "__extendsfxf2", + "__extendxftf2", + "__fabsh", + "__fabsx", "__ffsdi2", "__ffssi2", "__ffsti2", @@ -658,48 +687,81 @@ const blacklisted_symbols = [_][]const u8{ "__fixunstfdi", "__fixunstfsi", "__fixunstfti", + "__fixunsxfdi", + "__fixunsxfsi", + "__fixunsxfti", + "__fixxfdi", + "__fixxfsi", + "__fixxfti", "__floatdidf", "__floatdikf", "__floatdisf", "__floatditf", + "__floatdixf", "__floatsidf", "__floatsikf", "__floatsisf", "__floatsitf", + "__floatsixf", "__floattidf", "__floattisf", "__floattitf", + "__floattixf", "__floatundidf", "__floatundikf", "__floatundisf", "__floatunditf", + "__floatundixf", "__floatunsidf", "__floatunsikf", "__floatunsisf", "__floatunsitf", + "__floatunsixf", "__floatuntidf", + "__floatuntikf", "__floatuntisf", "__floatuntitf", + "__floatuntixf", + "__floorh", + "__floorx", + "__fmah", + "__fmax", + "__fmaxh", + "__fmaxx", + "__fminh", + "__fminx", + "__fmodh", + "__fmodx", "__gedf2", "__gekf2", "__gesf2", "__getf2", + "__gexf2", "__gnu_f2h_ieee", "__gnu_h2f_ieee", "__gtdf2", "__gtkf2", "__gtsf2", "__gttf2", + "__gtxf2", "__ledf2", "__lekf2", "__lesf2", "__letf2", + "__lexf2", + "__log10h", + "__log10x", + "__log2h", + "__log2x", + "__logh", + "__logx", "__lshrdi3", "__lshrti3", "__ltdf2", "__ltkf2", "__ltsf2", "__lttf2", + "__ltxf2", "__moddi3", "__modsi3", "__modti3", @@ -708,6 +770,7 @@ const blacklisted_symbols = [_][]const u8{ "__muldi3", "__mulkf3", "__mulodi4", + "__mulosi4", "__muloti4", "__mulsc3", "__mulsf3", @@ -716,30 +779,61 @@ const blacklisted_symbols = [_][]const u8{ "__multf3", "__multi3", "__mulxc3", + "__mulxf3", "__nedf2", "__negdf2", + "__negdi2", "__negsf2", + "__negsi2", + "__negti2", + "__negvdi2", + "__negvsi2", + "__negvti2", "__nekf2", "__nesf2", "__netf2", + "__nexf2", "__paritydi2", "__paritysi2", "__parityti2", "__popcountdi2", "__popcountsi2", "__popcountti2", + "__roundh", + "__roundx", + "__sincosh", + "__sincosx", + "__sinh", + "__sinx", + "__sqrth", + "__sqrtx", "__subdf3", "__subkf3", + "__subodi4", + "__subosi4", + "__suboti4", "__subsf3", "__subtf3", + "__subxf3", + "__tanh", + "__tanx", "__truncdfhf2", "__truncdfsf2", + "__trunch", "__trunckfdf2", "__trunckfsf2", "__truncsfhf2", "__trunctfdf2", "__trunctfhf2", "__trunctfsf2", + "__trunctfxf2", + "__truncx", + "__truncxfdf2", + "__truncxfhf2", + "__truncxfsf2", + "__ucmpdi2", + "__ucmpsi2", + "__ucmpti2", "__udivdi3", "__udivmoddi4", "__udivmodsi4", @@ -754,5 +848,23 @@ const blacklisted_symbols = [_][]const u8{ "__unordsf2", "__unordtf2", "__zig_probe_stack", + "ceilf128", + "cosf128", + "exp2f128", + "expf128", + "fabsf128", + "floorf128", + "fmaf128", "fmaq", + "fmaxf128", + "fminf128", + "fmodf128", + "log10f128", + "log2f128", + "logf128", + "roundf128", + "sincosf128", + "sinf128", + "sqrtf128", + "truncf128", };