authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2022-05-03 21:45:20+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2022-05-04 01:00:57+02:00
logf4131cf8a645d7c857fb1c0401000cac0b50080b
tree59b759c00e15760d76eeb4d1f0b0ad3ced0f6b24
parentb6930825b0e59bc355370eb68f5b74868d8aa1d7
signaturelock-open Commit is signed but in an unrecognized format.

musl: update to 1.2.3

This was a bit trickier than it should be due to symbol conflicts with zig's compiler-rt implementation. We attempt to use weak linkage in our compiler-rt, but this does not seem to be working in all cases. I manually disabled export of the problematic compiler-rt math functions in order to cross compile musl's libc.so for all targets as input to `tools/gen_stubs.zig`. Other than that, this update went fairly smoothly. Quite a few additional symbols were added to the blacklist in `tools/gen_stubs.zig` due to recent reorganization of zig's compiler-rt.

163 files changed, 2317 insertions(+), 542 deletions(-)

lib/libc/include/aarch64-linux-musl/bits/hwcap.h+3-1
......@@ -47,4 +47,6 @@
4747#define HWCAP2_I8MM (1 << 13)
4848#define HWCAP2_BF16 (1 << 14)
4949#define HWCAP2_DGH (1 << 15)
50#define HWCAP2_RNG (1 << 16)
\ No newline at end of file
50#define HWCAP2_RNG (1 << 16)
51#define HWCAP2_BTI (1 << 17)
52#define HWCAP2_MTE (1 << 18)
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/mman.h created+2
......@@ -0,0 +1,2 @@
1#define PROT_BTI 0x10
2#define PROT_MTE 0x20
\ No newline at end of file
lib/libc/include/aarch64-linux-musl/bits/syscall.h+13-1
......@@ -293,6 +293,12 @@
293293#define __NR_openat2 437
294294#define __NR_pidfd_getfd 438
295295#define __NR_faccessat2 439
296#define __NR_process_madvise 440
297#define __NR_epoll_pwait2 441
298#define __NR_mount_setattr 442
299#define __NR_landlock_create_ruleset 444
300#define __NR_landlock_add_rule 445
301#define __NR_landlock_restrict_self 446
296302
297303#define SYS_io_setup 0
298304#define SYS_io_destroy 1
......@@ -588,4 +594,10 @@
588594#define SYS_close_range 436
589595#define SYS_openat2 437
590596#define SYS_pidfd_getfd 438
591#define SYS_faccessat2 439
\ No newline at end of file
597#define SYS_faccessat2 439
598#define SYS_process_madvise 440
599#define SYS_epoll_pwait2 441
600#define SYS_mount_setattr 442
601#define SYS_landlock_create_ruleset 444
602#define SYS_landlock_add_rule 445
603#define SYS_landlock_restrict_self 446
\ No newline at end of file
lib/libc/include/arm-linux-musl/bits/syscall.h+13-1
......@@ -393,6 +393,12 @@
393393#define __NR_openat2 437
394394#define __NR_pidfd_getfd 438
395395#define __NR_faccessat2 439
396#define __NR_process_madvise 440
397#define __NR_epoll_pwait2 441
398#define __NR_mount_setattr 442
399#define __NR_landlock_create_ruleset 444
400#define __NR_landlock_add_rule 445
401#define __NR_landlock_restrict_self 446
396402
397403#define __ARM_NR_breakpoint 0x0f0001
398404#define __ARM_NR_cacheflush 0x0f0002
......@@ -795,4 +801,10 @@
795801#define SYS_close_range 436
796802#define SYS_openat2 437
797803#define SYS_pidfd_getfd 438
798#define SYS_faccessat2 439
\ No newline at end of file
804#define SYS_faccessat2 439
805#define SYS_process_madvise 440
806#define SYS_epoll_pwait2 441
807#define SYS_mount_setattr 442
808#define SYS_landlock_create_ruleset 444
809#define SYS_landlock_add_rule 445
810#define SYS_landlock_restrict_self 446
\ No newline at end of file
lib/libc/include/generic-musl/ctype.h+2
......@@ -64,7 +64,9 @@ int isascii(int);
6464int toascii(int);
6565#define _tolower(a) ((a)|0x20)
6666#define _toupper(a) ((a)&0x5f)
67#ifndef __cplusplus
6768#define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
69#endif
6870
6971#endif
7072
lib/libc/include/generic-musl/elf.h+2
......@@ -686,6 +686,8 @@ typedef struct {
686686#define NT_ARM_PAC_MASK 0x406
687687#define NT_ARM_PACA_KEYS 0x407
688688#define NT_ARM_PACG_KEYS 0x408
689#define NT_ARM_TAGGED_ADDR_CTRL 0x409
690#define NT_ARM_PAC_ENABLED_KEYS 0x40a
689691#define NT_METAG_CBUF 0x500
690692#define NT_METAG_RPIPE 0x501
691693#define NT_METAG_TLS 0x502
lib/libc/include/generic-musl/locale.h+3-1
......@@ -7,7 +7,9 @@ extern "C" {
77
88#include <features.h>
99
10#ifdef __cplusplus
10#if __cplusplus >= 201103L
11#define NULL nullptr
12#elif defined(__cplusplus)
1113#define NULL 0L
1214#else
1315#define NULL ((void*)0)
lib/libc/include/generic-musl/netinet/if_ether.h+1
......@@ -66,6 +66,7 @@
6666#define ETH_P_1588 0x88F7
6767#define ETH_P_NCSI 0x88F8
6868#define ETH_P_PRP 0x88FB
69#define ETH_P_CFM 0x8902
6970#define ETH_P_FCOE 0x8906
7071#define ETH_P_TDLS 0x890D
7172#define ETH_P_FIP 0x8914
lib/libc/include/generic-musl/netinet/in.h+1
......@@ -48,6 +48,7 @@ struct ipv6_mreq {
4848#define INADDR_BROADCAST ((in_addr_t) 0xffffffff)
4949#define INADDR_NONE ((in_addr_t) 0xffffffff)
5050#define INADDR_LOOPBACK ((in_addr_t) 0x7f000001)
51#define INADDR_DUMMY ((in_addr_t) 0xc0000008)
5152
5253#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000)
5354#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001)
lib/libc/include/generic-musl/netinet/tcp.h+11
......@@ -80,6 +80,8 @@ enum {
8080 TCP_NLA_SRTT,
8181 TCP_NLA_TIMEOUT_REHASH,
8282 TCP_NLA_BYTES_NOTSENT,
83 TCP_NLA_EDT,
84 TCP_NLA_TTL,
8385};
8486
8587#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
......@@ -281,12 +283,21 @@ struct tcp_repair_window {
281283 uint32_t rcv_wup;
282284};
283285
286#define TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT 0x1
287
284288struct tcp_zerocopy_receive {
285289 uint64_t address;
286290 uint32_t length;
287291 uint32_t recv_skip_hint;
288292 uint32_t inq;
289293 int32_t err;
294 uint64_t copybuf_address;
295 int32_t copybuf_len;
296 uint32_t flags;
297 uint64_t msg_control;
298 uint64_t msg_controllen;
299 uint32_t msg_flags;
300 uint32_t reserved;
290301};
291302
292303#endif
lib/libc/include/generic-musl/pthread.h+1
......@@ -221,6 +221,7 @@ int pthread_getaffinity_np(pthread_t, size_t, struct cpu_set_t *);
221221int pthread_setaffinity_np(pthread_t, size_t, const struct cpu_set_t *);
222222int pthread_getattr_np(pthread_t, pthread_attr_t *);
223223int pthread_setname_np(pthread_t, const char *);
224int pthread_getname_np(pthread_t, char *, size_t);
224225int pthread_getattr_default_np(pthread_attr_t *);
225226int pthread_setattr_default_np(const pthread_attr_t *);
226227int pthread_tryjoin_np(pthread_t, void **);
lib/libc/include/generic-musl/setjmp.h+11-3
......@@ -15,25 +15,33 @@ typedef struct __jmp_buf_tag {
1515 unsigned long __ss[128/sizeof(long)];
1616} jmp_buf[1];
1717
18#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
19#define __setjmp_attr __attribute__((__returns_twice__))
20#else
21#define __setjmp_attr
22#endif
23
1824#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
1925 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
2026 || defined(_BSD_SOURCE)
2127typedef jmp_buf sigjmp_buf;
22int sigsetjmp (sigjmp_buf, int);
28int sigsetjmp (sigjmp_buf, int) __setjmp_attr;
2329_Noreturn void siglongjmp (sigjmp_buf, int);
2430#endif
2531
2632#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
2733 || defined(_BSD_SOURCE)
28int _setjmp (jmp_buf);
34int _setjmp (jmp_buf) __setjmp_attr;
2935_Noreturn void _longjmp (jmp_buf, int);
3036#endif
3137
32int setjmp (jmp_buf);
38int setjmp (jmp_buf) __setjmp_attr;
3339_Noreturn void longjmp (jmp_buf, int);
3440
3541#define setjmp setjmp
3642
43#undef __setjmp_attr
44
3745#ifdef __cplusplus
3846}
3947#endif
lib/libc/include/generic-musl/signal.h+8
......@@ -75,6 +75,8 @@ typedef struct sigaltstack stack_t;
7575#define SEGV_ACCERR 2
7676#define SEGV_BNDERR 3
7777#define SEGV_PKUERR 4
78#define SEGV_MTEAERR 8
79#define SEGV_MTESERR 9
7880
7981#define BUS_ADRALN 1
8082#define BUS_ADRERR 2
......@@ -176,6 +178,9 @@ struct sigaction {
176178#define sa_handler __sa_handler.sa_handler
177179#define sa_sigaction __sa_handler.sa_sigaction
178180
181#define SA_UNSUPPORTED 0x00000400
182#define SA_EXPOSE_TAGBITS 0x00000800
183
179184struct sigevent {
180185 union sigval sigev_value;
181186 int sigev_signo;
......@@ -259,6 +264,9 @@ void (*sigset(int, void (*)(int)))(int);
259264#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
260265#define NSIG _NSIG
261266typedef void (*sig_t)(int);
267
268#define SYS_SECCOMP 1
269#define SYS_USER_DISPATCH 2
262270#endif
263271
264272#ifdef _GNU_SOURCE
lib/libc/include/generic-musl/stdc-predef.h+3
......@@ -7,4 +7,7 @@
77#define __STDC_IEC_559__ 1
88#endif
99
10#define __STDC_UTF_16__ 1
11#define __STDC_UTF_32__ 1
12
1013#endif
\ No newline at end of file
lib/libc/include/generic-musl/stddef.h+3-1
......@@ -1,7 +1,9 @@
11#ifndef _STDDEF_H
22#define _STDDEF_H
33
4#ifdef __cplusplus
4#if __cplusplus >= 201103L
5#define NULL nullptr
6#elif defined(__cplusplus)
57#define NULL 0L
68#else
79#define NULL ((void*)0)
lib/libc/include/generic-musl/stdio.h+3-1
......@@ -25,7 +25,9 @@ extern "C" {
2525
2626#include <bits/alltypes.h>
2727
28#ifdef __cplusplus
28#if __cplusplus >= 201103L
29#define NULL nullptr
30#elif defined(__cplusplus)
2931#define NULL 0L
3032#else
3133#define NULL ((void*)0)
lib/libc/include/generic-musl/stdlib.h+4-1
......@@ -7,7 +7,9 @@ extern "C" {
77
88#include <features.h>
99
10#ifdef __cplusplus
10#if __cplusplus >= 201103L
11#define NULL nullptr
12#elif defined(__cplusplus)
1113#define NULL 0L
1214#else
1315#define NULL ((void*)0)
......@@ -146,6 +148,7 @@ int clearenv(void);
146148#define WCOREDUMP(s) ((s) & 0x80)
147149#define WIFCONTINUED(s) ((s) == 0xffff)
148150void *reallocarray (void *, size_t, size_t);
151void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
149152#endif
150153
151154#ifdef _GNU_SOURCE
lib/libc/include/generic-musl/string.h+3-1
......@@ -7,7 +7,9 @@ extern "C" {
77
88#include <features.h>
99
10#ifdef __cplusplus
10#if __cplusplus >= 201103L
11#define NULL nullptr
12#elif defined(__cplusplus)
1113#define NULL 0L
1214#else
1315#define NULL ((void*)0)
lib/libc/include/generic-musl/sys/membarrier.h+4
......@@ -9,9 +9,13 @@
99#define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED 16
1010#define MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE 32
1111#define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE 64
12#define MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ 128
13#define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ 256
1214
1315#define MEMBARRIER_CMD_SHARED MEMBARRIER_CMD_GLOBAL
1416
17#define MEMBARRIER_CMD_FLAG_CPU 1
18
1519int membarrier(int, int);
1620
1721#endif
\ No newline at end of file
lib/libc/include/generic-musl/sys/mman.h+1
......@@ -40,6 +40,7 @@ extern "C" {
4040
4141#define MAP_HUGE_SHIFT 26
4242#define MAP_HUGE_MASK 0x3f
43#define MAP_HUGE_16KB (14 << 26)
4344#define MAP_HUGE_64KB (16 << 26)
4445#define MAP_HUGE_512KB (19 << 26)
4546#define MAP_HUGE_1MB (20 << 26)
lib/libc/include/generic-musl/sys/mount.h+1
......@@ -31,6 +31,7 @@ extern "C" {
3131#define MS_REMOUNT 32
3232#define MS_MANDLOCK 64
3333#define MS_DIRSYNC 128
34#define MS_NOSYMFOLLOW 256
3435#define MS_NOATIME 1024
3536#define MS_NODIRATIME 2048
3637#define MS_BIND 4096
lib/libc/include/generic-musl/sys/prctl.h+16
......@@ -157,10 +157,26 @@ struct prctl_mm_map {
157157#define PR_SET_TAGGED_ADDR_CTRL 55
158158#define PR_GET_TAGGED_ADDR_CTRL 56
159159#define PR_TAGGED_ADDR_ENABLE (1UL << 0)
160#define PR_MTE_TCF_SHIFT 1
161#define PR_MTE_TCF_NONE (0UL << 1)
162#define PR_MTE_TCF_SYNC (1UL << 1)
163#define PR_MTE_TCF_ASYNC (2UL << 1)
164#define PR_MTE_TCF_MASK (3UL << 1)
165#define PR_MTE_TAG_SHIFT 3
166#define PR_MTE_TAG_MASK (0xffffUL << 3)
160167
161168#define PR_SET_IO_FLUSHER 57
162169#define PR_GET_IO_FLUSHER 58
163170
171#define PR_SET_SYSCALL_USER_DISPATCH 59
172#define PR_SYS_DISPATCH_OFF 0
173#define PR_SYS_DISPATCH_ON 1
174#define SYSCALL_DISPATCH_FILTER_ALLOW 0
175#define SYSCALL_DISPATCH_FILTER_BLOCK 1
176
177#define PR_PAC_SET_ENABLED_KEYS 60
178#define PR_PAC_GET_ENABLED_KEYS 61
179
164180int prctl (int, ...);
165181
166182#ifdef __cplusplus
lib/libc/include/generic-musl/sys/ptrace.h+9
......@@ -42,6 +42,7 @@ extern "C" {
4242#define PTRACE_SECCOMP_GET_FILTER 0x420c
4343#define PTRACE_SECCOMP_GET_METADATA 0x420d
4444#define PTRACE_GET_SYSCALL_INFO 0x420e
45#define PTRACE_GET_RSEQ_CONFIGURATION 0x420f
4546
4647#define PT_READ_I PTRACE_PEEKTEXT
4748#define PT_READ_D PTRACE_PEEKDATA
......@@ -130,6 +131,14 @@ struct __ptrace_syscall_info {
130131 };
131132};
132133
134struct __ptrace_rseq_configuration {
135 uint64_t rseq_abi_pointer;
136 uint32_t rseq_abi_size;
137 uint32_t signature;
138 uint32_t flags;
139 uint32_t pad;
140};
141
133142long ptrace(int, ...);
134143
135144#ifdef __cplusplus
lib/libc/include/generic-musl/sys/socket.h+2
......@@ -289,6 +289,8 @@ struct linger {
289289#define SCM_TXTIME SO_TXTIME
290290#define SO_BINDTOIFINDEX 62
291291#define SO_DETACH_REUSEPORT_BPF 68
292#define SO_PREFER_BUSY_POLL 69
293#define SO_BUSY_POLL_BUDGET 70
292294
293295#ifndef SOL_SOCKET
294296#define SOL_SOCKET 1
lib/libc/include/generic-musl/time.h+3-1
......@@ -7,7 +7,9 @@ extern "C" {
77
88#include <features.h>
99
10#ifdef __cplusplus
10#if __cplusplus >= 201103L
11#define NULL nullptr
12#elif defined(__cplusplus)
1113#define NULL 0L
1214#else
1315#define NULL ((void*)0)
lib/libc/include/generic-musl/unistd.h+5-1
......@@ -14,8 +14,12 @@ extern "C" {
1414#define SEEK_SET 0
1515#define SEEK_CUR 1
1616#define SEEK_END 2
17#define SEEK_DATA 3
18#define SEEK_HOLE 4
1719
18#ifdef __cplusplus
20#if __cplusplus >= 201103L
21#define NULL nullptr
22#elif defined(__cplusplus)
1923#define NULL 0L
2024#else
2125#define NULL ((void*)0)
lib/libc/include/generic-musl/wchar.h+3-1
......@@ -38,7 +38,9 @@ extern "C" {
3838#define WCHAR_MIN (-1-0x7fffffff+L'\0')
3939#endif
4040
41#ifdef __cplusplus
41#if __cplusplus >= 201103L
42#define NULL nullptr
43#elif defined(__cplusplus)
4244#define NULL 0L
4345#else
4446#define NULL ((void*)0)
lib/libc/include/i386-linux-musl/bits/syscall.h+13-1
......@@ -430,6 +430,12 @@
430430#define __NR_openat2 437
431431#define __NR_pidfd_getfd 438
432432#define __NR_faccessat2 439
433#define __NR_process_madvise 440
434#define __NR_epoll_pwait2 441
435#define __NR_mount_setattr 442
436#define __NR_landlock_create_ruleset 444
437#define __NR_landlock_add_rule 445
438#define __NR_landlock_restrict_self 446
433439
434440#define SYS_restart_syscall 0
435441#define SYS_exit 1
......@@ -860,4 +866,10 @@
860866#define SYS_close_range 436
861867#define SYS_openat2 437
862868#define SYS_pidfd_getfd 438
863#define SYS_faccessat2 439
\ No newline at end of file
869#define SYS_faccessat2 439
870#define SYS_process_madvise 440
871#define SYS_epoll_pwait2 441
872#define SYS_mount_setattr 442
873#define SYS_landlock_create_ruleset 444
874#define SYS_landlock_add_rule 445
875#define SYS_landlock_restrict_self 446
\ No newline at end of file
lib/libc/include/m68k-linux-musl/bits/syscall.h+13-1
......@@ -410,6 +410,12 @@
410410#define __NR_openat2 437
411411#define __NR_pidfd_getfd 438
412412#define __NR_faccessat2 439
413#define __NR_process_madvise 440
414#define __NR_epoll_pwait2 441
415#define __NR_mount_setattr 442
416#define __NR_landlock_create_ruleset 444
417#define __NR_landlock_add_rule 445
418#define __NR_landlock_restrict_self 446
413419#define SYS_restart_syscall 0
414420#define SYS_exit 1
415421#define SYS_fork 2
......@@ -821,4 +827,10 @@
821827#define SYS_close_range 436
822828#define SYS_openat2 437
823829#define SYS_pidfd_getfd 438
824#define SYS_faccessat2 439
\ No newline at end of file
830#define SYS_faccessat2 439
831#define SYS_process_madvise 440
832#define SYS_epoll_pwait2 441
833#define SYS_mount_setattr 442
834#define SYS_landlock_create_ruleset 444
835#define SYS_landlock_add_rule 445
836#define SYS_landlock_restrict_self 446
\ No newline at end of file
lib/libc/include/mips-linux-musl/bits/syscall.h+13-1
......@@ -412,6 +412,12 @@
412412#define __NR_openat2 4437
413413#define __NR_pidfd_getfd 4438
414414#define __NR_faccessat2 4439
415#define __NR_process_madvise 4440
416#define __NR_epoll_pwait2 4441
417#define __NR_mount_setattr 4442
418#define __NR_landlock_create_ruleset 4444
419#define __NR_landlock_add_rule 4445
420#define __NR_landlock_restrict_self 4446
415421
416422#define SYS_syscall 4000
417423#define SYS_exit 4001
......@@ -826,4 +832,10 @@
826832#define SYS_close_range 4436
827833#define SYS_openat2 4437
828834#define SYS_pidfd_getfd 4438
829#define SYS_faccessat2 4439
\ No newline at end of file
835#define SYS_faccessat2 4439
836#define SYS_process_madvise 4440
837#define SYS_epoll_pwait2 4441
838#define SYS_mount_setattr 4442
839#define SYS_landlock_create_ruleset 4444
840#define SYS_landlock_add_rule 4445
841#define SYS_landlock_restrict_self 4446
\ No newline at end of file
lib/libc/include/mips64-linux-musl/bits/syscall.h+13-1
......@@ -342,6 +342,12 @@
342342#define __NR_openat2 5437
343343#define __NR_pidfd_getfd 5438
344344#define __NR_faccessat2 5439
345#define __NR_process_madvise 5440
346#define __NR_epoll_pwait2 5441
347#define __NR_mount_setattr 5442
348#define __NR_landlock_create_ruleset 5444
349#define __NR_landlock_add_rule 5445
350#define __NR_landlock_restrict_self 5446
345351
346352#define SYS_read 5000
347353#define SYS_write 5001
......@@ -686,4 +692,10 @@
686692#define SYS_close_range 5436
687693#define SYS_openat2 5437
688694#define SYS_pidfd_getfd 5438
689#define SYS_faccessat2 5439
\ No newline at end of file
695#define SYS_faccessat2 5439
696#define SYS_process_madvise 5440
697#define SYS_epoll_pwait2 5441
698#define SYS_mount_setattr 5442
699#define SYS_landlock_create_ruleset 5444
700#define SYS_landlock_add_rule 5445
701#define SYS_landlock_restrict_self 5446
\ No newline at end of file
lib/libc/include/powerpc-linux-musl/bits/fenv.h+1-1
......@@ -1,4 +1,4 @@
1#ifdef _SOFT_FLOAT
1#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__)
22#define FE_ALL_EXCEPT 0
33#define FE_TONEAREST 0
44#else
lib/libc/include/powerpc-linux-musl/bits/shm.h+1-1
......@@ -8,11 +8,11 @@ struct shmid_ds {
88 unsigned long __shm_dtime_lo;
99 unsigned long __shm_ctime_hi;
1010 unsigned long __shm_ctime_lo;
11 unsigned long __pad1;
1112 size_t shm_segsz;
1213 pid_t shm_cpid;
1314 pid_t shm_lpid;
1415 unsigned long shm_nattch;
15 unsigned long __pad1;
1616 unsigned long __pad2;
1717 time_t shm_atime;
1818 time_t shm_dtime;
lib/libc/include/powerpc-linux-musl/bits/syscall.h+13-1
......@@ -419,6 +419,12 @@
419419#define __NR_openat2 437
420420#define __NR_pidfd_getfd 438
421421#define __NR_faccessat2 439
422#define __NR_process_madvise 440
423#define __NR_epoll_pwait2 441
424#define __NR_mount_setattr 442
425#define __NR_landlock_create_ruleset 444
426#define __NR_landlock_add_rule 445
427#define __NR_landlock_restrict_self 446
422428
423429#define SYS_restart_syscall 0
424430#define SYS_exit 1
......@@ -840,4 +846,10 @@
840846#define SYS_close_range 436
841847#define SYS_openat2 437
842848#define SYS_pidfd_getfd 438
843#define SYS_faccessat2 439
\ No newline at end of file
849#define SYS_faccessat2 439
850#define SYS_process_madvise 440
851#define SYS_epoll_pwait2 441
852#define SYS_mount_setattr 442
853#define SYS_landlock_create_ruleset 444
854#define SYS_landlock_add_rule 445
855#define SYS_landlock_restrict_self 446
\ No newline at end of file
lib/libc/include/powerpc64-linux-musl/bits/syscall.h+13-1
......@@ -391,6 +391,12 @@
391391#define __NR_openat2 437
392392#define __NR_pidfd_getfd 438
393393#define __NR_faccessat2 439
394#define __NR_process_madvise 440
395#define __NR_epoll_pwait2 441
396#define __NR_mount_setattr 442
397#define __NR_landlock_create_ruleset 444
398#define __NR_landlock_add_rule 445
399#define __NR_landlock_restrict_self 446
394400
395401#define SYS_restart_syscall 0
396402#define SYS_exit 1
......@@ -784,4 +790,10 @@
784790#define SYS_close_range 436
785791#define SYS_openat2 437
786792#define SYS_pidfd_getfd 438
787#define SYS_faccessat2 439
\ No newline at end of file
793#define SYS_faccessat2 439
794#define SYS_process_madvise 440
795#define SYS_epoll_pwait2 441
796#define SYS_mount_setattr 442
797#define SYS_landlock_create_ruleset 444
798#define SYS_landlock_add_rule 445
799#define SYS_landlock_restrict_self 446
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/syscall.h+14-2
......@@ -76,7 +76,7 @@
7676#define __NR_splice 76
7777#define __NR_tee 77
7878#define __NR_readlinkat 78
79#define __NR_fstatat 79
79#define __NR_newfstatat 79
8080#define __NR_fstat 80
8181#define __NR_sync 81
8282#define __NR_fsync 82
......@@ -293,6 +293,12 @@
293293#define __NR_openat2 437
294294#define __NR_pidfd_getfd 438
295295#define __NR_faccessat2 439
296#define __NR_process_madvise 440
297#define __NR_epoll_pwait2 441
298#define __NR_mount_setattr 442
299#define __NR_landlock_create_ruleset 444
300#define __NR_landlock_add_rule 445
301#define __NR_landlock_restrict_self 446
296302
297303#define __NR_sysriscv __NR_arch_specific_syscall
298304#define __NR_riscv_flush_icache (__NR_sysriscv + 15)
......@@ -374,7 +380,7 @@
374380#define SYS_splice 76
375381#define SYS_tee 77
376382#define SYS_readlinkat 78
377#define SYS_fstatat 79
383#define SYS_newfstatat 79
378384#define SYS_fstat 80
379385#define SYS_sync 81
380386#define SYS_fsync 82
......@@ -591,5 +597,11 @@
591597#define SYS_openat2 437
592598#define SYS_pidfd_getfd 438
593599#define SYS_faccessat2 439
600#define SYS_process_madvise 440
601#define SYS_epoll_pwait2 441
602#define SYS_mount_setattr 442
603#define SYS_landlock_create_ruleset 444
604#define SYS_landlock_add_rule 445
605#define SYS_landlock_restrict_self 446
594606#define SYS_sysriscv __NR_arch_specific_syscall
595607#define SYS_riscv_flush_icache (__NR_sysriscv + 15)
\ No newline at end of file
lib/libc/include/riscv64-linux-musl/bits/user.h+1
......@@ -1,5 +1,6 @@
11#include <signal.h>
22
33#define ELF_NGREG 32
4#define ELF_NFPREG 33
45typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
56typedef union __riscv_mc_fp_state elf_fpregset_t;
\ No newline at end of file
lib/libc/include/s390x-linux-musl/bits/ptrace.h+3
......@@ -1,4 +1,7 @@
11#define PTRACE_SINGLEBLOCK 12
2#define PTRACE_OLDSETOPTIONS 21
3#define PTRACE_SYSEMU 31
4#define PTRACE_SYSEMU_SINGLESTEP 32
25#define PTRACE_PEEKUSR_AREA 0x5000
36#define PTRACE_POKEUSR_AREA 0x5001
47#define PTRACE_GET_LAST_BREAK 0x5006
lib/libc/include/s390x-linux-musl/bits/syscall.h+13-1
......@@ -356,6 +356,12 @@
356356#define __NR_openat2 437
357357#define __NR_pidfd_getfd 438
358358#define __NR_faccessat2 439
359#define __NR_process_madvise 440
360#define __NR_epoll_pwait2 441
361#define __NR_mount_setattr 442
362#define __NR_landlock_create_ruleset 444
363#define __NR_landlock_add_rule 445
364#define __NR_landlock_restrict_self 446
359365
360366#define SYS_exit 1
361367#define SYS_fork 2
......@@ -714,4 +720,10 @@
714720#define SYS_close_range 436
715721#define SYS_openat2 437
716722#define SYS_pidfd_getfd 438
717#define SYS_faccessat2 439
\ No newline at end of file
723#define SYS_faccessat2 439
724#define SYS_process_madvise 440
725#define SYS_epoll_pwait2 441
726#define SYS_mount_setattr 442
727#define SYS_landlock_create_ruleset 444
728#define SYS_landlock_add_rule 445
729#define SYS_landlock_restrict_self 446
\ No newline at end of file
lib/libc/include/x86_64-linux-musl/bits/syscall.h+13-1
......@@ -349,6 +349,12 @@
349349#define __NR_openat2 437
350350#define __NR_pidfd_getfd 438
351351#define __NR_faccessat2 439
352#define __NR_process_madvise 440
353#define __NR_epoll_pwait2 441
354#define __NR_mount_setattr 442
355#define __NR_landlock_create_ruleset 444
356#define __NR_landlock_add_rule 445
357#define __NR_landlock_restrict_self 446
352358
353359#define SYS_read 0
354360#define SYS_write 1
......@@ -700,4 +706,10 @@
700706#define SYS_close_range 436
701707#define SYS_openat2 437
702708#define SYS_pidfd_getfd 438
703#define SYS_faccessat2 439
\ No newline at end of file
709#define SYS_faccessat2 439
710#define SYS_process_madvise 440
711#define SYS_epoll_pwait2 441
712#define SYS_mount_setattr 442
713#define SYS_landlock_create_ruleset 444
714#define SYS_landlock_add_rule 445
715#define SYS_landlock_restrict_self 446
\ No newline at end of file
lib/libc/musl/COPYRIGHT+4-1
......@@ -127,10 +127,13 @@ Copyright © 2017-2018 Arm Limited
127127and labelled as such in comments in the individual source files. All
128128have been licensed under extremely permissive terms.
129129
130The ARM memcpy code (src/string/arm/memcpy_el.S) is Copyright © 2008
130The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008
131131The Android Open Source Project and is licensed under a two-clause BSD
132132license. It was taken from Bionic libc, used on Android.
133133
134The AArch64 memcpy and memset code (src/string/aarch64/*) are
135Copyright © 1999-2019, Arm Limited.
136
134137The implementation of DES for crypt (src/crypt/crypt_des.c) is
135138Copyright © 1994 David Burren. It is licensed under a BSD license.
136139
lib/libc/musl/arch/aarch64/bits/hwcap.h+2
......@@ -48,3 +48,5 @@
4848#define HWCAP2_BF16 (1 << 14)
4949#define HWCAP2_DGH (1 << 15)
5050#define HWCAP2_RNG (1 << 16)
51#define HWCAP2_BTI (1 << 17)
52#define HWCAP2_MTE (1 << 18)
lib/libc/musl/arch/aarch64/bits/mman.h created+2
......@@ -0,0 +1,2 @@
1#define PROT_BTI 0x10
2#define PROT_MTE 0x20
lib/libc/musl/arch/aarch64/bits/syscall.h.in+6
......@@ -293,4 +293,10 @@
293293#define __NR_openat2 437
294294#define __NR_pidfd_getfd 438
295295#define __NR_faccessat2 439
296#define __NR_process_madvise 440
297#define __NR_epoll_pwait2 441
298#define __NR_mount_setattr 442
299#define __NR_landlock_create_ruleset 444
300#define __NR_landlock_add_rule 445
301#define __NR_landlock_restrict_self 446
296302
lib/libc/musl/arch/arm/bits/syscall.h.in+6
......@@ -393,6 +393,12 @@
393393#define __NR_openat2 437
394394#define __NR_pidfd_getfd 438
395395#define __NR_faccessat2 439
396#define __NR_process_madvise 440
397#define __NR_epoll_pwait2 441
398#define __NR_mount_setattr 442
399#define __NR_landlock_create_ruleset 444
400#define __NR_landlock_add_rule 445
401#define __NR_landlock_restrict_self 446
396402
397403#define __ARM_NR_breakpoint 0x0f0001
398404#define __ARM_NR_cacheflush 0x0f0002
lib/libc/musl/arch/i386/arch.mak created+1
......@@ -0,0 +1 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/musl/arch/i386/bits/syscall.h.in+6
......@@ -430,4 +430,10 @@
430430#define __NR_openat2 437
431431#define __NR_pidfd_getfd 438
432432#define __NR_faccessat2 439
433#define __NR_process_madvise 440
434#define __NR_epoll_pwait2 441
435#define __NR_mount_setattr 442
436#define __NR_landlock_create_ruleset 444
437#define __NR_landlock_add_rule 445
438#define __NR_landlock_restrict_self 446
433439
lib/libc/musl/arch/m68k/arch.mak created+1
......@@ -0,0 +1 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/musl/arch/m68k/atomic_arch.h created+8
......@@ -0,0 +1,8 @@
1#define a_cas a_cas
2static inline int a_cas(volatile int *p, int t, int s)
3{
4 __asm__ __volatile__ (
5 "cas.l %0, %2, (%1)"
6 : "+d"(t) : "a"(p), "d"(s) : "memory", "cc");
7 return t;
8}
lib/libc/musl/arch/m68k/bits/alltypes.h.in created+25
......@@ -0,0 +1,25 @@
1#define _REDIR_TIME64 1
2#define _Addr int
3#define _Int64 long long
4#define _Reg int
5
6#define __BYTE_ORDER 4321
7#define __LONG_MAX 0x7fffffffL
8
9#ifndef __cplusplus
10#ifdef __WCHAR_TYPE__
11TYPEDEF __WCHAR_TYPE__ wchar_t;
12#else
13TYPEDEF long wchar_t;
14#endif
15#endif
16
17#if __mcffpu__
18TYPEDEF float float_t;
19TYPEDEF double double_t;
20#else
21TYPEDEF long double float_t;
22TYPEDEF long double double_t;
23#endif
24
25TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/musl/arch/m68k/bits/fcntl.h created+40
......@@ -0,0 +1,40 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0200000
16#define O_LARGEFILE 0400000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020200000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 8
29#define F_GETOWN 9
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 12
34#define F_SETLK 13
35#define F_SETLKW 14
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
lib/libc/musl/arch/m68k/bits/fenv.h created+29
......@@ -0,0 +1,29 @@
1#if __HAVE_68881__ || __mcffpu__
2
3#define FE_INEXACT 8
4#define FE_DIVBYZERO 16
5#define FE_UNDERFLOW 32
6#define FE_OVERFLOW 64
7#define FE_INVALID 128
8
9#define FE_ALL_EXCEPT 0xf8
10
11#define FE_TONEAREST 0
12#define FE_TOWARDZERO 16
13#define FE_DOWNWARD 32
14#define FE_UPWARD 48
15
16#else
17
18#define FE_ALL_EXCEPT 0
19#define FE_TONEAREST 0
20
21#endif
22
23typedef unsigned fexcept_t;
24
25typedef struct {
26 unsigned __control_register, __status_register, __instruction_address;
27} fenv_t;
28
29#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/musl/arch/m68k/bits/float.h created+39
......@@ -0,0 +1,39 @@
1#if !__mcffpu__
2
3#define FLT_EVAL_METHOD 2
4
5#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
6#define LDBL_MIN 1.68105157155604675313e-4932L
7#define LDBL_MAX 1.1897314953572317650e+4932L
8#define LDBL_EPSILON 1.0842021724855044340e-19L
9
10#define LDBL_MANT_DIG 64
11#define LDBL_MIN_EXP (-16382)
12#define LDBL_MAX_EXP 16384
13
14#define LDBL_DIG 18
15#define LDBL_MIN_10_EXP (-4931)
16#define LDBL_MAX_10_EXP 4932
17
18#define DECIMAL_DIG 21
19
20#else
21
22#define FLT_EVAL_METHOD 0
23
24#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
25#define LDBL_MIN 2.22507385850720138309e-308L
26#define LDBL_MAX 1.79769313486231570815e+308L
27#define LDBL_EPSILON 2.22044604925031308085e-16L
28
29#define LDBL_MANT_DIG 53
30#define LDBL_MIN_EXP (-1021)
31#define LDBL_MAX_EXP 1024
32
33#define LDBL_DIG 15
34#define LDBL_MIN_10_EXP (-307)
35#define LDBL_MAX_10_EXP 308
36
37#define DECIMAL_DIG 17
38
39#endif
lib/libc/musl/arch/m68k/bits/ipcstat.h created+1
......@@ -0,0 +1 @@
1#define IPC_STAT 0x102
lib/libc/musl/arch/m68k/bits/msg.h created+18
......@@ -0,0 +1,18 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 unsigned long __msg_stime_lo;
4 unsigned long __msg_stime_hi;
5 unsigned long __msg_rtime_lo;
6 unsigned long __msg_rtime_hi;
7 unsigned long __msg_ctime_lo;
8 unsigned long __msg_ctime_hi;
9 unsigned long msg_cbytes;
10 msgqnum_t msg_qnum;
11 msglen_t msg_qbytes;
12 pid_t msg_lspid;
13 pid_t msg_lrpid;
14 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
18};
lib/libc/musl/arch/m68k/bits/posix.h created+2
......@@ -0,0 +1,2 @@
1#define _POSIX_V6_ILP32_OFFBIG 1
2#define _POSIX_V7_ILP32_OFFBIG 1
lib/libc/musl/arch/m68k/bits/ptrace.h created+2
......@@ -0,0 +1,2 @@
1#define PTRACE_GET_THREAD_AREA 25
2#define PTRACE_SINGLEBLOCK 33
lib/libc/musl/arch/m68k/bits/reg.h created+45
......@@ -0,0 +1,45 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3#define PT_D1 0
4#define PT_D2 1
5#define PT_D3 2
6#define PT_D4 3
7#define PT_D5 4
8#define PT_D6 5
9#define PT_D7 6
10#define PT_A0 7
11#define PT_A1 8
12#define PT_A2 9
13#define PT_A3 10
14#define PT_A4 11
15#define PT_A5 12
16#define PT_A6 13
17#define PT_D0 14
18#define PT_USP 15
19#define PT_ORIG_D0 16
20#define PT_SR 17
21#define PT_PC 18
22
23#if __mcffpu__
24#define PT_FP0 21
25#define PT_FP1 23
26#define PT_FP2 25
27#define PT_FP3 27
28#define PT_FP4 29
29#define PT_FP5 31
30#define PT_FP6 33
31#define PT_FP7 35
32#else
33#define PT_FP0 21
34#define PT_FP1 24
35#define PT_FP2 27
36#define PT_FP3 30
37#define PT_FP4 33
38#define PT_FP5 36
39#define PT_FP6 39
40#define PT_FP7 42
41#endif
42
43#define PT_FPCR 45
44#define PT_FPSR 46
45#define PT_FPIAR 47
lib/libc/musl/arch/m68k/bits/sem.h created+13
......@@ -0,0 +1,13 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
7 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
8 unsigned short sem_nsems;
9 long __unused3;
10 long __unused4;
11 time_t sem_otime;
12 time_t sem_ctime;
13};
lib/libc/musl/arch/m68k/bits/setjmp.h created+1
......@@ -0,0 +1 @@
1typedef unsigned long __jmp_buf[39];
lib/libc/musl/arch/m68k/bits/shm.h created+31
......@@ -0,0 +1,31 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_atime_hi;
8 unsigned long __shm_dtime_lo;
9 unsigned long __shm_dtime_hi;
10 unsigned long __shm_ctime_lo;
11 unsigned long __shm_ctime_hi;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
21};
22
23struct shminfo {
24 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
25};
26
27struct shm_info {
28 int __used_ids;
29 unsigned long shm_tot, shm_rss, shm_swp;
30 unsigned long __swap_attempts, __swap_successes;
31};
lib/libc/musl/arch/m68k/bits/signal.h created+140
......@@ -0,0 +1,140 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#ifdef _GNU_SOURCE
10enum { R_D0 = 0 };
11#define R_D0 R_D0
12enum { R_D1 = 1 };
13#define R_D1 R_D1
14enum { R_D2 = 2 };
15#define R_D2 R_D2
16enum { R_D3 = 3 };
17#define R_D3 R_D3
18enum { R_D4 = 4 };
19#define R_D4 R_D4
20enum { R_D5 = 5 };
21#define R_D5 R_D5
22enum { R_D6 = 6 };
23#define R_D6 R_D6
24enum { R_D7 = 7 };
25#define R_D7 R_D7
26enum { R_A0 = 8 };
27#define R_A0 R_A0
28enum { R_A1 = 9 };
29#define R_A1 R_A1
30enum { R_A2 = 10 };
31#define R_A2 R_A2
32enum { R_A3 = 11 };
33#define R_A3 R_A3
34enum { R_A4 = 12 };
35#define R_A4 R_A4
36enum { R_A5 = 13 };
37#define R_A5 R_A5
38enum { R_A6 = 14 };
39#define R_A6 R_A6
40enum { R_A7 = 15 };
41#define R_A7 R_A7
42enum { R_SP = 15 };
43#define R_SP R_SP
44enum { R_PC = 16 };
45#define R_PC R_PC
46enum { R_PS = 17 };
47#define R_PS R_PS
48#endif
49
50#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
51
52struct sigcontext {
53 unsigned long sc_mask, sc_usp, sc_d0, sc_d1, sc_a0, sc_a1;
54 unsigned short sc_sr;
55 unsigned long sc_pc;
56 unsigned short sc_formatvec;
57 unsigned long sc_fpregs[6], sc_fpcntl[3];
58 unsigned char sc_fpstate[216];
59};
60
61typedef int greg_t, gregset_t[18];
62typedef struct {
63 int f_pcr, f_psr, f_fpiaddr, f_fpregs[8][3];
64} fpregset_t;
65
66typedef struct {
67 int version;
68 gregset_t gregs;
69 fpregset_t fpregs;
70} mcontext_t;
71#else
72typedef struct {
73 int __version;
74 int __gregs[18];
75 int __fpregs[27];
76} mcontext_t;
77#endif
78
79struct sigaltstack {
80 void *ss_sp;
81 int ss_flags;
82 size_t ss_size;
83};
84
85typedef struct __ucontext {
86 unsigned long uc_flags;
87 struct __ucontext *uc_link;
88 stack_t uc_stack;
89 mcontext_t uc_mcontext;
90 long __reserved[80];
91 sigset_t uc_sigmask;
92} ucontext_t;
93
94#define SA_NOCLDSTOP 1
95#define SA_NOCLDWAIT 2
96#define SA_SIGINFO 4
97#define SA_ONSTACK 0x08000000
98#define SA_RESTART 0x10000000
99#define SA_NODEFER 0x40000000
100#define SA_RESETHAND 0x80000000
101#define SA_RESTORER 0x04000000
102
103#endif
104
105#define SIGHUP 1
106#define SIGINT 2
107#define SIGQUIT 3
108#define SIGILL 4
109#define SIGTRAP 5
110#define SIGABRT 6
111#define SIGIOT SIGABRT
112#define SIGBUS 7
113#define SIGFPE 8
114#define SIGKILL 9
115#define SIGUSR1 10
116#define SIGSEGV 11
117#define SIGUSR2 12
118#define SIGPIPE 13
119#define SIGALRM 14
120#define SIGTERM 15
121#define SIGSTKFLT 16
122#define SIGCHLD 17
123#define SIGCONT 18
124#define SIGSTOP 19
125#define SIGTSTP 20
126#define SIGTTIN 21
127#define SIGTTOU 22
128#define SIGURG 23
129#define SIGXCPU 24
130#define SIGXFSZ 25
131#define SIGVTALRM 26
132#define SIGPROF 27
133#define SIGWINCH 28
134#define SIGIO 29
135#define SIGPOLL 29
136#define SIGPWR 30
137#define SIGSYS 31
138#define SIGUNUSED SIGSYS
139
140#define _NSIG 65
lib/libc/musl/arch/m68k/bits/stat.h created+25
......@@ -0,0 +1,25 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3
4struct stat {
5 dev_t st_dev;
6 short __st_dev_padding;
7 long __st_ino_truncated;
8 mode_t st_mode;
9 nlink_t st_nlink;
10 uid_t st_uid;
11 gid_t st_gid;
12 dev_t st_rdev;
13 short __st_rdev_padding;
14 off_t st_size;
15 blksize_t st_blksize;
16 blkcnt_t st_blocks;
17 struct {
18 long tv_sec;
19 long tv_nsec;
20 } __st_atim32, __st_mtim32, __st_ctim32;
21 ino_t st_ino;
22 struct timespec st_atim;
23 struct timespec st_mtim;
24 struct timespec st_ctim;
25};
lib/libc/musl/arch/m68k/bits/stdint.h created+20
......@@ -0,0 +1,20 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT32_MIN
16#define INTPTR_MAX INT32_MAX
17#define UINTPTR_MAX UINT32_MAX
18#define PTRDIFF_MIN INT32_MIN
19#define PTRDIFF_MAX INT32_MAX
20#define SIZE_MAX UINT32_MAX
lib/libc/musl/arch/m68k/bits/syscall.h.in created+418
......@@ -0,0 +1,418 @@
1#define __NR_restart_syscall 0
2#define __NR_exit 1
3#define __NR_fork 2
4#define __NR_read 3
5#define __NR_write 4
6#define __NR_open 5
7#define __NR_close 6
8#define __NR_waitpid 7
9#define __NR_creat 8
10#define __NR_link 9
11#define __NR_unlink 10
12#define __NR_execve 11
13#define __NR_chdir 12
14#define __NR_time 13
15#define __NR_mknod 14
16#define __NR_chmod 15
17#define __NR_chown 16
18#define __NR_oldstat 18
19#define __NR_lseek 19
20#define __NR_getpid 20
21#define __NR_mount 21
22#define __NR_umount 22
23#define __NR_setuid 23
24#define __NR_getuid 24
25#define __NR_stime 25
26#define __NR_ptrace 26
27#define __NR_alarm 27
28#define __NR_oldfstat 28
29#define __NR_pause 29
30#define __NR_utime 30
31#define __NR_access 33
32#define __NR_nice 34
33#define __NR_sync 36
34#define __NR_kill 37
35#define __NR_rename 38
36#define __NR_mkdir 39
37#define __NR_rmdir 40
38#define __NR_dup 41
39#define __NR_pipe 42
40#define __NR_times 43
41#define __NR_brk 45
42#define __NR_setgid 46
43#define __NR_getgid 47
44#define __NR_signal 48
45#define __NR_geteuid 49
46#define __NR_getegid 50
47#define __NR_acct 51
48#define __NR_umount2 52
49#define __NR_ioctl 54
50#define __NR_fcntl 55
51#define __NR_setpgid 57
52#define __NR_umask 60
53#define __NR_chroot 61
54#define __NR_ustat 62
55#define __NR_dup2 63
56#define __NR_getppid 64
57#define __NR_getpgrp 65
58#define __NR_setsid 66
59#define __NR_sigaction 67
60#define __NR_sgetmask 68
61#define __NR_ssetmask 69
62#define __NR_setreuid 70
63#define __NR_setregid 71
64#define __NR_sigsuspend 72
65#define __NR_sigpending 73
66#define __NR_sethostname 74
67#define __NR_setrlimit 75
68#define __NR_getrlimit 76
69#define __NR_getrusage 77
70#define __NR_gettimeofday_time32 78
71#define __NR_settimeofday_time32 79
72#define __NR_getgroups 80
73#define __NR_setgroups 81
74#define __NR_select 82
75#define __NR_symlink 83
76#define __NR_oldlstat 84
77#define __NR_readlink 85
78#define __NR_uselib 86
79#define __NR_swapon 87
80#define __NR_reboot 88
81#define __NR_readdir 89
82#define __NR_mmap 90
83#define __NR_munmap 91
84#define __NR_truncate 92
85#define __NR_ftruncate 93
86#define __NR_fchmod 94
87#define __NR_fchown 95
88#define __NR_getpriority 96
89#define __NR_setpriority 97
90#define __NR_statfs 99
91#define __NR_fstatfs 100
92#define __NR_socketcall 102
93#define __NR_syslog 103
94#define __NR_setitimer 104
95#define __NR_getitimer 105
96#define __NR_stat 106
97#define __NR_lstat 107
98#define __NR_fstat 108
99#define __NR_vhangup 111
100#define __NR_wait4 114
101#define __NR_swapoff 115
102#define __NR_sysinfo 116
103#define __NR_ipc 117
104#define __NR_fsync 118
105#define __NR_sigreturn 119
106#define __NR_clone 120
107#define __NR_setdomainname 121
108#define __NR_uname 122
109#define __NR_cacheflush 123
110#define __NR_adjtimex 124
111#define __NR_mprotect 125
112#define __NR_sigprocmask 126
113#define __NR_create_module 127
114#define __NR_init_module 128
115#define __NR_delete_module 129
116#define __NR_get_kernel_syms 130
117#define __NR_quotactl 131
118#define __NR_getpgid 132
119#define __NR_fchdir 133
120#define __NR_bdflush 134
121#define __NR_sysfs 135
122#define __NR_personality 136
123#define __NR_setfsuid 138
124#define __NR_setfsgid 139
125#define __NR__llseek 140
126#define __NR_getdents 141
127#define __NR__newselect 142
128#define __NR_flock 143
129#define __NR_msync 144
130#define __NR_readv 145
131#define __NR_writev 146
132#define __NR_getsid 147
133#define __NR_fdatasync 148
134#define __NR__sysctl 149
135#define __NR_mlock 150
136#define __NR_munlock 151
137#define __NR_mlockall 152
138#define __NR_munlockall 153
139#define __NR_sched_setparam 154
140#define __NR_sched_getparam 155
141#define __NR_sched_setscheduler 156
142#define __NR_sched_getscheduler 157
143#define __NR_sched_yield 158
144#define __NR_sched_get_priority_max 159
145#define __NR_sched_get_priority_min 160
146#define __NR_sched_rr_get_interval 161
147#define __NR_nanosleep 162
148#define __NR_mremap 163
149#define __NR_setresuid 164
150#define __NR_getresuid 165
151#define __NR_getpagesize 166
152#define __NR_query_module 167
153#define __NR_poll 168
154#define __NR_nfsservctl 169
155#define __NR_setresgid 170
156#define __NR_getresgid 171
157#define __NR_prctl 172
158#define __NR_rt_sigreturn 173
159#define __NR_rt_sigaction 174
160#define __NR_rt_sigprocmask 175
161#define __NR_rt_sigpending 176
162#define __NR_rt_sigtimedwait 177
163#define __NR_rt_sigqueueinfo 178
164#define __NR_rt_sigsuspend 179
165#define __NR_pread64 180
166#define __NR_pwrite64 181
167#define __NR_lchown 182
168#define __NR_getcwd 183
169#define __NR_capget 184
170#define __NR_capset 185
171#define __NR_sigaltstack 186
172#define __NR_sendfile 187
173#define __NR_getpmsg 188
174#define __NR_putpmsg 189
175#define __NR_vfork 190
176#define __NR_ugetrlimit 191
177#define __NR_mmap2 192
178#define __NR_truncate64 193
179#define __NR_ftruncate64 194
180#define __NR_stat64 195
181#define __NR_lstat64 196
182#define __NR_fstat64 197
183#define __NR_chown32 198
184#define __NR_getuid32 199
185#define __NR_getgid32 200
186#define __NR_geteuid32 201
187#define __NR_getegid32 202
188#define __NR_setreuid32 203
189#define __NR_setregid32 204
190#define __NR_getgroups32 205
191#define __NR_setgroups32 206
192#define __NR_fchown32 207
193#define __NR_setresuid32 208
194#define __NR_getresuid32 209
195#define __NR_setresgid32 210
196#define __NR_getresgid32 211
197#define __NR_lchown32 212
198#define __NR_setuid32 213
199#define __NR_setgid32 214
200#define __NR_setfsuid32 215
201#define __NR_setfsgid32 216
202#define __NR_pivot_root 217
203#define __NR_getdents64 220
204#define __NR_gettid 221
205#define __NR_tkill 222
206#define __NR_setxattr 223
207#define __NR_lsetxattr 224
208#define __NR_fsetxattr 225
209#define __NR_getxattr 226
210#define __NR_lgetxattr 227
211#define __NR_fgetxattr 228
212#define __NR_listxattr 229
213#define __NR_llistxattr 230
214#define __NR_flistxattr 231
215#define __NR_removexattr 232
216#define __NR_lremovexattr 233
217#define __NR_fremovexattr 234
218#define __NR_futex 235
219#define __NR_sendfile64 236
220#define __NR_mincore 237
221#define __NR_madvise 238
222#define __NR_fcntl64 239
223#define __NR_readahead 240
224#define __NR_io_setup 241
225#define __NR_io_destroy 242
226#define __NR_io_getevents 243
227#define __NR_io_submit 244
228#define __NR_io_cancel 245
229#define __NR_fadvise64 246
230#define __NR_exit_group 247
231#define __NR_lookup_dcookie 248
232#define __NR_epoll_create 249
233#define __NR_epoll_ctl 250
234#define __NR_epoll_wait 251
235#define __NR_remap_file_pages 252
236#define __NR_set_tid_address 253
237#define __NR_timer_create 254
238#define __NR_timer_settime32 255
239#define __NR_timer_gettime32 256
240#define __NR_timer_getoverrun 257
241#define __NR_timer_delete 258
242#define __NR_clock_settime32 259
243#define __NR_clock_gettime32 260
244#define __NR_clock_getres_time32 261
245#define __NR_clock_nanosleep_time32 262
246#define __NR_statfs64 263
247#define __NR_fstatfs64 264
248#define __NR_tgkill 265
249#define __NR_utimes 266
250#define __NR_fadvise64_64 267
251#define __NR_mbind 268
252#define __NR_get_mempolicy 269
253#define __NR_set_mempolicy 270
254#define __NR_mq_open 271
255#define __NR_mq_unlink 272
256#define __NR_mq_timedsend 273
257#define __NR_mq_timedreceive 274
258#define __NR_mq_notify 275
259#define __NR_mq_getsetattr 276
260#define __NR_waitid 277
261#define __NR_add_key 279
262#define __NR_request_key 280
263#define __NR_keyctl 281
264#define __NR_ioprio_set 282
265#define __NR_ioprio_get 283
266#define __NR_inotify_init 284
267#define __NR_inotify_add_watch 285
268#define __NR_inotify_rm_watch 286
269#define __NR_migrate_pages 287
270#define __NR_openat 288
271#define __NR_mkdirat 289
272#define __NR_mknodat 290
273#define __NR_fchownat 291
274#define __NR_futimesat 292
275#define __NR_fstatat64 293
276#define __NR_unlinkat 294
277#define __NR_renameat 295
278#define __NR_linkat 296
279#define __NR_symlinkat 297
280#define __NR_readlinkat 298
281#define __NR_fchmodat 299
282#define __NR_faccessat 300
283#define __NR_pselect6 301
284#define __NR_ppoll 302
285#define __NR_unshare 303
286#define __NR_set_robust_list 304
287#define __NR_get_robust_list 305
288#define __NR_splice 306
289#define __NR_sync_file_range 307
290#define __NR_tee 308
291#define __NR_vmsplice 309
292#define __NR_move_pages 310
293#define __NR_sched_setaffinity 311
294#define __NR_sched_getaffinity 312
295#define __NR_kexec_load 313
296#define __NR_getcpu 314
297#define __NR_epoll_pwait 315
298#define __NR_utimensat 316
299#define __NR_signalfd 317
300#define __NR_timerfd_create 318
301#define __NR_eventfd 319
302#define __NR_fallocate 320
303#define __NR_timerfd_settime32 321
304#define __NR_timerfd_gettime32 322
305#define __NR_signalfd4 323
306#define __NR_eventfd2 324
307#define __NR_epoll_create1 325
308#define __NR_dup3 326
309#define __NR_pipe2 327
310#define __NR_inotify_init1 328
311#define __NR_preadv 329
312#define __NR_pwritev 330
313#define __NR_rt_tgsigqueueinfo 331
314#define __NR_perf_event_open 332
315#define __NR_get_thread_area 333
316#define __NR_set_thread_area 334
317#define __NR_atomic_cmpxchg_32 335
318#define __NR_atomic_barrier 336
319#define __NR_fanotify_init 337
320#define __NR_fanotify_mark 338
321#define __NR_prlimit64 339
322#define __NR_name_to_handle_at 340
323#define __NR_open_by_handle_at 341
324#define __NR_clock_adjtime 342
325#define __NR_syncfs 343
326#define __NR_setns 344
327#define __NR_process_vm_readv 345
328#define __NR_process_vm_writev 346
329#define __NR_kcmp 347
330#define __NR_finit_module 348
331#define __NR_sched_setattr 349
332#define __NR_sched_getattr 350
333#define __NR_renameat2 351
334#define __NR_getrandom 352
335#define __NR_memfd_create 353
336#define __NR_bpf 354
337#define __NR_execveat 355
338#define __NR_socket 356
339#define __NR_socketpair 357
340#define __NR_bind 358
341#define __NR_connect 359
342#define __NR_listen 360
343#define __NR_accept4 361
344#define __NR_getsockopt 362
345#define __NR_setsockopt 363
346#define __NR_getsockname 364
347#define __NR_getpeername 365
348#define __NR_sendto 366
349#define __NR_sendmsg 367
350#define __NR_recvfrom 368
351#define __NR_recvmsg 369
352#define __NR_shutdown 370
353#define __NR_recvmmsg 371
354#define __NR_sendmmsg 372
355#define __NR_userfaultfd 373
356#define __NR_membarrier 374
357#define __NR_mlock2 375
358#define __NR_copy_file_range 376
359#define __NR_preadv2 377
360#define __NR_pwritev2 378
361#define __NR_statx 379
362#define __NR_seccomp 380
363#define __NR_pkey_mprotect 381
364#define __NR_pkey_alloc 382
365#define __NR_pkey_free 383
366#define __NR_rseq 384
367#define __NR_semget 393
368#define __NR_semctl 394
369#define __NR_shmget 395
370#define __NR_shmctl 396
371#define __NR_shmat 397
372#define __NR_shmdt 398
373#define __NR_msgget 399
374#define __NR_msgsnd 400
375#define __NR_msgrcv 401
376#define __NR_msgctl 402
377#define __NR_clock_gettime64 403
378#define __NR_clock_settime64 404
379#define __NR_clock_adjtime64 405
380#define __NR_clock_getres_time64 406
381#define __NR_clock_nanosleep_time64 407
382#define __NR_timer_gettime64 408
383#define __NR_timer_settime64 409
384#define __NR_timerfd_gettime64 410
385#define __NR_timerfd_settime64 411
386#define __NR_utimensat_time64 412
387#define __NR_pselect6_time64 413
388#define __NR_ppoll_time64 414
389#define __NR_io_pgetevents_time64 416
390#define __NR_recvmmsg_time64 417
391#define __NR_mq_timedsend_time64 418
392#define __NR_mq_timedreceive_time64 419
393#define __NR_semtimedop_time64 420
394#define __NR_rt_sigtimedwait_time64 421
395#define __NR_futex_time64 422
396#define __NR_sched_rr_get_interval_time64 423
397#define __NR_pidfd_send_signal 424
398#define __NR_io_uring_setup 425
399#define __NR_io_uring_enter 426
400#define __NR_io_uring_register 427
401#define __NR_open_tree 428
402#define __NR_move_mount 429
403#define __NR_fsopen 430
404#define __NR_fsconfig 431
405#define __NR_fsmount 432
406#define __NR_fspick 433
407#define __NR_pidfd_open 434
408#define __NR_clone3 435
409#define __NR_close_range 436
410#define __NR_openat2 437
411#define __NR_pidfd_getfd 438
412#define __NR_faccessat2 439
413#define __NR_process_madvise 440
414#define __NR_epoll_pwait2 441
415#define __NR_mount_setattr 442
416#define __NR_landlock_create_ruleset 444
417#define __NR_landlock_add_rule 445
418#define __NR_landlock_restrict_self 446
lib/libc/musl/arch/m68k/bits/user.h created+38
......@@ -0,0 +1,38 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3
4struct user_m68kfp_struct {
5 unsigned long fpregs[24], fpcntl[3];
6};
7
8struct user_regs_struct {
9 long d1, d2, d3, d4, d5, d6, d7;
10 long a0, a1, a2, a3, a4, a5, a6;
11 long d0, usp, orig_d0;
12 short stkadj, sr;
13 long pc;
14 short fmtvec, __pad;
15};
16
17struct user {
18 struct user_regs_struct regs;
19 int u_fpvalid;
20 struct user_m68kfp_struct m68kfp;
21 unsigned long u_tsize, u_dsize, u_ssize, start_code, start_stack;
22 long signal;
23 int reserved;
24 unsigned long u_ar0;
25 struct user_m68kfp_struct *u_fpstate;
26 unsigned long magic;
27 char u_comm[32];
28};
29
30#define ELF_NGREG 20
31typedef unsigned long elf_greg_t;
32typedef elf_greg_t elf_gregset_t[ELF_NGREG];
33typedef struct user_m68kfp_struct elf_fpregset_t;
34
35#define NBPG 4096
36#define UPAGES 1
37#define HOST_TEXT_START_ADDR (u.start_code)
38#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
lib/libc/musl/arch/m68k/crt_arch.h created+14
......@@ -0,0 +1,14 @@
1__asm__(
2".text\n"
3".weak _DYNAMIC \n"
4".hidden _DYNAMIC \n"
5".global " START "\n"
6START ":\n"
7" suba.l %fp,%fp \n"
8" movea.l %sp,%a0 \n"
9" lea _DYNAMIC-.-8,%a1 \n"
10" pea (%pc,%a1) \n"
11" pea (%a0) \n"
12" lea " START "_c-.-8,%a1 \n"
13" jsr (%pc,%a1) \n"
14);
lib/libc/musl/arch/m68k/kstat.h created+21
......@@ -0,0 +1,21 @@
1struct kstat {
2 dev_t st_dev;
3 short __st_dev_padding;
4 long __st_ino_truncated;
5 mode_t st_mode;
6 nlink_t st_nlink;
7 uid_t st_uid;
8 gid_t st_gid;
9 dev_t st_rdev;
10 short __st_rdev_padding;
11 off_t st_size;
12 blksize_t st_blksize;
13 blkcnt_t st_blocks;
14 long st_atime_sec;
15 long st_atime_nsec;
16 long st_mtime_sec;
17 long st_mtime_nsec;
18 long st_ctime_sec;
19 long st_ctime_nsec;
20 ino_t st_ino;
21};
lib/libc/musl/arch/m68k/pthread_arch.h created+12
......@@ -0,0 +1,12 @@
1static inline uintptr_t __get_tp()
2{
3 return __syscall(SYS_get_thread_area);
4}
5
6#define TLS_ABOVE_TP
7#define GAP_ABOVE_TP 0
8
9#define TP_OFFSET 0x7000
10#define DTP_OFFSET 0x8000
11
12#define MC_PC gregs[R_PC]
lib/libc/musl/arch/m68k/reloc.h created+30
......@@ -0,0 +1,30 @@
1#if __HAVE_68881__
2#define FP_SUFFIX ""
3#elif __mcffpu__
4#define FP_SUFFIX "-fp64"
5#else
6#define FP_SUFFIX "-sf"
7#endif
8
9#define LDSO_ARCH "m68k" FP_SUFFIX
10
11#define TPOFF_K (-0x7000)
12
13#define REL_SYMBOLIC R_68K_32
14#define REL_OFFSET R_68K_PC32
15#define REL_GOT R_68K_GLOB_DAT
16#define REL_PLT R_68K_JMP_SLOT
17#define REL_RELATIVE R_68K_RELATIVE
18#define REL_COPY R_68K_COPY
19#define REL_DTPMOD R_68K_TLS_DTPMOD32
20#define REL_DTPOFF R_68K_TLS_DTPREL32
21#define REL_TPOFF R_68K_TLS_TPREL32
22
23#define CRTJMP(pc,sp) __asm__ __volatile__( \
24 "move.l %1,%%sp ; jmp (%0)" : : "r"(pc), "r"(sp) : "memory" )
25
26#define GETFUNCSYM(fp, sym, got) __asm__ ( \
27 ".hidden " #sym "\n" \
28 "lea " #sym "-.-8,%0 \n" \
29 "lea (%%pc,%0),%0 \n" \
30 : "=a"(*fp) : : "memory" )
lib/libc/musl/arch/m68k/syscall_arch.h created+90
......@@ -0,0 +1,90 @@
1#define __SYSCALL_LL_E(x) \
2((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
3((union { long long ll; long l[2]; }){ .ll = x }).l[1]
4#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
5
6static __inline long __syscall0(long n)
7{
8 register unsigned long d0 __asm__("d0") = n;
9 __asm__ __volatile__ ("trap #0" : "+r"(d0)
10 :
11 : "memory");
12 return d0;
13}
14
15static inline long __syscall1(long n, long a)
16{
17 register unsigned long d0 __asm__("d0") = n;
18 register unsigned long d1 __asm__("d1") = a;
19 __asm__ __volatile__ ("trap #0" : "+r"(d0)
20 : "r"(d1)
21 : "memory");
22 return d0;
23}
24
25static inline long __syscall2(long n, long a, long b)
26{
27 register unsigned long d0 __asm__("d0") = n;
28 register unsigned long d1 __asm__("d1") = a;
29 register unsigned long d2 __asm__("d2") = b;
30 __asm__ __volatile__ ("trap #0" : "+r"(d0)
31 : "r"(d1), "r"(d2)
32 : "memory");
33 return d0;
34}
35
36static inline long __syscall3(long n, long a, long b, long c)
37{
38 register unsigned long d0 __asm__("d0") = n;
39 register unsigned long d1 __asm__("d1") = a;
40 register unsigned long d2 __asm__("d2") = b;
41 register unsigned long d3 __asm__("d3") = c;
42 __asm__ __volatile__ ("trap #0" : "+r"(d0)
43 : "r"(d1), "r"(d2), "r"(d3)
44 : "memory");
45 return d0;
46}
47
48static inline long __syscall4(long n, long a, long b, long c, long d)
49{
50 register unsigned long d0 __asm__("d0") = n;
51 register unsigned long d1 __asm__("d1") = a;
52 register unsigned long d2 __asm__("d2") = b;
53 register unsigned long d3 __asm__("d3") = c;
54 register unsigned long d4 __asm__("d4") = d;
55 __asm__ __volatile__ ("trap #0" : "+r"(d0)
56 : "r"(d1), "r"(d2), "r"(d3), "r"(d4)
57 : "memory");
58 return d0;
59}
60
61static inline long __syscall5(long n, long a, long b, long c, long d, long e)
62{
63 register unsigned long d0 __asm__("d0") = n;
64 register unsigned long d1 __asm__("d1") = a;
65 register unsigned long d2 __asm__("d2") = b;
66 register unsigned long d3 __asm__("d3") = c;
67 register unsigned long d4 __asm__("d4") = d;
68 register unsigned long d5 __asm__("d5") = e;
69 __asm__ __volatile__ ("trap #0" : "+r"(d0)
70 : "r"(d1), "r"(d2), "r"(d3), "r"(d4), "r"(d5)
71 : "memory");
72 return d0;
73}
74
75static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
76{
77 register unsigned long d0 __asm__("d0") = n;
78 register unsigned long d1 __asm__("d1") = a;
79 register unsigned long d2 __asm__("d2") = b;
80 register unsigned long d3 __asm__("d3") = c;
81 register unsigned long d4 __asm__("d4") = d;
82 register unsigned long d5 __asm__("d5") = e;
83 register unsigned long a0 __asm__("a0") = f;
84 __asm__ __volatile__ ("trap #0" : "+r"(d0)
85 : "r"(d1), "r"(d2), "r"(d3), "r"(d4), "r"(d5), "r"(a0)
86 : "memory");
87 return d0;
88}
89
90#define SYSCALL_IPC_BROKEN_MODE
lib/libc/musl/arch/mips/arch.mak created+1
......@@ -0,0 +1 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/musl/arch/mips/bits/syscall.h.in+6
......@@ -412,4 +412,10 @@
412412#define __NR_openat2 4437
413413#define __NR_pidfd_getfd 4438
414414#define __NR_faccessat2 4439
415#define __NR_process_madvise 4440
416#define __NR_epoll_pwait2 4441
417#define __NR_mount_setattr 4442
418#define __NR_landlock_create_ruleset 4444
419#define __NR_landlock_add_rule 4445
420#define __NR_landlock_restrict_self 4446
415421
lib/libc/musl/arch/mips/pthread_arch.h+1-2
......@@ -1,10 +1,9 @@
11static inline uintptr_t __get_tp()
22{
3#if __mips_isa_rev < 2
43 register uintptr_t tp __asm__("$3");
4#if __mips_isa_rev < 2
55 __asm__ (".word 0x7c03e83b" : "=r" (tp) );
66#else
7 uintptr_t tp;
87 __asm__ ("rdhwr %0, $29" : "=r" (tp) );
98#endif
109 return tp;
lib/libc/musl/arch/mips64/bits/syscall.h.in+6
......@@ -342,4 +342,10 @@
342342#define __NR_openat2 5437
343343#define __NR_pidfd_getfd 5438
344344#define __NR_faccessat2 5439
345#define __NR_process_madvise 5440
346#define __NR_epoll_pwait2 5441
347#define __NR_mount_setattr 5442
348#define __NR_landlock_create_ruleset 5444
349#define __NR_landlock_add_rule 5445
350#define __NR_landlock_restrict_self 5446
345351
lib/libc/musl/arch/powerpc/arch.mak created+1
......@@ -0,0 +1 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/musl/arch/powerpc/bits/fenv.h+1-1
......@@ -1,4 +1,4 @@
1#ifdef _SOFT_FLOAT
1#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__)
22#define FE_ALL_EXCEPT 0
33#define FE_TONEAREST 0
44#else
lib/libc/musl/arch/powerpc/bits/shm.h+1-1
......@@ -8,11 +8,11 @@ struct shmid_ds {
88 unsigned long __shm_dtime_lo;
99 unsigned long __shm_ctime_hi;
1010 unsigned long __shm_ctime_lo;
11 unsigned long __pad1;
1112 size_t shm_segsz;
1213 pid_t shm_cpid;
1314 pid_t shm_lpid;
1415 unsigned long shm_nattch;
15 unsigned long __pad1;
1616 unsigned long __pad2;
1717 time_t shm_atime;
1818 time_t shm_dtime;
lib/libc/musl/arch/powerpc/bits/syscall.h.in+6
......@@ -419,4 +419,10 @@
419419#define __NR_openat2 437
420420#define __NR_pidfd_getfd 438
421421#define __NR_faccessat2 439
422#define __NR_process_madvise 440
423#define __NR_epoll_pwait2 441
424#define __NR_mount_setattr 442
425#define __NR_landlock_create_ruleset 444
426#define __NR_landlock_add_rule 445
427#define __NR_landlock_restrict_self 446
422428
lib/libc/musl/arch/powerpc/reloc.h+1-1
......@@ -1,4 +1,4 @@
1#ifdef _SOFT_FLOAT
1#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__)
22#define FP_SUFFIX "-sf"
33#else
44#define FP_SUFFIX ""
lib/libc/musl/arch/powerpc64/bits/syscall.h.in+6
......@@ -391,4 +391,10 @@
391391#define __NR_openat2 437
392392#define __NR_pidfd_getfd 438
393393#define __NR_faccessat2 439
394#define __NR_process_madvise 440
395#define __NR_epoll_pwait2 441
396#define __NR_mount_setattr 442
397#define __NR_landlock_create_ruleset 444
398#define __NR_landlock_add_rule 445
399#define __NR_landlock_restrict_self 446
394400
lib/libc/musl/arch/riscv64/bits/syscall.h.in+7-1
......@@ -76,7 +76,7 @@
7676#define __NR_splice 76
7777#define __NR_tee 77
7878#define __NR_readlinkat 78
79#define __NR_fstatat 79
79#define __NR_newfstatat 79
8080#define __NR_fstat 80
8181#define __NR_sync 81
8282#define __NR_fsync 82
......@@ -293,6 +293,12 @@
293293#define __NR_openat2 437
294294#define __NR_pidfd_getfd 438
295295#define __NR_faccessat2 439
296#define __NR_process_madvise 440
297#define __NR_epoll_pwait2 441
298#define __NR_mount_setattr 442
299#define __NR_landlock_create_ruleset 444
300#define __NR_landlock_add_rule 445
301#define __NR_landlock_restrict_self 446
296302
297303#define __NR_sysriscv __NR_arch_specific_syscall
298304#define __NR_riscv_flush_icache (__NR_sysriscv + 15)
lib/libc/musl/arch/riscv64/bits/user.h+1
......@@ -1,5 +1,6 @@
11#include <signal.h>
22
33#define ELF_NGREG 32
4#define ELF_NFPREG 33
45typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
56typedef union __riscv_mc_fp_state elf_fpregset_t;
lib/libc/musl/arch/s390x/bits/ptrace.h+3
......@@ -1,4 +1,7 @@
11#define PTRACE_SINGLEBLOCK 12
2#define PTRACE_OLDSETOPTIONS 21
3#define PTRACE_SYSEMU 31
4#define PTRACE_SYSEMU_SINGLESTEP 32
25#define PTRACE_PEEKUSR_AREA 0x5000
36#define PTRACE_POKEUSR_AREA 0x5001
47#define PTRACE_GET_LAST_BREAK 0x5006
lib/libc/musl/arch/s390x/bits/syscall.h.in+6
......@@ -356,4 +356,10 @@
356356#define __NR_openat2 437
357357#define __NR_pidfd_getfd 438
358358#define __NR_faccessat2 439
359#define __NR_process_madvise 440
360#define __NR_epoll_pwait2 441
361#define __NR_mount_setattr 442
362#define __NR_landlock_create_ruleset 444
363#define __NR_landlock_add_rule 445
364#define __NR_landlock_restrict_self 446
359365
lib/libc/musl/arch/x86_64/bits/syscall.h.in+6
......@@ -349,4 +349,10 @@
349349#define __NR_openat2 437
350350#define __NR_pidfd_getfd 438
351351#define __NR_faccessat2 439
352#define __NR_process_madvise 440
353#define __NR_epoll_pwait2 441
354#define __NR_mount_setattr 442
355#define __NR_landlock_create_ruleset 444
356#define __NR_landlock_add_rule 445
357#define __NR_landlock_restrict_self 446
352358
lib/libc/musl/include/ctype.h+2
......@@ -64,7 +64,9 @@ int isascii(int);
6464int toascii(int);
6565#define _tolower(a) ((a)|0x20)
6666#define _toupper(a) ((a)&0x5f)
67#ifndef __cplusplus
6768#define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
69#endif
6870
6971#endif
7072
lib/libc/musl/include/elf.h+2
......@@ -686,6 +686,8 @@ typedef struct {
686686#define NT_ARM_PAC_MASK 0x406
687687#define NT_ARM_PACA_KEYS 0x407
688688#define NT_ARM_PACG_KEYS 0x408
689#define NT_ARM_TAGGED_ADDR_CTRL 0x409
690#define NT_ARM_PAC_ENABLED_KEYS 0x40a
689691#define NT_METAG_CBUF 0x500
690692#define NT_METAG_RPIPE 0x501
691693#define NT_METAG_TLS 0x502
lib/libc/musl/include/locale.h+3-1
......@@ -7,7 +7,9 @@ extern "C" {
77
88#include <features.h>
99
10#ifdef __cplusplus
10#if __cplusplus >= 201103L
11#define NULL nullptr
12#elif defined(__cplusplus)
1113#define NULL 0L
1214#else
1315#define NULL ((void*)0)
lib/libc/musl/include/netinet/if_ether.h+1
......@@ -66,6 +66,7 @@
6666#define ETH_P_1588 0x88F7
6767#define ETH_P_NCSI 0x88F8
6868#define ETH_P_PRP 0x88FB
69#define ETH_P_CFM 0x8902
6970#define ETH_P_FCOE 0x8906
7071#define ETH_P_TDLS 0x890D
7172#define ETH_P_FIP 0x8914
lib/libc/musl/include/netinet/in.h+1
......@@ -48,6 +48,7 @@ struct ipv6_mreq {
4848#define INADDR_BROADCAST ((in_addr_t) 0xffffffff)
4949#define INADDR_NONE ((in_addr_t) 0xffffffff)
5050#define INADDR_LOOPBACK ((in_addr_t) 0x7f000001)
51#define INADDR_DUMMY ((in_addr_t) 0xc0000008)
5152
5253#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000)
5354#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001)
lib/libc/musl/include/netinet/tcp.h+11
......@@ -80,6 +80,8 @@ enum {
8080 TCP_NLA_SRTT,
8181 TCP_NLA_TIMEOUT_REHASH,
8282 TCP_NLA_BYTES_NOTSENT,
83 TCP_NLA_EDT,
84 TCP_NLA_TTL,
8385};
8486
8587#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
......@@ -281,12 +283,21 @@ struct tcp_repair_window {
281283 uint32_t rcv_wup;
282284};
283285
286#define TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT 0x1
287
284288struct tcp_zerocopy_receive {
285289 uint64_t address;
286290 uint32_t length;
287291 uint32_t recv_skip_hint;
288292 uint32_t inq;
289293 int32_t err;
294 uint64_t copybuf_address;
295 int32_t copybuf_len;
296 uint32_t flags;
297 uint64_t msg_control;
298 uint64_t msg_controllen;
299 uint32_t msg_flags;
300 uint32_t reserved;
290301};
291302
292303#endif
lib/libc/musl/include/pthread.h+1
......@@ -221,6 +221,7 @@ int pthread_getaffinity_np(pthread_t, size_t, struct cpu_set_t *);
221221int pthread_setaffinity_np(pthread_t, size_t, const struct cpu_set_t *);
222222int pthread_getattr_np(pthread_t, pthread_attr_t *);
223223int pthread_setname_np(pthread_t, const char *);
224int pthread_getname_np(pthread_t, char *, size_t);
224225int pthread_getattr_default_np(pthread_attr_t *);
225226int pthread_setattr_default_np(const pthread_attr_t *);
226227int pthread_tryjoin_np(pthread_t, void **);
lib/libc/musl/include/setjmp.h+11-3
......@@ -15,25 +15,33 @@ typedef struct __jmp_buf_tag {
1515 unsigned long __ss[128/sizeof(long)];
1616} jmp_buf[1];
1717
18#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
19#define __setjmp_attr __attribute__((__returns_twice__))
20#else
21#define __setjmp_attr
22#endif
23
1824#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
1925 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
2026 || defined(_BSD_SOURCE)
2127typedef jmp_buf sigjmp_buf;
22int sigsetjmp (sigjmp_buf, int);
28int sigsetjmp (sigjmp_buf, int) __setjmp_attr;
2329_Noreturn void siglongjmp (sigjmp_buf, int);
2430#endif
2531
2632#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
2733 || defined(_BSD_SOURCE)
28int _setjmp (jmp_buf);
34int _setjmp (jmp_buf) __setjmp_attr;
2935_Noreturn void _longjmp (jmp_buf, int);
3036#endif
3137
32int setjmp (jmp_buf);
38int setjmp (jmp_buf) __setjmp_attr;
3339_Noreturn void longjmp (jmp_buf, int);
3440
3541#define setjmp setjmp
3642
43#undef __setjmp_attr
44
3745#ifdef __cplusplus
3846}
3947#endif
lib/libc/musl/include/signal.h+8
......@@ -75,6 +75,8 @@ typedef struct sigaltstack stack_t;
7575#define SEGV_ACCERR 2
7676#define SEGV_BNDERR 3
7777#define SEGV_PKUERR 4
78#define SEGV_MTEAERR 8
79#define SEGV_MTESERR 9
7880
7981#define BUS_ADRALN 1
8082#define BUS_ADRERR 2
......@@ -176,6 +178,9 @@ struct sigaction {
176178#define sa_handler __sa_handler.sa_handler
177179#define sa_sigaction __sa_handler.sa_sigaction
178180
181#define SA_UNSUPPORTED 0x00000400
182#define SA_EXPOSE_TAGBITS 0x00000800
183
179184struct sigevent {
180185 union sigval sigev_value;
181186 int sigev_signo;
......@@ -259,6 +264,9 @@ void (*sigset(int, void (*)(int)))(int);
259264#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
260265#define NSIG _NSIG
261266typedef void (*sig_t)(int);
267
268#define SYS_SECCOMP 1
269#define SYS_USER_DISPATCH 2
262270#endif
263271
264272#ifdef _GNU_SOURCE
lib/libc/musl/include/stdc-predef.h+3
......@@ -7,4 +7,7 @@
77#define __STDC_IEC_559__ 1
88#endif
99
10#define __STDC_UTF_16__ 1
11#define __STDC_UTF_32__ 1
12
1013#endif
lib/libc/musl/include/stddef.h+3-1
......@@ -1,7 +1,9 @@
11#ifndef _STDDEF_H
22#define _STDDEF_H
33
4#ifdef __cplusplus
4#if __cplusplus >= 201103L
5#define NULL nullptr
6#elif defined(__cplusplus)
57#define NULL 0L
68#else
79#define NULL ((void*)0)
lib/libc/musl/include/stdio.h+3-1
......@@ -25,7 +25,9 @@ extern "C" {
2525
2626#include <bits/alltypes.h>
2727
28#ifdef __cplusplus
28#if __cplusplus >= 201103L
29#define NULL nullptr
30#elif defined(__cplusplus)
2931#define NULL 0L
3032#else
3133#define NULL ((void*)0)
lib/libc/musl/include/stdlib.h+4-1
......@@ -7,7 +7,9 @@ extern "C" {
77
88#include <features.h>
99
10#ifdef __cplusplus
10#if __cplusplus >= 201103L
11#define NULL nullptr
12#elif defined(__cplusplus)
1113#define NULL 0L
1214#else
1315#define NULL ((void*)0)
......@@ -146,6 +148,7 @@ int clearenv(void);
146148#define WCOREDUMP(s) ((s) & 0x80)
147149#define WIFCONTINUED(s) ((s) == 0xffff)
148150void *reallocarray (void *, size_t, size_t);
151void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
149152#endif
150153
151154#ifdef _GNU_SOURCE
lib/libc/musl/include/string.h+3-1
......@@ -7,7 +7,9 @@ extern "C" {
77
88#include <features.h>
99
10#ifdef __cplusplus
10#if __cplusplus >= 201103L
11#define NULL nullptr
12#elif defined(__cplusplus)
1113#define NULL 0L
1214#else
1315#define NULL ((void*)0)
lib/libc/musl/include/sys/membarrier.h+4
......@@ -9,9 +9,13 @@
99#define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED 16
1010#define MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE 32
1111#define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE 64
12#define MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ 128
13#define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ 256
1214
1315#define MEMBARRIER_CMD_SHARED MEMBARRIER_CMD_GLOBAL
1416
17#define MEMBARRIER_CMD_FLAG_CPU 1
18
1519int membarrier(int, int);
1620
1721#endif
lib/libc/musl/include/sys/mman.h+1
......@@ -40,6 +40,7 @@ extern "C" {
4040
4141#define MAP_HUGE_SHIFT 26
4242#define MAP_HUGE_MASK 0x3f
43#define MAP_HUGE_16KB (14 << 26)
4344#define MAP_HUGE_64KB (16 << 26)
4445#define MAP_HUGE_512KB (19 << 26)
4546#define MAP_HUGE_1MB (20 << 26)
lib/libc/musl/include/sys/mount.h+1
......@@ -31,6 +31,7 @@ extern "C" {
3131#define MS_REMOUNT 32
3232#define MS_MANDLOCK 64
3333#define MS_DIRSYNC 128
34#define MS_NOSYMFOLLOW 256
3435#define MS_NOATIME 1024
3536#define MS_NODIRATIME 2048
3637#define MS_BIND 4096
lib/libc/musl/include/sys/prctl.h+16
......@@ -157,10 +157,26 @@ struct prctl_mm_map {
157157#define PR_SET_TAGGED_ADDR_CTRL 55
158158#define PR_GET_TAGGED_ADDR_CTRL 56
159159#define PR_TAGGED_ADDR_ENABLE (1UL << 0)
160#define PR_MTE_TCF_SHIFT 1
161#define PR_MTE_TCF_NONE (0UL << 1)
162#define PR_MTE_TCF_SYNC (1UL << 1)
163#define PR_MTE_TCF_ASYNC (2UL << 1)
164#define PR_MTE_TCF_MASK (3UL << 1)
165#define PR_MTE_TAG_SHIFT 3
166#define PR_MTE_TAG_MASK (0xffffUL << 3)
160167
161168#define PR_SET_IO_FLUSHER 57
162169#define PR_GET_IO_FLUSHER 58
163170
171#define PR_SET_SYSCALL_USER_DISPATCH 59
172#define PR_SYS_DISPATCH_OFF 0
173#define PR_SYS_DISPATCH_ON 1
174#define SYSCALL_DISPATCH_FILTER_ALLOW 0
175#define SYSCALL_DISPATCH_FILTER_BLOCK 1
176
177#define PR_PAC_SET_ENABLED_KEYS 60
178#define PR_PAC_GET_ENABLED_KEYS 61
179
164180int prctl (int, ...);
165181
166182#ifdef __cplusplus
lib/libc/musl/include/sys/ptrace.h+9
......@@ -42,6 +42,7 @@ extern "C" {
4242#define PTRACE_SECCOMP_GET_FILTER 0x420c
4343#define PTRACE_SECCOMP_GET_METADATA 0x420d
4444#define PTRACE_GET_SYSCALL_INFO 0x420e
45#define PTRACE_GET_RSEQ_CONFIGURATION 0x420f
4546
4647#define PT_READ_I PTRACE_PEEKTEXT
4748#define PT_READ_D PTRACE_PEEKDATA
......@@ -130,6 +131,14 @@ struct __ptrace_syscall_info {
130131 };
131132};
132133
134struct __ptrace_rseq_configuration {
135 uint64_t rseq_abi_pointer;
136 uint32_t rseq_abi_size;
137 uint32_t signature;
138 uint32_t flags;
139 uint32_t pad;
140};
141
133142long ptrace(int, ...);
134143
135144#ifdef __cplusplus
lib/libc/musl/include/sys/socket.h+2
......@@ -289,6 +289,8 @@ struct linger {
289289#define SCM_TXTIME SO_TXTIME
290290#define SO_BINDTOIFINDEX 62
291291#define SO_DETACH_REUSEPORT_BPF 68
292#define SO_PREFER_BUSY_POLL 69
293#define SO_BUSY_POLL_BUDGET 70
292294
293295#ifndef SOL_SOCKET
294296#define SOL_SOCKET 1
lib/libc/musl/include/time.h+3-1
......@@ -7,7 +7,9 @@ extern "C" {
77
88#include <features.h>
99
10#ifdef __cplusplus
10#if __cplusplus >= 201103L
11#define NULL nullptr
12#elif defined(__cplusplus)
1113#define NULL 0L
1214#else
1315#define NULL ((void*)0)
lib/libc/musl/include/unistd.h+5-1
......@@ -14,8 +14,12 @@ extern "C" {
1414#define SEEK_SET 0
1515#define SEEK_CUR 1
1616#define SEEK_END 2
17#define SEEK_DATA 3
18#define SEEK_HOLE 4
1719
18#ifdef __cplusplus
20#if __cplusplus >= 201103L
21#define NULL nullptr
22#elif defined(__cplusplus)
1923#define NULL 0L
2024#else
2125#define NULL ((void*)0)
lib/libc/musl/include/wchar.h+3-1
......@@ -38,7 +38,9 @@ extern "C" {
3838#define WCHAR_MIN (-1-0x7fffffff+L'\0')
3939#endif
4040
41#ifdef __cplusplus
41#if __cplusplus >= 201103L
42#define NULL nullptr
43#elif defined(__cplusplus)
4244#define NULL 0L
4345#else
4446#define NULL ((void*)0)
lib/libc/musl/libc.S+330-324
......@@ -27,48 +27,48 @@ aio_read64:
2727.globl aio_read
2828.type aio_read, %function;
2929aio_read:
30.globl aio_write
31.type aio_write, %function;
32aio_write:
3330.weak aio_write64
3431.type aio_write64, %function;
3532aio_write64:
36.globl aio_fsync
37.type aio_fsync, %function;
38aio_fsync:
33.globl aio_write
34.type aio_write, %function;
35aio_write:
3936.weak aio_fsync64
4037.type aio_fsync64, %function;
4138aio_fsync64:
42.weak aio_return64
43.type aio_return64, %function;
44aio_return64:
39.globl aio_fsync
40.type aio_fsync, %function;
41aio_fsync:
4542.globl aio_return
4643.type aio_return, %function;
4744aio_return:
48.globl aio_error
49.type aio_error, %function;
50aio_error:
45.weak aio_return64
46.type aio_return64, %function;
47aio_return64:
5148.weak aio_error64
5249.type aio_error64, %function;
5350aio_error64:
54.globl aio_cancel
55.type aio_cancel, %function;
56aio_cancel:
51.globl aio_error
52.type aio_error, %function;
53aio_error:
5754.weak aio_cancel64
5855.type aio_cancel64, %function;
5956aio_cancel64:
60.globl aio_suspend
61.type aio_suspend, %function;
62aio_suspend:
57.globl aio_cancel
58.type aio_cancel, %function;
59aio_cancel:
6360.weak aio_suspend64
6461.type aio_suspend64, %function;
6562aio_suspend64:
66.globl lio_listio
67.type lio_listio, %function;
68lio_listio:
63.globl aio_suspend
64.type aio_suspend, %function;
65aio_suspend:
6966.weak lio_listio64
7067.type lio_listio64, %function;
7168lio_listio64:
69.globl lio_listio
70.type lio_listio, %function;
71lio_listio:
7272.globl cabs
7373.type cabs, %function;
7474cabs:
......@@ -327,12 +327,12 @@ isalnum_l:
327327.globl isalpha
328328.type isalpha, %function;
329329isalpha:
330.weak isalpha_l
331.type isalpha_l, %function;
332isalpha_l:
333330.globl __isalpha_l
334331.type __isalpha_l, %function;
335332__isalpha_l:
333.weak isalpha_l
334.type isalpha_l, %function;
335isalpha_l:
336336.globl isascii
337337.type isascii, %function;
338338isascii:
......@@ -348,21 +348,21 @@ isblank_l:
348348.globl iscntrl
349349.type iscntrl, %function;
350350iscntrl:
351.weak iscntrl_l
352.type iscntrl_l, %function;
353iscntrl_l:
354351.globl __iscntrl_l
355352.type __iscntrl_l, %function;
356353__iscntrl_l:
354.weak iscntrl_l
355.type iscntrl_l, %function;
356iscntrl_l:
357357.globl isdigit
358358.type isdigit, %function;
359359isdigit:
360.weak isdigit_l
361.type isdigit_l, %function;
362isdigit_l:
363360.globl __isdigit_l
364361.type __isdigit_l, %function;
365362__isdigit_l:
363.weak isdigit_l
364.type isdigit_l, %function;
365isdigit_l:
366366.globl isgraph
367367.type isgraph, %function;
368368isgraph:
......@@ -375,96 +375,96 @@ isgraph_l:
375375.globl islower
376376.type islower, %function;
377377islower:
378.weak islower_l
379.type islower_l, %function;
380islower_l:
381378.globl __islower_l
382379.type __islower_l, %function;
383380__islower_l:
381.weak islower_l
382.type islower_l, %function;
383islower_l:
384384.globl isprint
385385.type isprint, %function;
386386isprint:
387.weak isprint_l
388.type isprint_l, %function;
389isprint_l:
390387.globl __isprint_l
391388.type __isprint_l, %function;
392389__isprint_l:
390.weak isprint_l
391.type isprint_l, %function;
392isprint_l:
393393.globl ispunct
394394.type ispunct, %function;
395395ispunct:
396.weak ispunct_l
397.type ispunct_l, %function;
398ispunct_l:
399396.globl __ispunct_l
400397.type __ispunct_l, %function;
401398__ispunct_l:
399.weak ispunct_l
400.type ispunct_l, %function;
401ispunct_l:
402402.globl isspace
403403.type isspace, %function;
404404isspace:
405.weak isspace_l
406.type isspace_l, %function;
407isspace_l:
408405.globl __isspace_l
409406.type __isspace_l, %function;
410407__isspace_l:
408.weak isspace_l
409.type isspace_l, %function;
410isspace_l:
411411.globl isupper
412412.type isupper, %function;
413413isupper:
414.weak isupper_l
415.type isupper_l, %function;
416isupper_l:
417414.globl __isupper_l
418415.type __isupper_l, %function;
419416__isupper_l:
417.weak isupper_l
418.type isupper_l, %function;
419isupper_l:
420420.globl iswalnum
421421.type iswalnum, %function;
422422iswalnum:
423.globl __iswalnum_l
424.type __iswalnum_l, %function;
425__iswalnum_l:
426423.weak iswalnum_l
427424.type iswalnum_l, %function;
428425iswalnum_l:
426.globl __iswalnum_l
427.type __iswalnum_l, %function;
428__iswalnum_l:
429429.globl iswalpha
430430.type iswalpha, %function;
431431iswalpha:
432.globl __iswalpha_l
433.type __iswalpha_l, %function;
434__iswalpha_l:
435432.weak iswalpha_l
436433.type iswalpha_l, %function;
437434iswalpha_l:
435.globl __iswalpha_l
436.type __iswalpha_l, %function;
437__iswalpha_l:
438438.globl iswblank
439439.type iswblank, %function;
440440iswblank:
441.globl __iswblank_l
442.type __iswblank_l, %function;
443__iswblank_l:
444441.weak iswblank_l
445442.type iswblank_l, %function;
446443iswblank_l:
444.globl __iswblank_l
445.type __iswblank_l, %function;
446__iswblank_l:
447447.globl iswcntrl
448448.type iswcntrl, %function;
449449iswcntrl:
450.globl __iswcntrl_l
451.type __iswcntrl_l, %function;
452__iswcntrl_l:
453450.weak iswcntrl_l
454451.type iswcntrl_l, %function;
455452iswcntrl_l:
453.globl __iswcntrl_l
454.type __iswcntrl_l, %function;
455__iswcntrl_l:
456456.globl iswctype
457457.type iswctype, %function;
458458iswctype:
459459.globl wctype
460460.type wctype, %function;
461461wctype:
462.globl __iswctype_l
463.type __iswctype_l, %function;
464__iswctype_l:
465462.weak iswctype_l
466463.type iswctype_l, %function;
467464iswctype_l:
465.globl __iswctype_l
466.type __iswctype_l, %function;
467__iswctype_l:
468468.globl __wctype_l
469469.type __wctype_l, %function;
470470__wctype_l:
......@@ -474,21 +474,21 @@ wctype_l:
474474.globl iswdigit
475475.type iswdigit, %function;
476476iswdigit:
477.globl __iswdigit_l
478.type __iswdigit_l, %function;
479__iswdigit_l:
480477.weak iswdigit_l
481478.type iswdigit_l, %function;
482479iswdigit_l:
480.globl __iswdigit_l
481.type __iswdigit_l, %function;
482__iswdigit_l:
483483.globl iswgraph
484484.type iswgraph, %function;
485485iswgraph:
486.globl __iswgraph_l
487.type __iswgraph_l, %function;
488__iswgraph_l:
489486.weak iswgraph_l
490487.type iswgraph_l, %function;
491488iswgraph_l:
489.globl __iswgraph_l
490.type __iswgraph_l, %function;
491__iswgraph_l:
492492.globl iswlower
493493.type iswlower, %function;
494494iswlower:
......@@ -501,57 +501,57 @@ __iswlower_l:
501501.globl iswprint
502502.type iswprint, %function;
503503iswprint:
504.globl __iswprint_l
505.type __iswprint_l, %function;
506__iswprint_l:
507504.weak iswprint_l
508505.type iswprint_l, %function;
509506iswprint_l:
507.globl __iswprint_l
508.type __iswprint_l, %function;
509__iswprint_l:
510510.globl iswpunct
511511.type iswpunct, %function;
512512iswpunct:
513.globl __iswpunct_l
514.type __iswpunct_l, %function;
515__iswpunct_l:
516513.weak iswpunct_l
517514.type iswpunct_l, %function;
518515iswpunct_l:
516.globl __iswpunct_l
517.type __iswpunct_l, %function;
518__iswpunct_l:
519519.globl iswspace
520520.type iswspace, %function;
521521iswspace:
522.globl __iswspace_l
523.type __iswspace_l, %function;
524__iswspace_l:
525522.weak iswspace_l
526523.type iswspace_l, %function;
527524iswspace_l:
525.globl __iswspace_l
526.type __iswspace_l, %function;
527__iswspace_l:
528528.globl iswupper
529529.type iswupper, %function;
530530iswupper:
531.globl __iswupper_l
532.type __iswupper_l, %function;
533__iswupper_l:
534531.weak iswupper_l
535532.type iswupper_l, %function;
536533iswupper_l:
534.globl __iswupper_l
535.type __iswupper_l, %function;
536__iswupper_l:
537537.globl iswxdigit
538538.type iswxdigit, %function;
539539iswxdigit:
540.globl __iswxdigit_l
541.type __iswxdigit_l, %function;
542__iswxdigit_l:
543540.weak iswxdigit_l
544541.type iswxdigit_l, %function;
545542iswxdigit_l:
543.globl __iswxdigit_l
544.type __iswxdigit_l, %function;
545__iswxdigit_l:
546546.globl isxdigit
547547.type isxdigit, %function;
548548isxdigit:
549.globl __isxdigit_l
550.type __isxdigit_l, %function;
551__isxdigit_l:
552549.weak isxdigit_l
553550.type isxdigit_l, %function;
554551isxdigit_l:
552.globl __isxdigit_l
553.type __isxdigit_l, %function;
554__isxdigit_l:
555555.globl toascii
556556.type toascii, %function;
557557toascii:
......@@ -567,24 +567,24 @@ tolower_l:
567567.globl toupper
568568.type toupper, %function;
569569toupper:
570.weak toupper_l
571.type toupper_l, %function;
572toupper_l:
573570.globl __toupper_l
574571.type __toupper_l, %function;
575572__toupper_l:
573.weak toupper_l
574.type toupper_l, %function;
575toupper_l:
576576.globl towlower
577577.type towlower, %function;
578578towlower:
579579.globl towupper
580580.type towupper, %function;
581581towupper:
582.globl __towupper_l
583.type __towupper_l, %function;
584__towupper_l:
585582.weak towupper_l
586583.type towupper_l, %function;
587584towupper_l:
585.globl __towupper_l
586.type __towupper_l, %function;
587__towupper_l:
588588.globl __towlower_l
589589.type __towlower_l, %function;
590590__towlower_l:
......@@ -660,12 +660,12 @@ seekdir:
660660.globl telldir
661661.type telldir, %function;
662662telldir:
663.globl versionsort
664.type versionsort, %function;
665versionsort:
666663.weak versionsort64
667664.type versionsort64, %function;
668665versionsort64:
666.globl versionsort
667.type versionsort, %function;
668versionsort:
669669.weak _init
670670.type _init, %function;
671671_init:
......@@ -735,12 +735,12 @@ exit:
735735.globl quick_exit
736736.type quick_exit, %function;
737737quick_exit:
738.globl creat
739.type creat, %function;
740creat:
741738.weak creat64
742739.type creat64, %function;
743740creat64:
741.globl creat
742.type creat, %function;
743creat:
744744.globl fcntl
745745.type fcntl, %function;
746746fcntl:
......@@ -750,24 +750,24 @@ open64:
750750.globl open
751751.type open, %function;
752752open:
753.weak openat64
754.type openat64, %function;
755openat64:
756753.globl openat
757754.type openat, %function;
758755openat:
759.weak posix_fadvise64
760.type posix_fadvise64, %function;
761posix_fadvise64:
756.weak openat64
757.type openat64, %function;
758openat64:
762759.globl posix_fadvise
763760.type posix_fadvise, %function;
764761posix_fadvise:
765.weak posix_fallocate64
766.type posix_fallocate64, %function;
767posix_fallocate64:
762.weak posix_fadvise64
763.type posix_fadvise64, %function;
764posix_fadvise64:
768765.globl posix_fallocate
769766.type posix_fallocate, %function;
770767posix_fallocate:
768.weak posix_fallocate64
769.type posix_fallocate64, %function;
770posix_fallocate64:
771771.globl __flt_rounds
772772.type __flt_rounds, %function;
773773__flt_rounds:
......@@ -891,12 +891,12 @@ euidaccess:
891891.weak eaccess
892892.type eaccess, %function;
893893eaccess:
894.weak ftw64
895.type ftw64, %function;
896ftw64:
897894.globl ftw
898895.type ftw, %function;
899896ftw:
897.weak ftw64
898.type ftw64, %function;
899ftw64:
900900.globl futimes
901901.type futimes, %function;
902902futimes:
......@@ -930,48 +930,48 @@ lutimes:
930930.globl ulimit
931931.type ulimit, %function;
932932ulimit:
933.weak endutent
934.type endutent, %function;
935endutent:
936933.globl endutxent
937934.type endutxent, %function;
938935endutxent:
939.weak setutent
940.type setutent, %function;
941setutent:
936.weak endutent
937.type endutent, %function;
938endutent:
942939.globl setutxent
943940.type setutxent, %function;
944941setutxent:
942.weak setutent
943.type setutent, %function;
944setutent:
945945.globl getutxent
946946.type getutxent, %function;
947947getutxent:
948948.weak getutent
949949.type getutent, %function;
950950getutent:
951.weak getutid
952.type getutid, %function;
953getutid:
954951.globl getutxid
955952.type getutxid, %function;
956953getutxid:
954.weak getutid
955.type getutid, %function;
956getutid:
957957.weak getutline
958958.type getutline, %function;
959959getutline:
960960.globl getutxline
961961.type getutxline, %function;
962962getutxline:
963.weak pututline
964.type pututline, %function;
965pututline:
966963.globl pututxline
967964.type pututxline, %function;
968965pututxline:
969.weak updwtmp
970.type updwtmp, %function;
971updwtmp:
966.weak pututline
967.type pututline, %function;
968pututline:
972969.globl updwtmpx
973970.type updwtmpx, %function;
974971updwtmpx:
972.weak updwtmp
973.type updwtmp, %function;
974updwtmp:
975975.weak utmpxname
976976.type utmpxname, %function;
977977utmpxname:
......@@ -1042,12 +1042,12 @@ eventfd_read:
10421042.globl eventfd_write
10431043.type eventfd_write, %function;
10441044eventfd_write:
1045.weak fallocate64
1046.type fallocate64, %function;
1047fallocate64:
10481045.globl fallocate
10491046.type fallocate, %function;
10501047fallocate:
1048.weak fallocate64
1049.type fallocate64, %function;
1050fallocate64:
10511051.globl fanotify_init
10521052.type fanotify_init, %function;
10531053fanotify_init:
......@@ -1156,12 +1156,12 @@ remap_file_pages:
11561156.globl sbrk
11571157.type sbrk, %function;
11581158sbrk:
1159.globl sendfile
1160.type sendfile, %function;
1161sendfile:
11621159.weak sendfile64
11631160.type sendfile64, %function;
11641161sendfile64:
1162.globl sendfile
1163.type sendfile, %function;
1164sendfile:
11651165.globl setfsgid
11661166.type setfsgid, %function;
11671167setfsgid:
......@@ -1297,18 +1297,18 @@ dngettext:
12971297.globl dgettext
12981298.type dgettext, %function;
12991299dgettext:
1300.weak duplocale
1301.type duplocale, %function;
1302duplocale:
13031300.globl __duplocale
13041301.type __duplocale, %function;
13051302__duplocale:
1306.weak __freelocale
1307.type __freelocale, %function;
1308__freelocale:
1303.weak duplocale
1304.type duplocale, %function;
1305duplocale:
13091306.globl freelocale
13101307.type freelocale, %function;
13111308freelocale:
1309.weak __freelocale
1310.type __freelocale, %function;
1311__freelocale:
13121312.globl iconv_open
13131313.type iconv_open, %function;
13141314iconv_open:
......@@ -1318,18 +1318,18 @@ iconv:
13181318.globl iconv_close
13191319.type iconv_close, %function;
13201320iconv_close:
1321.weak nl_langinfo_l
1322.type nl_langinfo_l, %function;
1323nl_langinfo_l:
13241321.globl __nl_langinfo_l
13251322.type __nl_langinfo_l, %function;
13261323__nl_langinfo_l:
1327.globl __nl_langinfo
1328.type __nl_langinfo, %function;
1329__nl_langinfo:
1324.weak nl_langinfo_l
1325.type nl_langinfo_l, %function;
1326nl_langinfo_l:
13301327.weak nl_langinfo
13311328.type nl_langinfo, %function;
13321329nl_langinfo:
1330.globl __nl_langinfo
1331.type __nl_langinfo, %function;
1332__nl_langinfo:
13331333.globl localeconv
13341334.type localeconv, %function;
13351335localeconv:
......@@ -1357,6 +1357,24 @@ strfmon_l:
13571357.globl strfmon
13581358.type strfmon, %function;
13591359strfmon:
1360.weak __strtof_l
1361.type __strtof_l, %function;
1362__strtof_l:
1363.globl strtof_l
1364.type strtof_l, %function;
1365strtof_l:
1366.globl strtod_l
1367.type strtod_l, %function;
1368strtod_l:
1369.weak __strtod_l
1370.type __strtod_l, %function;
1371__strtod_l:
1372.globl strtold_l
1373.type strtold_l, %function;
1374strtold_l:
1375.weak __strtold_l
1376.type __strtold_l, %function;
1377__strtold_l:
13601378.globl __strxfrm_l
13611379.type __strxfrm_l, %function;
13621380__strxfrm_l:
......@@ -1390,12 +1408,12 @@ wcscoll_l:
13901408.globl wcscoll
13911409.type wcscoll, %function;
13921410wcscoll:
1393.globl __wcsxfrm_l
1394.type __wcsxfrm_l, %function;
1395__wcsxfrm_l:
13961411.weak wcsxfrm_l
13971412.type wcsxfrm_l, %function;
13981413wcsxfrm_l:
1414.globl __wcsxfrm_l
1415.type __wcsxfrm_l, %function;
1416__wcsxfrm_l:
13991417.globl wcsxfrm
14001418.type wcsxfrm, %function;
14011419wcsxfrm:
......@@ -1567,12 +1585,12 @@ erfcl:
15671585.globl exp
15681586.type exp, %function;
15691587exp:
1570.weak pow10
1571.type pow10, %function;
1572pow10:
15731588.globl exp10
15741589.type exp10, %function;
15751590exp10:
1591.weak pow10
1592.type pow10, %function;
1593pow10:
15761594.weak pow10f
15771595.type pow10f, %function;
15781596pow10f:
......@@ -1738,12 +1756,12 @@ lgammaf:
17381756.weak lgammaf_r
17391757.type lgammaf_r, %function;
17401758lgammaf_r:
1741.weak lgammal_r
1742.type lgammal_r, %function;
1743lgammal_r:
17441759.globl __lgammal_r
17451760.type __lgammal_r, %function;
17461761__lgammal_r:
1762.weak lgammal_r
1763.type lgammal_r, %function;
1764lgammal_r:
17471765.globl lgammal
17481766.type lgammal, %function;
17491767lgammal:
......@@ -1888,12 +1906,12 @@ remainder:
18881906.weak drem
18891907.type drem, %function;
18901908drem:
1891.weak dremf
1892.type dremf, %function;
1893dremf:
18941909.globl remainderf
18951910.type remainderf, %function;
18961911remainderf:
1912.weak dremf
1913.type dremf, %function;
1914dremf:
18971915.globl remainderl
18981916.type remainderl, %function;
18991917remainderl:
......@@ -2389,24 +2407,24 @@ dn_expand:
23892407.globl dn_skipname
23902408.type dn_skipname, %function;
23912409dn_skipname:
2392.weak setnetent
2393.type setnetent, %function;
2394setnetent:
23952410.globl sethostent
23962411.type sethostent, %function;
23972412sethostent:
2413.weak setnetent
2414.type setnetent, %function;
2415setnetent:
23982416.globl gethostent
23992417.type gethostent, %function;
24002418gethostent:
24012419.globl getnetent
24022420.type getnetent, %function;
24032421getnetent:
2404.globl endhostent
2405.type endhostent, %function;
2406endhostent:
24072422.weak endnetent
24082423.type endnetent, %function;
24092424endnetent:
2425.globl endhostent
2426.type endhostent, %function;
2427endhostent:
24102428.globl ether_aton_r
24112429.type ether_aton_r, %function;
24122430ether_aton_r:
......@@ -2701,12 +2719,12 @@ getpwnam_r:
27012719.globl getpwuid_r
27022720.type getpwuid_r, %function;
27032721getpwuid_r:
2704.weak endpwent
2705.type endpwent, %function;
2706endpwent:
27072722.globl setpwent
27082723.type setpwent, %function;
27092724setpwent:
2725.weak endpwent
2726.type endpwent, %function;
2727endpwent:
27102728.globl getpwent
27112729.type getpwent, %function;
27122730getpwent:
......@@ -2911,12 +2929,12 @@ waitpid:
29112929.globl fnmatch
29122930.type fnmatch, %function;
29132931fnmatch:
2914.globl glob
2915.type glob, %function;
2916glob:
29172932.weak glob64
29182933.type glob64, %function;
29192934glob64:
2935.globl glob
2936.type glob, %function;
2937glob:
29202938.globl globfree
29212939.type globfree, %function;
29222940globfree:
......@@ -3031,9 +3049,6 @@ pselect:
30313049.globl select
30323050.type select, %function;
30333051select:
3034.globl _longjmp
3035.type _longjmp, %function;
3036_longjmp:
30373052#if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_x86_64) && !defined(ARCH_powerpc) && !defined(ARCH_powerpc64) && !defined(ARCH_aarch64)
30383053.globl __longjmp
30393054.type __longjmp, %function;
......@@ -3042,15 +3057,18 @@ __longjmp:
30423057.globl longjmp
30433058.type longjmp, %function;
30443059longjmp:
3060.globl _longjmp
3061.type _longjmp, %function;
3062_longjmp:
30453063.globl _setjmp
30463064.type _setjmp, %function;
30473065_setjmp:
3048.globl setjmp
3049.type setjmp, %function;
3050setjmp:
30513066.globl __setjmp
30523067.type __setjmp, %function;
30533068__setjmp:
3069.globl setjmp
3070.type setjmp, %function;
3071setjmp:
30543072.globl getitimer
30553073.type getitimer, %function;
30563074getitimer:
......@@ -3165,22 +3183,22 @@ sigwait:
31653183.globl sigwaitinfo
31663184.type sigwaitinfo, %function;
31673185sigwaitinfo:
3168WEAK64 __fxstat64
3169.type __fxstat64, %function;
3170__fxstat64:
31713186#if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_powerpc)
31723187.globl __fxstat
31733188.type __fxstat, %function;
31743189__fxstat:
31753190#endif
3191WEAK64 __fxstat64
3192.type __fxstat64, %function;
3193__fxstat64:
3194WEAK64 __fxstatat64
3195.type __fxstatat64, %function;
3196__fxstatat64:
31763197#if !defined(ARCH_mips) && !defined(ARCH_i386) && !defined(ARCH_powerpc)
31773198.globl __fxstatat
31783199.type __fxstatat, %function;
31793200__fxstatat:
31803201#endif
3181WEAK64 __fxstatat64
3182.type __fxstatat64, %function;
3183__fxstatat64:
31843202WEAK64 __lxstat64
31853203.type __lxstat64, %function;
31863204__lxstat64:
......@@ -3218,12 +3236,12 @@ fstat64:
32183236.globl fstat
32193237.type fstat, %function;
32203238fstat:
3221.globl fstatat
3222.type fstatat, %function;
3223fstatat:
32243239.weak fstatat64
32253240.type fstatat64, %function;
32263241fstatat64:
3242.globl fstatat
3243.type fstatat, %function;
3244fstatat:
32273245.globl futimens
32283246.type futimens, %function;
32293247futimens:
......@@ -3233,12 +3251,12 @@ futimesat:
32333251.globl lchmod
32343252.type lchmod, %function;
32353253lchmod:
3236.weak lstat64
3237.type lstat64, %function;
3238lstat64:
32393254.globl lstat
32403255.type lstat, %function;
32413256lstat:
3257.weak lstat64
3258.type lstat64, %function;
3259lstat64:
32423260.globl mkdir
32433261.type mkdir, %function;
32443262mkdir:
......@@ -3261,32 +3279,32 @@ mknodat:
32613279.type stat, %function;
32623280stat:
32633281.weak stat64
3264.type stat64, %function;
3265stat64:
3266.weak statfs
3267.type statfs, %function;
3268statfs:
3282.type stat64, %function;
3283stat64:
32693284.weak statfs64
32703285.type statfs64, %function;
32713286statfs64:
3272.weak fstatfs
3273.type fstatfs, %function;
3274fstatfs:
3287.weak statfs
3288.type statfs, %function;
3289statfs:
32753290.weak fstatfs64
32763291.type fstatfs64, %function;
32773292fstatfs64:
3293.weak fstatfs
3294.type fstatfs, %function;
3295fstatfs:
32783296.weak statvfs64
32793297.type statvfs64, %function;
32803298statvfs64:
32813299.globl statvfs
32823300.type statvfs, %function;
32833301statvfs:
3284.weak fstatvfs64
3285.type fstatvfs64, %function;
3286fstatvfs64:
32873302.globl fstatvfs
32883303.type fstatvfs, %function;
32893304fstatvfs:
3305.weak fstatvfs64
3306.type fstatvfs64, %function;
3307fstatvfs64:
32903308.globl umask
32913309.type umask, %function;
32923310umask:
......@@ -3307,12 +3325,12 @@ __uflow:
33073325.globl asprintf
33083326.type asprintf, %function;
33093327asprintf:
3310.weak clearerr_unlocked
3311.type clearerr_unlocked, %function;
3312clearerr_unlocked:
33133328.globl clearerr
33143329.type clearerr, %function;
33153330clearerr:
3331.weak clearerr_unlocked
3332.type clearerr_unlocked, %function;
3333clearerr_unlocked:
33163334.globl dprintf
33173335.type dprintf, %function;
33183336dprintf:
......@@ -3367,27 +3385,27 @@ fclose:
33673385.weak _IO_feof_unlocked
33683386.type _IO_feof_unlocked, %function;
33693387_IO_feof_unlocked:
3370.globl feof
3371.type feof, %function;
3372feof:
33733388.weak feof_unlocked
33743389.type feof_unlocked, %function;
33753390feof_unlocked:
3376.globl ferror
3377.type ferror, %function;
3378ferror:
3391.globl feof
3392.type feof, %function;
3393feof:
33793394.weak ferror_unlocked
33803395.type ferror_unlocked, %function;
33813396ferror_unlocked:
33823397.weak _IO_ferror_unlocked
33833398.type _IO_ferror_unlocked, %function;
33843399_IO_ferror_unlocked:
3385.weak fflush_unlocked
3386.type fflush_unlocked, %function;
3387fflush_unlocked:
3400.globl ferror
3401.type ferror, %function;
3402ferror:
33883403.globl fflush
33893404.type fflush, %function;
33903405fflush:
3406.weak fflush_unlocked
3407.type fflush_unlocked, %function;
3408fflush_unlocked:
33913409.globl fgetc
33923410.type fgetc, %function;
33933411fgetc:
......@@ -3400,21 +3418,21 @@ fgetpos:
34003418.weak fgetpos64
34013419.type fgetpos64, %function;
34023420fgetpos64:
3403.weak fgets_unlocked
3404.type fgets_unlocked, %function;
3405fgets_unlocked:
34063421.globl fgets
34073422.type fgets, %function;
34083423fgets:
3409.weak getwc_unlocked
3410.type getwc_unlocked, %function;
3411getwc_unlocked:
3412.weak fgetwc_unlocked
3413.type fgetwc_unlocked, %function;
3414fgetwc_unlocked:
3424.weak fgets_unlocked
3425.type fgets_unlocked, %function;
3426fgets_unlocked:
34153427.globl __fgetwc_unlocked
34163428.type __fgetwc_unlocked, %function;
34173429__fgetwc_unlocked:
3430.weak fgetwc_unlocked
3431.type fgetwc_unlocked, %function;
3432fgetwc_unlocked:
3433.weak getwc_unlocked
3434.type getwc_unlocked, %function;
3435getwc_unlocked:
34183436.globl fgetwc
34193437.type fgetwc, %function;
34203438fgetwc:
......@@ -3424,12 +3442,12 @@ fgetws_unlocked:
34243442.globl fgetws
34253443.type fgetws, %function;
34263444fgetws:
3427.weak fileno_unlocked
3428.type fileno_unlocked, %function;
3429fileno_unlocked:
34303445.globl fileno
34313446.type fileno, %function;
34323447fileno:
3448.weak fileno_unlocked
3449.type fileno_unlocked, %function;
3450fileno_unlocked:
34333451.globl flockfile
34343452.type flockfile, %function;
34353453flockfile:
......@@ -3451,30 +3469,30 @@ fprintf:
34513469.globl fputc
34523470.type fputc, %function;
34533471fputc:
3454.weak fputs_unlocked
3455.type fputs_unlocked, %function;
3456fputs_unlocked:
34573472.globl fputs
34583473.type fputs, %function;
34593474fputs:
3460.weak putwc_unlocked
3461.type putwc_unlocked, %function;
3462putwc_unlocked:
3463.weak fputwc_unlocked
3464.type fputwc_unlocked, %function;
3465fputwc_unlocked:
3475.weak fputs_unlocked
3476.type fputs_unlocked, %function;
3477fputs_unlocked:
34663478.globl __fputwc_unlocked
34673479.type __fputwc_unlocked, %function;
34683480__fputwc_unlocked:
3481.weak fputwc_unlocked
3482.type fputwc_unlocked, %function;
3483fputwc_unlocked:
3484.weak putwc_unlocked
3485.type putwc_unlocked, %function;
3486putwc_unlocked:
34693487.globl fputwc
34703488.type fputwc, %function;
34713489fputwc:
3472.globl fputws
3473.type fputws, %function;
3474fputws:
34753490.weak fputws_unlocked
34763491.type fputws_unlocked, %function;
34773492fputws_unlocked:
3493.globl fputws
3494.type fputws, %function;
3495fputws:
34783496.globl fread
34793497.type fread, %function;
34803498fread:
......@@ -3493,12 +3511,12 @@ __isoc99_fscanf:
34933511.globl fscanf
34943512.type fscanf, %function;
34953513fscanf:
3496.weak fseeko
3497.type fseeko, %function;
3498fseeko:
34993514.weak fseeko64
35003515.type fseeko64, %function;
35013516fseeko64:
3517.weak fseeko
3518.type fseeko, %function;
3519fseeko:
35023520.globl fseek
35033521.type fseek, %function;
35043522fseek:
......@@ -3529,33 +3547,33 @@ fwide:
35293547.globl fwprintf
35303548.type fwprintf, %function;
35313549fwprintf:
3532.weak fwrite_unlocked
3533.type fwrite_unlocked, %function;
3534fwrite_unlocked:
35353550.globl fwrite
35363551.type fwrite, %function;
35373552fwrite:
3538.globl fwscanf
3539.type fwscanf, %function;
3540fwscanf:
3553.weak fwrite_unlocked
3554.type fwrite_unlocked, %function;
3555fwrite_unlocked:
35413556.weak __isoc99_fwscanf
35423557.type __isoc99_fwscanf, %function;
35433558__isoc99_fwscanf:
3559.globl fwscanf
3560.type fwscanf, %function;
3561fwscanf:
35443562.globl getc
35453563.type getc, %function;
35463564getc:
35473565.weak _IO_getc
35483566.type _IO_getc, %function;
35493567_IO_getc:
3550.weak _IO_getc_unlocked
3551.type _IO_getc_unlocked, %function;
3552_IO_getc_unlocked:
3553.globl getc_unlocked
3554.type getc_unlocked, %function;
3555getc_unlocked:
35563568.weak fgetc_unlocked
35573569.type fgetc_unlocked, %function;
35583570fgetc_unlocked:
3571.globl getc_unlocked
3572.type getc_unlocked, %function;
3573getc_unlocked:
3574.weak _IO_getc_unlocked
3575.type _IO_getc_unlocked, %function;
3576_IO_getc_unlocked:
35593577.globl getchar
35603578.type getchar, %function;
35613579getchar:
......@@ -3580,12 +3598,12 @@ getw:
35803598.globl getwc
35813599.type getwc, %function;
35823600getwc:
3583.globl getwchar
3584.type getwchar, %function;
3585getwchar:
35863601.weak getwchar_unlocked
35873602.type getwchar_unlocked, %function;
35883603getwchar_unlocked:
3604.globl getwchar
3605.type getwchar, %function;
3606getwchar:
35893607.globl open_memstream
35903608.type open_memstream, %function;
35913609open_memstream:
......@@ -3610,15 +3628,15 @@ putc:
36103628.weak _IO_putc
36113629.type _IO_putc, %function;
36123630_IO_putc:
3613.weak _IO_putc_unlocked
3614.type _IO_putc_unlocked, %function;
3615_IO_putc_unlocked:
3616.globl putc_unlocked
3617.type putc_unlocked, %function;
3618putc_unlocked:
36193631.weak fputc_unlocked
36203632.type fputc_unlocked, %function;
36213633fputc_unlocked:
3634.globl putc_unlocked
3635.type putc_unlocked, %function;
3636putc_unlocked:
3637.weak _IO_putc_unlocked
3638.type _IO_putc_unlocked, %function;
3639_IO_putc_unlocked:
36223640.globl putchar
36233641.type putchar, %function;
36243642putchar:
......@@ -3673,12 +3691,12 @@ snprintf:
36733691.globl sprintf
36743692.type sprintf, %function;
36753693sprintf:
3676.weak __isoc99_sscanf
3677.type __isoc99_sscanf, %function;
3678__isoc99_sscanf:
36793694.globl sscanf
36803695.type sscanf, %function;
36813696sscanf:
3697.weak __isoc99_sscanf
3698.type __isoc99_sscanf, %function;
3699__isoc99_sscanf:
36823700.globl swprintf
36833701.type swprintf, %function;
36843702swprintf:
......@@ -3691,12 +3709,12 @@ __isoc99_swscanf:
36913709.globl tempnam
36923710.type tempnam, %function;
36933711tempnam:
3694.globl tmpfile
3695.type tmpfile, %function;
3696tmpfile:
36973712.weak tmpfile64
36983713.type tmpfile64, %function;
36993714tmpfile64:
3715.globl tmpfile
3716.type tmpfile, %function;
3717tmpfile:
37003718.globl tmpnam
37013719.type tmpnam, %function;
37023720tmpnam:
......@@ -3715,30 +3733,30 @@ vdprintf:
37153733.globl vfprintf
37163734.type vfprintf, %function;
37173735vfprintf:
3718.weak __isoc99_vfscanf
3719.type __isoc99_vfscanf, %function;
3720__isoc99_vfscanf:
37213736.globl vfscanf
37223737.type vfscanf, %function;
37233738vfscanf:
3739.weak __isoc99_vfscanf
3740.type __isoc99_vfscanf, %function;
3741__isoc99_vfscanf:
37243742.globl vfwprintf
37253743.type vfwprintf, %function;
37263744vfwprintf:
3727.globl vfwscanf
3728.type vfwscanf, %function;
3729vfwscanf:
37303745.weak __isoc99_vfwscanf
37313746.type __isoc99_vfwscanf, %function;
37323747__isoc99_vfwscanf:
3748.globl vfwscanf
3749.type vfwscanf, %function;
3750vfwscanf:
37333751.globl vprintf
37343752.type vprintf, %function;
37353753vprintf:
3736.weak __isoc99_vscanf
3737.type __isoc99_vscanf, %function;
3738__isoc99_vscanf:
37393754.globl vscanf
37403755.type vscanf, %function;
37413756vscanf:
3757.weak __isoc99_vscanf
3758.type __isoc99_vscanf, %function;
3759__isoc99_vscanf:
37423760.globl vsnprintf
37433761.type vsnprintf, %function;
37443762vsnprintf:
......@@ -3772,12 +3790,12 @@ __isoc99_vwscanf:
37723790.globl wprintf
37733791.type wprintf, %function;
37743792wprintf:
3775.weak __isoc99_wscanf
3776.type __isoc99_wscanf, %function;
3777__isoc99_wscanf:
37783793.globl wscanf
37793794.type wscanf, %function;
37803795wscanf:
3796.weak __isoc99_wscanf
3797.type __isoc99_wscanf, %function;
3798__isoc99_wscanf:
37813799.globl abs
37823800.type abs, %function;
37833801abs:
......@@ -3826,36 +3844,21 @@ llabs:
38263844.globl lldiv
38273845.type lldiv, %function;
38283846lldiv:
3847.weak qsort_r
3848.type qsort_r, %function;
3849qsort_r:
38293850.globl qsort
38303851.type qsort, %function;
38313852qsort:
3832.weak __strtof_l
3833.type __strtof_l, %function;
3834__strtof_l:
3835.weak strtof_l
3836.type strtof_l, %function;
3837strtof_l:
38383853.globl strtof
38393854.type strtof, %function;
38403855strtof:
38413856.globl strtod
38423857.type strtod, %function;
38433858strtod:
3844.weak __strtod_l
3845.type __strtod_l, %function;
3846__strtod_l:
3847.weak strtod_l
3848.type strtod_l, %function;
3849strtod_l:
3850.weak strtold_l
3851.type strtold_l, %function;
3852strtold_l:
38533859.globl strtold
38543860.type strtold, %function;
38553861strtold:
3856.weak __strtold_l
3857.type __strtold_l, %function;
3858__strtold_l:
38593862.globl strtoull
38603863.type strtoull, %function;
38613864strtoull:
......@@ -3868,12 +3871,12 @@ strtoll:
38683871.weak __strtoll_internal
38693872.type __strtoll_internal, %function;
38703873__strtoll_internal:
3871.globl strtoul
3872.type strtoul, %function;
3873strtoul:
38743874.weak __strtoul_internal
38753875.type __strtoul_internal, %function;
38763876__strtoul_internal:
3877.globl strtoul
3878.type strtoul, %function;
3879strtoul:
38773880.weak __strtol_internal
38783881.type __strtol_internal, %function;
38793882__strtol_internal:
......@@ -3973,12 +3976,12 @@ stpncpy:
39733976.globl strcasecmp
39743977.type strcasecmp, %function;
39753978strcasecmp:
3976.weak strcasecmp_l
3977.type strcasecmp_l, %function;
3978strcasecmp_l:
39793979.globl __strcasecmp_l
39803980.type __strcasecmp_l, %function;
39813981__strcasecmp_l:
3982.weak strcasecmp_l
3983.type strcasecmp_l, %function;
3984strcasecmp_l:
39823985.globl strcasestr
39833986.type strcasestr, %function;
39843987strcasestr:
......@@ -4003,12 +4006,12 @@ strcspn:
40034006.globl strdup
40044007.type strdup, %function;
40054008strdup:
4006.globl strerror_r
4007.type strerror_r, %function;
4008strerror_r:
40094009.weak __xpg_strerror_r
40104010.type __xpg_strerror_r, %function;
40114011__xpg_strerror_r:
4012.globl strerror_r
4013.type strerror_r, %function;
4014strerror_r:
40124015.globl strlcat
40134016.type strlcat, %function;
40144017strlcat:
......@@ -4165,24 +4168,24 @@ mkostemp:
41654168.weak mkostemp64
41664169.type mkostemp64, %function;
41674170mkostemp64:
4168.weak mkostemps
4169.type mkostemps, %function;
4170mkostemps:
41714171.weak mkostemps64
41724172.type mkostemps64, %function;
41734173mkostemps64:
4174.weak mkostemps
4175.type mkostemps, %function;
4176mkostemps:
41744177.globl mkstemp
41754178.type mkstemp, %function;
41764179mkstemp:
41774180.weak mkstemp64
41784181.type mkstemp64, %function;
41794182mkstemp64:
4180.globl mkstemps
4181.type mkstemps, %function;
4182mkstemps:
41834183.weak mkstemps64
41844184.type mkstemps64, %function;
41854185mkstemps64:
4186.globl mkstemps
4187.type mkstemps, %function;
4188mkstemps:
41864189.globl mktemp
41874190.type mktemp, %function;
41884191mktemp:
......@@ -4195,12 +4198,12 @@ cfgetispeed:
41954198.globl cfmakeraw
41964199.type cfmakeraw, %function;
41974200cfmakeraw:
4198.globl cfsetospeed
4199.type cfsetospeed, %function;
4200cfsetospeed:
42014201.weak cfsetspeed
42024202.type cfsetspeed, %function;
42034203cfsetspeed:
4204.globl cfsetospeed
4205.type cfsetospeed, %function;
4206cfsetospeed:
42044207.globl cfsetispeed
42054208.type cfsetispeed, %function;
42064209cfsetispeed:
......@@ -4438,15 +4441,18 @@ pthread_getconcurrency:
44384441.globl pthread_getcpuclockid
44394442.type pthread_getcpuclockid, %function;
44404443pthread_getcpuclockid:
4444.globl pthread_getname_np
4445.type pthread_getname_np, %function;
4446pthread_getname_np:
44414447.globl pthread_getschedparam
44424448.type pthread_getschedparam, %function;
44434449pthread_getschedparam:
4444.weak tss_get
4445.type tss_get, %function;
4446tss_get:
44474450.weak pthread_getspecific
44484451.type pthread_getspecific, %function;
44494452pthread_getspecific:
4453.weak tss_get
4454.type tss_get, %function;
4455tss_get:
44504456.weak pthread_join
44514457.type pthread_join, %function;
44524458pthread_join:
......@@ -4549,12 +4555,12 @@ pthread_rwlockattr_init:
45494555.globl pthread_rwlockattr_setpshared
45504556.type pthread_rwlockattr_setpshared, %function;
45514557pthread_rwlockattr_setpshared:
4552.weak pthread_self
4553.type pthread_self, %function;
4554pthread_self:
45554558.weak thrd_current
45564559.type thrd_current, %function;
45574560thrd_current:
4561.weak pthread_self
4562.type pthread_self, %function;
4563pthread_self:
45584564.globl pthread_setattr_default_np
45594565.type pthread_setattr_default_np, %function;
45604566pthread_setattr_default_np:
......@@ -4819,12 +4825,12 @@ fdatasync:
48194825.globl fsync
48204826.type fsync, %function;
48214827fsync:
4822.weak ftruncate64
4823.type ftruncate64, %function;
4824ftruncate64:
48254828.globl ftruncate
48264829.type ftruncate, %function;
48274830ftruncate:
4831.weak ftruncate64
4832.type ftruncate64, %function;
4833ftruncate64:
48284834.globl getcwd
48294835.type getcwd, %function;
48304836getcwd:
......@@ -4918,12 +4924,12 @@ pwrite:
49184924.weak pwrite64
49194925.type pwrite64, %function;
49204926pwrite64:
4921.weak pwritev64
4922.type pwritev64, %function;
4923pwritev64:
49244927.globl pwritev
49254928.type pwritev, %function;
49264929pwritev:
4930.weak pwritev64
4931.type pwritev64, %function;
4932pwritev64:
49274933.globl read
49284934.type read, %function;
49294935read:
......@@ -5075,10 +5081,6 @@ _dl_debug_addr:
50755081.type ___environ, %object;
50765082.size ___environ, PTR_SIZE_BYTES
50775083___environ:
5078.weak _environ
5079.type _environ, %object;
5080.size _environ, PTR_SIZE_BYTES
5081_environ:
50825084.globl __environ
50835085.type __environ, %object;
50845086.size __environ, PTR_SIZE_BYTES
......@@ -5087,6 +5089,10 @@ __environ:
50875089.type environ, %object;
50885090.size environ, PTR_SIZE_BYTES
50895091environ:
5092.weak _environ
5093.type _environ, %object;
5094.size _environ, PTR_SIZE_BYTES
5095_environ:
50905096.globl __stack_chk_guard
50915097.type __stack_chk_guard, %object;
50925098.size __stack_chk_guard, PTR_SIZE_BYTES
lib/libc/musl/src/complex/cacosf.c+3-1
......@@ -2,8 +2,10 @@
22
33// FIXME
44
5static const float float_pi_2 = M_PI_2;
6
57float complex cacosf(float complex z)
68{
79 z = casinf(z);
8 return CMPLXF((float)M_PI_2 - crealf(z), -cimagf(z));
10 return CMPLXF(float_pi_2 - crealf(z), -cimagf(z));
911}
lib/libc/musl/src/complex/catanf.c+3-1
......@@ -61,13 +61,15 @@ static const double DP1 = 3.140625;
6161static const double DP2 = 9.67502593994140625E-4;
6262static const double DP3 = 1.509957990978376432E-7;
6363
64static const float float_pi = M_PI;
65
6466static float _redupif(float xx)
6567{
6668 float x, t;
6769 long i;
6870
6971 x = xx;
70 t = x/(float)M_PI;
72 t = x/float_pi;
7173 if (t >= 0.0f)
7274 t += 0.5f;
7375 else
lib/libc/musl/src/complex/cproj.c+1-1
......@@ -3,6 +3,6 @@
33double complex cproj(double complex z)
44{
55 if (isinf(creal(z)) || isinf(cimag(z)))
6 return CMPLX(INFINITY, copysign(0.0, creal(z)));
6 return CMPLX(INFINITY, copysign(0.0, cimag(z)));
77 return z;
88}
lib/libc/musl/src/complex/cprojf.c+1-1
......@@ -3,6 +3,6 @@
33float complex cprojf(float complex z)
44{
55 if (isinf(crealf(z)) || isinf(cimagf(z)))
6 return CMPLXF(INFINITY, copysignf(0.0, crealf(z)));
6 return CMPLXF(INFINITY, copysignf(0.0, cimagf(z)));
77 return z;
88}
lib/libc/musl/src/complex/cprojl.c+1-1
......@@ -9,7 +9,7 @@ long double complex cprojl(long double complex z)
99long double complex cprojl(long double complex z)
1010{
1111 if (isinf(creall(z)) || isinf(cimagl(z)))
12 return CMPLXL(INFINITY, copysignl(0.0, creall(z)));
12 return CMPLXL(INFINITY, copysignl(0.0, cimagl(z)));
1313 return z;
1414}
1515#endif
lib/libc/musl/src/ctype/nonspacing.h+60-58
......@@ -1,23 +1,23 @@
116,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,
236,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,
116,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,
237,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,
3316,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
4416,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
5516,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
6616,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
716,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,
716,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,
8816,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
916,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,
1016,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,51,16,16,52,
1153,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,
1269,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,
1316,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,
91416,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1016,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,49,16,16,50,
1151,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,
1267,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,
1316,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,
1516,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,
141616,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1516,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,
161716,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1716,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1816,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,
1916,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,
2084,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
1816,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,
1916,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,
2086,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
212116,0,0,0,0,0,0,0,0,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,
2222255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2323255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
......@@ -35,55 +35,57 @@
3535242,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,
36362,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,
37370,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,
380,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,
390,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,
400,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,
410,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,
42229,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,
430,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,
440,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,
450,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,
380,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,
39255,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,
400,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,
4115,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,
420,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,
43128,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,
4415,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,
450,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,
463,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,
4647251,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,
4748255,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,
48490,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,
49500,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,
50510,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,
51520,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,
520,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,
530,16,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64,
540,0,0,0,0,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,
550,0,0,0,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,
560,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,
570,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,
580,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,
590,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,
600,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,
610,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,
620,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,
63127,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,
640,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,
650,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,
6631,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,
670,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,
680,60,176,1,0,0,48,0,0,0,
690,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,
700,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,
71128,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,
720,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,
73126,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,
740,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,
750,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,
760,0,0,0,0,0,0,0,0,0,0,0,0,0,24,
770,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,
780,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,
790,0,0,0,0,0,0,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,
800,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,
810,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,
820,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,
830,0,0,255,255,255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248,
84254,255,0,0,0,0,0,0,0,0,0,
850,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,
860,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,
870,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,
880,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,
890,0,0,0,0,0,0,0,0,0,0,0,0,0,
530,0,0,0,7,0,0,0,0,0,200,51,0,0,0,0,32,0,0,
540,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,
550,0,0,0,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,
560,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,
5764,0,0,0,0,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,
58255,0,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,
590,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,
600,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,
610,0,0,0,0,0,1,0,0,
620,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,
630,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,
640,0,0,0,0,0,0,0,0,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,
650,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,
663,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,
670,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,
680,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,
690,0,0,0,0,0,0,0,0,
700,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,
710,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,
72248,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,
730,0,0,0,0,0,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,
740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
750,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,
76127,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,
77255,252,109,0,0,0,0,0,0,0,0,
780,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,
790,0,0,0,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,
801,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
810,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,
820,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,
830,0,0,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,
840,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,
850,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,
86255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248,254,255,0,0,0,
870,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,
880,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,
890,0,0,0,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,
900,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,
910,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
lib/libc/musl/src/env/__libc_start_main.c+2-1
......@@ -69,7 +69,8 @@ weak_alias(libc_start_init, __libc_start_init);
6969typedef int lsm2_fn(int (*)(int,char **,char **), int, char **);
7070static lsm2_fn libc_start_main_stage2;
7171
72int __libc_start_main(int (*main)(int,char **,char **), int argc, char **argv)
72int __libc_start_main(int (*main)(int,char **,char **), int argc, char **argv,
73 void (*init_dummy)(), void(*fini_dummy)(), void(*ldso_dummy)())
7374{
7475 char **envp = argv+argc+1;
7576
lib/libc/musl/src/env/__stack_chk_fail.c+9
......@@ -9,6 +9,15 @@ void __init_ssp(void *entropy)
99 if (entropy) memcpy(&__stack_chk_guard, entropy, sizeof(uintptr_t));
1010 else __stack_chk_guard = (uintptr_t)&__stack_chk_guard * 1103515245;
1111
12#if UINTPTR_MAX >= 0xffffffffffffffff
13 /* Sacrifice 8 bits of entropy on 64bit to prevent leaking/
14 * overwriting the canary via string-manipulation functions.
15 * The NULL byte is on the second byte so that off-by-ones can
16 * still be detected. Endianness is taken care of
17 * automatically. */
18 ((char *)&__stack_chk_guard)[1] = 0;
19#endif
20
1221 __pthread_self()->canary = __stack_chk_guard;
1322}
1423
lib/libc/musl/src/errno/__strerror.h+4
......@@ -102,3 +102,7 @@ E(EDQUOT, "Quota exceeded")
102102E(ENOMEDIUM, "No medium found")
103103E(EMEDIUMTYPE, "Wrong medium type")
104104E(EMULTIHOP, "Multihop attempted")
105E(ENOKEY, "Required key not available")
106E(EKEYEXPIRED, "Key has expired")
107E(EKEYREVOKED, "Key has been revoked")
108E(EKEYREJECTED, "Key was rejected by service")
lib/libc/musl/src/fenv/powerpc/fenv-sf.c+1-1
......@@ -1,3 +1,3 @@
1#ifdef _SOFT_FLOAT
1#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__)
22#include "../fenv.c"
33#endif
lib/libc/musl/src/fenv/powerpc/fenv.S+1-1
......@@ -1,4 +1,4 @@
1#ifndef _SOFT_FLOAT
1#if !defined(_SOFT_FLOAT) && !defined(__NO_FPRS__)
22.global feclearexcept
33.type feclearexcept,@function
44feclearexcept:
lib/libc/musl/src/include/stdlib.h+1
......@@ -8,6 +8,7 @@ hidden void __env_rm_add(char *, char *);
88hidden int __mkostemps(char *, int, int);
99hidden int __ptsname_r(int, char *, size_t);
1010hidden char *__randname(char *);
11hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
1112
1213hidden void *__libc_malloc(size_t);
1314hidden void *__libc_malloc_impl(size_t);
lib/libc/musl/src/internal/version.h+1-1
......@@ -1 +1 @@
1#define VERSION "1.2.2"
1#define VERSION "1.2.3"
lib/libc/musl/src/ldso/dl_iterate_phdr.c+2-1
......@@ -1,5 +1,6 @@
11#include <elf.h>
22#include <link.h>
3#include "pthread_impl.h"
34#include "libc.h"
45
56#define AUX_CNT 38
......@@ -35,7 +36,7 @@ static int static_dl_iterate_phdr(int(*callback)(struct dl_phdr_info *info, size
3536 info.dlpi_subs = 0;
3637 if (tls_phdr) {
3738 info.dlpi_tls_modid = 1;
38 info.dlpi_tls_data = (void *)(base + tls_phdr->p_vaddr);
39 info.dlpi_tls_data = __tls_get_addr((tls_mod_off_t[]){1,0});
3940 } else {
4041 info.dlpi_tls_modid = 0;
4142 info.dlpi_tls_data = 0;
lib/libc/musl/src/legacy/cuserid.c+11-3
......@@ -2,13 +2,21 @@
22#include <pwd.h>
33#include <stdio.h>
44#include <unistd.h>
5#include <string.h>
56
67char *cuserid(char *buf)
78{
9 static char usridbuf[L_cuserid];
810 struct passwd pw, *ppw;
911 long pwb[256];
10 if (getpwuid_r(geteuid(), &pw, (void *)pwb, sizeof pwb, &ppw))
11 return 0;
12 snprintf(buf, L_cuserid, "%s", pw.pw_name);
12 if (buf) *buf = 0;
13 getpwuid_r(geteuid(), &pw, (void *)pwb, sizeof pwb, &ppw);
14 if (!ppw)
15 return buf;
16 size_t len = strnlen(pw.pw_name, L_cuserid);
17 if (len == L_cuserid)
18 return buf;
19 if (!buf) buf = usridbuf;
20 memcpy(buf, pw.pw_name, len+1);
1321 return buf;
1422}
lib/libc/musl/src/linux/epoll.c+2-2
......@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
2424
2525int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
2626{
27 int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
27 int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
2828#ifdef SYS_epoll_wait
29 if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to);
29 if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to);
3030#endif
3131 return __syscall_ret(r);
3232}
lib/libc/musl/src/locale/dcngettext.c+3
......@@ -132,6 +132,9 @@ char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2,
132132 struct binding *q;
133133 int old_errno = errno;
134134
135 /* match gnu gettext behaviour */
136 if (!msgid1) goto notrans;
137
135138 if ((unsigned)category >= LC_ALL) goto notrans;
136139
137140 if (!domainname) domainname = __gettextdomain();
lib/libc/musl/src/locale/duplocale.c+5
......@@ -3,6 +3,11 @@
33#include "locale_impl.h"
44#include "libc.h"
55
6#define malloc __libc_malloc
7#define calloc undef
8#define realloc undef
9#define free undef
10
611locale_t __duplocale(locale_t old)
712{
813 locale_t new = malloc(sizeof *new);
lib/libc/musl/src/locale/strtod_l.c created+22
......@@ -0,0 +1,22 @@
1#define _GNU_SOURCE
2#include <stdlib.h>
3#include <locale.h>
4
5float strtof_l(const char *restrict s, char **restrict p, locale_t l)
6{
7 return strtof(s, p);
8}
9
10double strtod_l(const char *restrict s, char **restrict p, locale_t l)
11{
12 return strtod(s, p);
13}
14
15long double strtold_l(const char *restrict s, char **restrict p, locale_t l)
16{
17 return strtold(s, p);
18}
19
20weak_alias(strtof_l, __strtof_l);
21weak_alias(strtod_l, __strtod_l);
22weak_alias(strtold_l, __strtold_l);
lib/libc/musl/src/malloc/free.c+1-1
......@@ -2,5 +2,5 @@
22
33void free(void *p)
44{
5 return __libc_free(p);
5 __libc_free(p);
66}
lib/libc/musl/src/malloc/mallocng/aligned_alloc.c+3
......@@ -22,6 +22,9 @@ void *aligned_alloc(size_t align, size_t len)
2222 if (align <= UNIT) align = UNIT;
2323
2424 unsigned char *p = malloc(len + align - UNIT);
25 if (!p)
26 return 0;
27
2528 struct meta *g = get_meta(p);
2629 int idx = get_slot_index(p);
2730 size_t stride = get_stride(g);
lib/libc/musl/src/malloc/mallocng/free.c+10-2
......@@ -119,7 +119,11 @@ void free(void *p)
119119 if (((uintptr_t)(start-1) ^ (uintptr_t)end) >= 2*PGSZ && g->last_idx) {
120120 unsigned char *base = start + (-(uintptr_t)start & (PGSZ-1));
121121 size_t len = (end-base) & -PGSZ;
122 if (len) madvise(base, len, MADV_FREE);
122 if (len) {
123 int e = errno;
124 madvise(base, len, MADV_FREE);
125 errno = e;
126 }
123127 }
124128
125129 // atomic free without locking if this is neither first or last slot
......@@ -139,5 +143,9 @@ void free(void *p)
139143 wrlock();
140144 struct mapinfo mi = nontrivial_free(g, idx);
141145 unlock();
142 if (mi.len) munmap(mi.base, mi.len);
146 if (mi.len) {
147 int e = errno;
148 munmap(mi.base, mi.len);
149 errno = e;
150 }
143151}
lib/libc/musl/src/malloc/oldmalloc/malloc.c+5-1
......@@ -11,7 +11,7 @@
1111#include "malloc_impl.h"
1212#include "fork_impl.h"
1313
14#define malloc __libc_malloc
14#define malloc __libc_malloc_impl
1515#define realloc __libc_realloc
1616#define free __libc_free
1717
......@@ -481,12 +481,14 @@ void __bin_chunk(struct chunk *self)
481481 if (size > RECLAIM && (size^(size-osize)) > size-osize) {
482482 uintptr_t a = (uintptr_t)self + SIZE_ALIGN+PAGE_SIZE-1 & -PAGE_SIZE;
483483 uintptr_t b = (uintptr_t)next - SIZE_ALIGN & -PAGE_SIZE;
484 int e = errno;
484485#if 1
485486 __madvise((void *)a, b-a, MADV_DONTNEED);
486487#else
487488 __mmap((void *)a, b-a, PROT_READ|PROT_WRITE,
488489 MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0);
489490#endif
491 errno = e;
490492 }
491493
492494 unlock_bin(i);
......@@ -499,7 +501,9 @@ static void unmap_chunk(struct chunk *self)
499501 size_t len = CHUNK_SIZE(self) + extra;
500502 /* Crash on double free */
501503 if (extra & 1) a_crash();
504 int e = errno;
502505 __munmap(base, len);
506 errno = e;
503507}
504508
505509void free(void *p)
lib/libc/musl/src/math/acoshf.c+4-4
......@@ -15,12 +15,12 @@ float acoshf(float x)
1515 uint32_t a = u.i & 0x7fffffff;
1616
1717 if (a < 0x3f800000+(1<<23))
18 /* |x| < 2, invalid if x < 1 or nan */
18 /* |x| < 2, invalid if x < 1 */
1919 /* up to 2ulp error in [1,1.125] */
2020 return log1pf(x-1 + sqrtf((x-1)*(x-1)+2*(x-1)));
21 if (a < 0x3f800000+(12<<23))
22 /* |x| < 0x1p12 */
21 if (u.i < 0x3f800000+(12<<23))
22 /* 2 <= x < 0x1p12 */
2323 return logf(2*x - 1/(x+sqrtf(x*x-1)));
24 /* x >= 0x1p12 */
24 /* x >= 0x1p12 or x <= -2 or nan */
2525 return logf(x) + 0.693147180559945309417232121458176568f;
2626}
lib/libc/musl/src/math/expm1f.c+1-2
......@@ -16,7 +16,6 @@
1616#include "libm.h"
1717
1818static const float
19o_threshold = 8.8721679688e+01, /* 0x42b17180 */
2019ln2_hi = 6.9313812256e-01, /* 0x3f317180 */
2120ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */
2221invln2 = 1.4426950216e+00, /* 0x3fb8aa3b */
......@@ -41,7 +40,7 @@ float expm1f(float x)
4140 return x;
4241 if (sign)
4342 return -1;
44 if (x > o_threshold) {
43 if (hx > 0x42b17217) { /* x > log(FLT_MAX) */
4544 x *= 0x1p127f;
4645 return x;
4746 }
lib/libc/musl/src/math/fmaf.c+10-11
......@@ -77,17 +77,16 @@ float fmaf(float x, float y, float z)
7777 * If result is inexact, and exactly halfway between two float values,
7878 * we need to adjust the low-order bit in the direction of the error.
7979 */
80#ifdef FE_TOWARDZERO
81 fesetround(FE_TOWARDZERO);
82#endif
83 volatile double vxy = xy; /* XXX work around gcc CSE bug */
84 double adjusted_result = vxy + z;
85 fesetround(FE_TONEAREST);
86 if (result == adjusted_result) {
87 u.f = adjusted_result;
80 double err;
81 int neg = u.i >> 63;
82 if (neg == (z > xy))
83 err = xy - result + z;
84 else
85 err = z - result + xy;
86 if (neg == (err < 0))
8887 u.i++;
89 adjusted_result = u.f;
90 }
91 z = adjusted_result;
88 else
89 u.i--;
90 z = u.f;
9291 return z;
9392}
lib/libc/musl/src/math/powerpc/fabs.c+1-1
......@@ -1,6 +1,6 @@
11#include <math.h>
22
3#if defined(_SOFT_FLOAT) || defined(BROKEN_PPC_D_ASM)
3#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) || defined(BROKEN_PPC_D_ASM)
44
55#include "../fabs.c"
66
lib/libc/musl/src/math/powerpc/fabsf.c+1-1
......@@ -1,6 +1,6 @@
11#include <math.h>
22
3#ifdef _SOFT_FLOAT
3#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__)
44
55#include "../fabsf.c"
66
lib/libc/musl/src/math/powerpc/fma.c+1-1
......@@ -1,6 +1,6 @@
11#include <math.h>
22
3#if defined(_SOFT_FLOAT) || defined(BROKEN_PPC_D_ASM)
3#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) || defined(BROKEN_PPC_D_ASM)
44
55#include "../fma.c"
66
lib/libc/musl/src/math/powerpc/fmaf.c+1-1
......@@ -1,6 +1,6 @@
11#include <math.h>
22
3#ifdef _SOFT_FLOAT
3#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__)
44
55#include "../fmaf.c"
66
lib/libc/musl/src/misc/ioctl.c+7-2
......@@ -6,6 +6,7 @@
66#include <stddef.h>
77#include <stdint.h>
88#include <string.h>
9#include <endian.h>
910#include "syscall.h"
1011
1112#define alignof(t) offsetof(struct { char c; t x; }, x)
......@@ -53,7 +54,7 @@ static const struct ioctl_compat_map compat_map[] = {
5354 { _IOWR('A', 0x23, char[136]), _IOWR('A', 0x23, char[132]), 0, WR, 1, 0 },
5455 { 0, 0, 4, WR, 1, 0 }, /* snd_pcm_sync_ptr (flags only) */
5556 { 0, 0, 32, WR, 1, OFFS(8,12,16,24,28) }, /* snd_pcm_mmap_status */
56 { 0, 0, 8, WR, 1, OFFS(0,4) }, /* snd_pcm_mmap_control */
57 { 0, 0, 4, WR, 1, 0 }, /* snd_pcm_mmap_control (each member) */
5758
5859 /* VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF, VIDIOC_PREPARE_BUF */
5960 { _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,
9091 * if another exception appears this needs changing. */
9192 convert_ioctl_struct(map+1, old, new, dir);
9293 convert_ioctl_struct(map+2, old+4, new+8, dir);
93 convert_ioctl_struct(map+3, old+68, new+72, dir);
94 /* snd_pcm_mmap_control, special-cased due to kernel
95 * type definition having been botched. */
96 int adj = BYTE_ORDER==BIG_ENDIAN ? 4 : 0;
97 convert_ioctl_struct(map+3, old+68, new+72+adj, dir);
98 convert_ioctl_struct(map+3, old+72, new+76+3*adj, dir);
9499 return;
95100 }
96101 for (int i=0; i < map->noffs; i++) {
lib/libc/musl/src/passwd/nscd_query.c+9-1
......@@ -40,7 +40,15 @@ retry:
4040 buf[0] = NSCDVERSION;
4141
4242 fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
43 if (fd < 0) return NULL;
43 if (fd < 0) {
44 if (errno == EAFNOSUPPORT) {
45 f = fopen("/dev/null", "re");
46 if (f)
47 errno = errno_save;
48 return f;
49 }
50 return 0;
51 }
4452
4553 if(!(f = fdopen(fd, "r"))) {
4654 close(fd);
lib/libc/musl/src/process/fdop.h+5
......@@ -10,3 +10,8 @@ struct fdop {
1010 mode_t mode;
1111 char path[];
1212};
13
14#define malloc __libc_malloc
15#define calloc __libc_calloc
16#define realloc undef
17#define free __libc_free
lib/libc/musl/src/process/posix_spawn_file_actions_addclose.c+1
......@@ -5,6 +5,7 @@
55
66int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *fa, int fd)
77{
8 if (fd < 0) return EBADF;
89 struct fdop *op = malloc(sizeof *op);
910 if (!op) return ENOMEM;
1011 op->cmd = FDOP_CLOSE;
lib/libc/musl/src/process/posix_spawn_file_actions_adddup2.c+1
......@@ -5,6 +5,7 @@
55
66int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *fa, int srcfd, int fd)
77{
8 if (srcfd < 0 || fd < 0) return EBADF;
89 struct fdop *op = malloc(sizeof *op);
910 if (!op) return ENOMEM;
1011 op->cmd = FDOP_DUP2;
lib/libc/musl/src/process/posix_spawn_file_actions_addfchdir.c+1
......@@ -6,6 +6,7 @@
66
77int posix_spawn_file_actions_addfchdir_np(posix_spawn_file_actions_t *fa, int fd)
88{
9 if (fd < 0) return EBADF;
910 struct fdop *op = malloc(sizeof *op);
1011 if (!op) return ENOMEM;
1112 op->cmd = FDOP_FCHDIR;
lib/libc/musl/src/process/posix_spawn_file_actions_addopen.c+1
......@@ -6,6 +6,7 @@
66
77int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *restrict fa, int fd, const char *restrict path, int flags, mode_t mode)
88{
9 if (fd < 0) return EBADF;
910 struct fdop *op = malloc(sizeof *op + strlen(path) + 1);
1011 if (!op) return ENOMEM;
1112 op->cmd = FDOP_OPEN;
lib/libc/musl/src/setjmp/powerpc/longjmp.S+31-1
......@@ -37,7 +37,37 @@ longjmp:
3737 lwz 29, 72(3)
3838 lwz 30, 76(3)
3939 lwz 31, 80(3)
40#ifndef _SOFT_FLOAT
40#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__)
41 mflr 0
42 bl 1f
43 .hidden __hwcap
44 .long __hwcap-.
451: mflr 4
46 lwz 5, 0(4)
47 lwzx 4, 4, 5
48 andis. 4, 4, 0x80
49 beq 1f
50 .long 0x11c35b01 /* evldd 14,88(3) */
51 .long 0x11e36301 /* ... */
52 .long 0x12036b01
53 .long 0x12237301
54 .long 0x12437b01
55 .long 0x12638301
56 .long 0x12838b01
57 .long 0x12a39301
58 .long 0x12c39b01
59 .long 0x12e3a301
60 .long 0x1303ab01
61 .long 0x1323b301
62 .long 0x1343bb01
63 .long 0x1363c301
64 .long 0x1383cb01
65 .long 0x13a3d301
66 .long 0x13c3db01
67 .long 0x13e3e301 /* evldd 31,224(3) */
68 .long 0x11a3eb01 /* evldd 13,232(3) */
691: mtlr 0
70#else
4171 lfd 14,88(3)
4272 lfd 15,96(3)
4373 lfd 16,104(3)
lib/libc/musl/src/setjmp/powerpc/setjmp.S+31-1
......@@ -37,7 +37,37 @@ setjmp:
3737 stw 29, 72(3)
3838 stw 30, 76(3)
3939 stw 31, 80(3)
40#ifndef _SOFT_FLOAT
40#if defined(_SOFT_FLOAT) || defined(__NO_FPRS__)
41 mflr 0
42 bl 1f
43 .hidden __hwcap
44 .long __hwcap-.
451: mflr 4
46 lwz 5, 0(4)
47 lwzx 4, 4, 5
48 andis. 4, 4, 0x80
49 beq 1f
50 .long 0x11c35b21 /* evstdd 14,88(3) */
51 .long 0x11e36321 /* ... */
52 .long 0x12036b21
53 .long 0x12237321
54 .long 0x12437b21
55 .long 0x12638321
56 .long 0x12838b21
57 .long 0x12a39321
58 .long 0x12c39b21
59 .long 0x12e3a321
60 .long 0x1303ab21
61 .long 0x1323b321
62 .long 0x1343bb21
63 .long 0x1363c321
64 .long 0x1383cb21
65 .long 0x13a3d321
66 .long 0x13c3db21
67 .long 0x13e3e321 /* evstdd 31,224(3) */
68 .long 0x11a3eb21 /* evstdd 13,232(3) */
691: mtlr 0
70#else
4171 stfd 14,88(3)
4272 stfd 15,96(3)
4373 stfd 16,104(3)
lib/libc/musl/src/signal/block.c+2-2
......@@ -3,9 +3,9 @@
33#include <signal.h>
44
55static const unsigned long all_mask[] = {
6#if ULONG_MAX == 0xffffffff && _NSIG == 129
6#if ULONG_MAX == 0xffffffff && _NSIG > 65
77 -1UL, -1UL, -1UL, -1UL
8#elif ULONG_MAX == 0xffffffff
8#elif ULONG_MAX == 0xffffffff || _NSIG > 65
99 -1UL, -1UL
1010#else
1111 -1UL
lib/libc/musl/src/stdio/fgetws.c+1-6
......@@ -1,6 +1,5 @@
11#include "stdio_impl.h"
22#include <wchar.h>
3#include <errno.h>
43
54wint_t __fgetwc_unlocked(FILE *);
65
......@@ -12,10 +11,6 @@ wchar_t *fgetws(wchar_t *restrict s, int n, FILE *restrict f)
1211
1312 FLOCK(f);
1413
15 /* Setup a dummy errno so we can detect EILSEQ. This is
16 * the only way to catch encoding errors in the form of a
17 * partial character just before EOF. */
18 errno = EAGAIN;
1914 for (; n; n--) {
2015 wint_t c = __fgetwc_unlocked(f);
2116 if (c == WEOF) break;
......@@ -23,7 +18,7 @@ wchar_t *fgetws(wchar_t *restrict s, int n, FILE *restrict f)
2318 if (c == '\n') break;
2419 }
2520 *p = 0;
26 if (ferror(f) || errno==EILSEQ) p = s;
21 if (ferror(f)) p = s;
2722
2823 FUNLOCK(f);
2924
lib/libc/musl/src/stdio/fseek.c+7
......@@ -1,7 +1,14 @@
11#include "stdio_impl.h"
2#include <errno.h>
23
34int __fseeko_unlocked(FILE *f, off_t off, int whence)
45{
6 /* Fail immediately for invalid whence argument. */
7 if (whence != SEEK_CUR && whence != SEEK_SET && whence != SEEK_END) {
8 errno = EINVAL;
9 return -1;
10 }
11
512 /* Adjust relative offset for unread data in buffer, if any. */
613 if (whence == SEEK_CUR && f->rend) off -= f->rend - f->rpos;
714
lib/libc/musl/src/stdio/getdelim.c+5-3
......@@ -55,9 +55,11 @@ ssize_t getdelim(char **restrict s, size_t *restrict n, int delim, FILE *restric
5555 *s = tmp;
5656 *n = m;
5757 }
58 memcpy(*s+i, f->rpos, k);
59 f->rpos += k;
60 i += k;
58 if (k) {
59 memcpy(*s+i, f->rpos, k);
60 f->rpos += k;
61 i += k;
62 }
6163 if (z) break;
6264 if ((c = getc_unlocked(f)) == EOF) {
6365 if (!i || !feof(f)) {
lib/libc/musl/src/stdio/popen.c+6-18
......@@ -31,25 +31,12 @@ FILE *popen(const char *cmd, const char *mode)
3131 __syscall(SYS_close, p[1]);
3232 return NULL;
3333 }
34 FLOCK(f);
35
36 /* If the child's end of the pipe happens to already be on the final
37 * fd number to which it will be assigned (either 0 or 1), it must
38 * be moved to a different fd. Otherwise, there is no safe way to
39 * remove the close-on-exec flag in the child without also creating
40 * a file descriptor leak race condition in the parent. */
41 if (p[1-op] == 1-op) {
42 int tmp = fcntl(1-op, F_DUPFD_CLOEXEC, 0);
43 if (tmp < 0) {
44 e = errno;
45 goto fail;
46 }
47 __syscall(SYS_close, p[1-op]);
48 p[1-op] = tmp;
49 }
5034
5135 e = ENOMEM;
5236 if (!posix_spawn_file_actions_init(&fa)) {
37 for (FILE *l = *__ofl_lock(); l; l=l->next)
38 if (l->pipe_pid && posix_spawn_file_actions_addclose(&fa, l->fd))
39 goto fail;
5340 if (!posix_spawn_file_actions_adddup2(&fa, p[1-op], 1-op)) {
5441 if (!(e = posix_spawn(&pid, "/bin/sh", &fa, 0,
5542 (char *[]){ "sh", "-c", (char *)cmd, 0 }, __environ))) {
......@@ -58,13 +45,14 @@ FILE *popen(const char *cmd, const char *mode)
5845 if (!strchr(mode, 'e'))
5946 fcntl(p[op], F_SETFD, 0);
6047 __syscall(SYS_close, p[1-op]);
61 FUNLOCK(f);
48 __ofl_unlock();
6249 return f;
6350 }
6451 }
52fail:
53 __ofl_unlock();
6554 posix_spawn_file_actions_destroy(&fa);
6655 }
67fail:
6856 fclose(f);
6957 __syscall(SYS_close, p[1-op]);
7058
lib/libc/musl/src/stdlib/qsort.c+20-17
......@@ -24,6 +24,7 @@
2424/* Smoothsort, an adaptive variant of Heapsort. Memory usage: O(1).
2525 Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */
2626
27#define _BSD_SOURCE
2728#include <stdint.h>
2829#include <stdlib.h>
2930#include <string.h>
......@@ -31,7 +32,7 @@
3132#include "atomic.h"
3233#define ntz(x) a_ctz_l((x))
3334
34typedef int (*cmpfun)(const void *, const void *);
35typedef int (*cmpfun)(const void *, const void *, void *);
3536
3637static inline int pntz(size_t p[2]) {
3738 int r = ntz(p[0] - 1);
......@@ -88,7 +89,7 @@ static inline void shr(size_t p[2], int n)
8889 p[1] >>= n;
8990}
9091
91static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[])
92static void sift(unsigned char *head, size_t width, cmpfun cmp, void *arg, int pshift, size_t lp[])
9293{
9394 unsigned char *rt, *lf;
9495 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
99100 rt = head - width;
100101 lf = head - width - lp[pshift - 2];
101102
102 if((*cmp)(ar[0], lf) >= 0 && (*cmp)(ar[0], rt) >= 0) {
103 if(cmp(ar[0], lf, arg) >= 0 && cmp(ar[0], rt, arg) >= 0) {
103104 break;
104105 }
105 if((*cmp)(lf, rt) >= 0) {
106 if(cmp(lf, rt, arg) >= 0) {
106107 ar[i++] = lf;
107108 head = lf;
108109 pshift -= 1;
......@@ -115,7 +116,7 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
115116 cycle(width, ar, i);
116117}
117118
118static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[])
119static void trinkle(unsigned char *head, size_t width, cmpfun cmp, void *arg, size_t pp[2], int pshift, int trusty, size_t lp[])
119120{
120121 unsigned char *stepson,
121122 *rt, *lf;
......@@ -130,13 +131,13 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
130131 ar[0] = head;
131132 while(p[0] != 1 || p[1] != 0) {
132133 stepson = head - lp[pshift];
133 if((*cmp)(stepson, ar[0]) <= 0) {
134 if(cmp(stepson, ar[0], arg) <= 0) {
134135 break;
135136 }
136137 if(!trusty && pshift > 1) {
137138 rt = head - width;
138139 lf = head - width - lp[pshift - 2];
139 if((*cmp)(rt, stepson) >= 0 || (*cmp)(lf, stepson) >= 0) {
140 if(cmp(rt, stepson, arg) >= 0 || cmp(lf, stepson, arg) >= 0) {
140141 break;
141142 }
142143 }
......@@ -150,11 +151,11 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
150151 }
151152 if(!trusty) {
152153 cycle(width, ar, i);
153 sift(head, width, cmp, pshift, lp);
154 sift(head, width, cmp, arg, pshift, lp);
154155 }
155156}
156157
157void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
158void __qsort_r(void *base, size_t nel, size_t width, cmpfun cmp, void *arg)
158159{
159160 size_t lp[12*sizeof(size_t)];
160161 size_t i, size = width * nel;
......@@ -173,16 +174,16 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
173174
174175 while(head < high) {
175176 if((p[0] & 3) == 3) {
176 sift(head, width, cmp, pshift, lp);
177 sift(head, width, cmp, arg, pshift, lp);
177178 shr(p, 2);
178179 pshift += 2;
179180 } else {
180181 if(lp[pshift - 1] >= high - head) {
181 trinkle(head, width, cmp, p, pshift, 0, lp);
182 trinkle(head, width, cmp, arg, p, pshift, 0, lp);
182183 } else {
183 sift(head, width, cmp, pshift, lp);
184 sift(head, width, cmp, arg, pshift, lp);
184185 }
185
186
186187 if(pshift == 1) {
187188 shl(p, 1);
188189 pshift = 0;
......@@ -191,12 +192,12 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
191192 pshift = 1;
192193 }
193194 }
194
195
195196 p[0] |= 1;
196197 head += width;
197198 }
198199
199 trinkle(head, width, cmp, p, pshift, 0, lp);
200 trinkle(head, width, cmp, arg, p, pshift, 0, lp);
200201
201202 while(pshift != 1 || p[0] != 1 || p[1] != 0) {
202203 if(pshift <= 1) {
......@@ -208,11 +209,13 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
208209 pshift -= 2;
209210 p[0] ^= 7;
210211 shr(p, 1);
211 trinkle(head - lp[pshift] - width, width, cmp, p, pshift + 1, 1, lp);
212 trinkle(head - lp[pshift] - width, width, cmp, arg, p, pshift + 1, 1, lp);
212213 shl(p, 1);
213214 p[0] |= 1;
214 trinkle(head - width, width, cmp, p, pshift, 1, lp);
215 trinkle(head - width, width, cmp, arg, p, pshift, 1, lp);
215216 }
216217 head -= width;
217218 }
218219}
220
221weak_alias(__qsort_r, qsort_r);
lib/libc/musl/src/stdlib/qsort_nr.c created+14
......@@ -0,0 +1,14 @@
1#define _BSD_SOURCE
2#include <stdlib.h>
3
4typedef int (*cmpfun)(const void *, const void *);
5
6static int wrapper_cmp(const void *v1, const void *v2, void *cmp)
7{
8 return ((cmpfun)cmp)(v1, v2);
9}
10
11void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
12{
13 __qsort_r(base, nel, width, wrapper_cmp, cmp);
14}
lib/libc/musl/src/stdlib/strtod.c-7
......@@ -28,10 +28,3 @@ long double strtold(const char *restrict s, char **restrict p)
2828{
2929 return strtox(s, p, 2);
3030}
31
32weak_alias(strtof, strtof_l);
33weak_alias(strtod, strtod_l);
34weak_alias(strtold, strtold_l);
35weak_alias(strtof, __strtof_l);
36weak_alias(strtod, __strtod_l);
37weak_alias(strtold, __strtold_l);
lib/libc/musl/src/thread/pthread_getname_np.c created+25
......@@ -0,0 +1,25 @@
1#define _GNU_SOURCE
2#include <fcntl.h>
3#include <unistd.h>
4#include <sys/prctl.h>
5
6#include "pthread_impl.h"
7
8int pthread_getname_np(pthread_t thread, char *name, size_t len)
9{
10 int fd, cs, status = 0;
11 char f[sizeof "/proc/self/task//comm" + 3*sizeof(int)];
12
13 if (len < 16) return ERANGE;
14
15 if (thread == pthread_self())
16 return prctl(PR_GET_NAME, (unsigned long)name, 0UL, 0UL, 0UL) ? errno : 0;
17
18 snprintf(f, sizeof f, "/proc/self/task/%d/comm", thread->tid);
19 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
20 if ((fd = open(f, O_RDONLY|O_CLOEXEC)) < 0 || (len = read(fd, name, len)) == -1) status = errno;
21 else name[len-1] = 0; /* remove trailing new line only if successful */
22 if (fd >= 0) close(fd);
23 pthread_setcancelstate(cs, 0);
24 return status;
25}
lib/libc/musl/src/thread/pthread_setname_np.c+1-1
......@@ -19,7 +19,7 @@ int pthread_setname_np(pthread_t thread, const char *name)
1919
2020 snprintf(f, sizeof f, "/proc/self/task/%d/comm", thread->tid);
2121 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
22 if ((fd = open(f, O_WRONLY)) < 0 || write(fd, name, len) < 0) status = errno;
22 if ((fd = open(f, O_WRONLY|O_CLOEXEC)) < 0 || write(fd, name, len) < 0) status = errno;
2323 if (fd >= 0) close(fd);
2424 pthread_setcancelstate(cs, 0);
2525 return status;
lib/libc/musl/src/time/__tz.c+25-15
......@@ -4,6 +4,7 @@
44#include <stdlib.h>
55#include <string.h>
66#include <sys/mman.h>
7#include <ctype.h>
78#include "libc.h"
89#include "lock.h"
910#include "fork_impl.h"
......@@ -154,10 +155,21 @@ static void do_tzset()
154155 }
155156 if (old_tz) memcpy(old_tz, s, i+1);
156157
158 int posix_form = 0;
159 if (*s != ':') {
160 p = s;
161 char dummy_name[TZNAME_MAX+1];
162 getname(dummy_name, &p);
163 if (p!=s && (*p == '+' || *p == '-' || isdigit(*p)
164 || !strcmp(dummy_name, "UTC")
165 || !strcmp(dummy_name, "GMT")))
166 posix_form = 1;
167 }
168
157169 /* Non-suid can use an absolute tzfile pathname or a relative
158170 * pathame beginning with "."; in secure mode, only the
159171 * standard path will be searched. */
160 if (*s == ':' || ((p=strchr(s, '/')) && !memchr(s, ',', p-s))) {
172 if (!posix_form) {
161173 if (*s == ':') s++;
162174 if (*s == '/' || *s == '.') {
163175 if (!libc.secure || !strcmp(s, "/etc/localtime"))
......@@ -281,22 +293,20 @@ static size_t scan_trans(long long t, int local, size_t *alt)
281293 n = (index-trans)>>scale;
282294 if (a == n-1) return -1;
283295 if (a == 0) {
284 x = zi_read32(trans + (a<<scale));
285 if (scale == 3) x = x<<32 | zi_read32(trans + (a<<scale) + 4);
296 x = zi_read32(trans);
297 if (scale == 3) x = x<<32 | zi_read32(trans + 4);
286298 else x = (int32_t)x;
287 if (local) off = (int32_t)zi_read32(types + 6 * index[a-1]);
299 /* Find the lowest non-DST type, or 0 if none. */
300 size_t j = 0;
301 for (size_t i=abbrevs-types; i; i-=6) {
302 if (!types[i-6+4]) j = i-6;
303 }
304 if (local) off = (int32_t)zi_read32(types + j);
305 /* If t is before first transition, use the above-found type
306 * and the index-zero (after transition) type as the alt. */
288307 if (t - off < (int64_t)x) {
289 for (a=0; a<(abbrevs-types)/6; a++) {
290 if (types[6*a+4] != types[4]) break;
291 }
292 if (a == (abbrevs-types)/6) a = 0;
293 if (types[6*a+4]) {
294 *alt = a;
295 return 0;
296 } else {
297 *alt = 0;
298 return a;
299 }
308 if (alt) *alt = index[0];
309 return j/6;
300310 }
301311 }
302312
lib/libc/musl/src/unistd/nice.c+8-1
......@@ -1,4 +1,5 @@
11#include <unistd.h>
2#include <errno.h>
23#include <sys/resource.h>
34#include <limits.h>
45#include "syscall.h"
......@@ -12,5 +13,11 @@ int nice(int inc)
1213 prio += getpriority(PRIO_PROCESS, 0);
1314 if (prio > NZERO-1) prio = NZERO-1;
1415 if (prio < -NZERO) prio = -NZERO;
15 return setpriority(PRIO_PROCESS, 0, prio) ? -1 : prio;
16 if (setpriority(PRIO_PROCESS, 0, prio)) {
17 if (errno == EACCES)
18 errno = EPERM;
19 return -1;
20 } else {
21 return prio;
22 }
1623}
src/musl.zig+5-1
......@@ -118,7 +118,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {
118118 try addSrcFile(arena, &source_table, src_file);
119119 }
120120
121 const time32_compat_arch_list = [_][]const u8{ "arm", "i386", "mips", "powerpc" };
121 const time32_compat_arch_list = [_][]const u8{ "arm", "i386", "mips", "powerpc", "m68k" };
122122 for (time32_compat_arch_list) |time32_compat_arch| {
123123 if (mem.eql(u8, arch_name, time32_compat_arch)) {
124124 for (compat_time32_files) |compat_time32_file| {
......@@ -766,6 +766,7 @@ const src_files = [_][]const u8{
766766 "musl/src/locale/setlocale.c",
767767 "musl/src/locale/strcoll.c",
768768 "musl/src/locale/strfmon.c",
769 "musl/src/locale/strtod_l.c",
769770 "musl/src/locale/strxfrm.c",
770771 "musl/src/locale/textdomain.c",
771772 "musl/src/locale/uselocale.c",
......@@ -1780,6 +1781,7 @@ const src_files = [_][]const u8{
17801781 "musl/src/stdlib/llabs.c",
17811782 "musl/src/stdlib/lldiv.c",
17821783 "musl/src/stdlib/qsort.c",
1784 "musl/src/stdlib/qsort_nr.c",
17831785 "musl/src/stdlib/strtod.c",
17841786 "musl/src/stdlib/strtol.c",
17851787 "musl/src/stdlib/wcstod.c",
......@@ -1990,6 +1992,7 @@ const src_files = [_][]const u8{
19901992 "musl/src/thread/pthread_getattr_np.c",
19911993 "musl/src/thread/pthread_getconcurrency.c",
19921994 "musl/src/thread/pthread_getcpuclockid.c",
1995 "musl/src/thread/pthread_getname_np.c",
19931996 "musl/src/thread/pthread_getschedparam.c",
19941997 "musl/src/thread/pthread_getspecific.c",
19951998 "musl/src/thread/pthread_join.c",
......@@ -2208,6 +2211,7 @@ const src_files = [_][]const u8{
22082211 "musl/src/unistd/writev.c",
22092212 "musl/src/unistd/x32/lseek.c",
22102213};
2214
22112215const compat_time32_files = [_][]const u8{
22122216 "musl/compat/time32/__xstat.c",
22132217 "musl/compat/time32/adjtime32.c",
tools/gen_stubs.zig+112
......@@ -550,10 +550,17 @@ fn fatal(comptime format: []const u8, args: anytype) noreturn {
550550}
551551
552552const blacklisted_symbols = [_][]const u8{
553 "__absvdi2",
554 "__absvsi2",
555 "__absvti2",
553556 "__adddf3",
554557 "__addkf3",
558 "__addodi4",
559 "__addosi4",
560 "__addoti4",
555561 "__addsf3",
556562 "__addtf3",
563 "__addxf3",
557564 "__ashldi3",
558565 "__ashlti3",
559566 "__ashrdi3",
......@@ -602,13 +609,23 @@ const blacklisted_symbols = [_][]const u8{
602609 "__atomic_store_2",
603610 "__atomic_store_4",
604611 "__atomic_store_8",
612 "__bswapdi2",
613 "__bswapsi2",
614 "__bswapti2",
615 "__ceilh",
616 "__ceilx",
605617 "__clear_cache",
606618 "__clzdi2",
607619 "__clzsi2",
608620 "__clzti2",
609621 "__cmpdf2",
622 "__cmpdi2",
610623 "__cmpsf2",
624 "__cmpsi2",
611625 "__cmptf2",
626 "__cmpti2",
627 "__cosh",
628 "__cosx",
612629 "__ctzdi2",
613630 "__ctzsi2",
614631 "__ctzti2",
......@@ -621,18 +638,30 @@ const blacklisted_symbols = [_][]const u8{
621638 "__divsi3",
622639 "__divtf3",
623640 "__divti3",
641 "__divxf3",
624642 "__dlstart",
625643 "__eqdf2",
626644 "__eqkf2",
627645 "__eqsf2",
628646 "__eqtf2",
647 "__eqxf2",
648 "__exp2h",
649 "__exp2x",
650 "__exph",
651 "__expx",
629652 "__extenddfkf2",
630653 "__extenddftf2",
654 "__extenddfxf2",
631655 "__extendhfsf2",
632656 "__extendhftf2",
657 "__extendhfxf2",
633658 "__extendsfdf2",
634659 "__extendsfkf2",
635660 "__extendsftf2",
661 "__extendsfxf2",
662 "__extendxftf2",
663 "__fabsh",
664 "__fabsx",
636665 "__ffsdi2",
637666 "__ffssi2",
638667 "__ffsti2",
......@@ -658,48 +687,81 @@ const blacklisted_symbols = [_][]const u8{
658687 "__fixunstfdi",
659688 "__fixunstfsi",
660689 "__fixunstfti",
690 "__fixunsxfdi",
691 "__fixunsxfsi",
692 "__fixunsxfti",
693 "__fixxfdi",
694 "__fixxfsi",
695 "__fixxfti",
661696 "__floatdidf",
662697 "__floatdikf",
663698 "__floatdisf",
664699 "__floatditf",
700 "__floatdixf",
665701 "__floatsidf",
666702 "__floatsikf",
667703 "__floatsisf",
668704 "__floatsitf",
705 "__floatsixf",
669706 "__floattidf",
670707 "__floattisf",
671708 "__floattitf",
709 "__floattixf",
672710 "__floatundidf",
673711 "__floatundikf",
674712 "__floatundisf",
675713 "__floatunditf",
714 "__floatundixf",
676715 "__floatunsidf",
677716 "__floatunsikf",
678717 "__floatunsisf",
679718 "__floatunsitf",
719 "__floatunsixf",
680720 "__floatuntidf",
721 "__floatuntikf",
681722 "__floatuntisf",
682723 "__floatuntitf",
724 "__floatuntixf",
725 "__floorh",
726 "__floorx",
727 "__fmah",
728 "__fmax",
729 "__fmaxh",
730 "__fmaxx",
731 "__fminh",
732 "__fminx",
733 "__fmodh",
734 "__fmodx",
683735 "__gedf2",
684736 "__gekf2",
685737 "__gesf2",
686738 "__getf2",
739 "__gexf2",
687740 "__gnu_f2h_ieee",
688741 "__gnu_h2f_ieee",
689742 "__gtdf2",
690743 "__gtkf2",
691744 "__gtsf2",
692745 "__gttf2",
746 "__gtxf2",
693747 "__ledf2",
694748 "__lekf2",
695749 "__lesf2",
696750 "__letf2",
751 "__lexf2",
752 "__log10h",
753 "__log10x",
754 "__log2h",
755 "__log2x",
756 "__logh",
757 "__logx",
697758 "__lshrdi3",
698759 "__lshrti3",
699760 "__ltdf2",
700761 "__ltkf2",
701762 "__ltsf2",
702763 "__lttf2",
764 "__ltxf2",
703765 "__moddi3",
704766 "__modsi3",
705767 "__modti3",
......@@ -708,6 +770,7 @@ const blacklisted_symbols = [_][]const u8{
708770 "__muldi3",
709771 "__mulkf3",
710772 "__mulodi4",
773 "__mulosi4",
711774 "__muloti4",
712775 "__mulsc3",
713776 "__mulsf3",
......@@ -716,30 +779,61 @@ const blacklisted_symbols = [_][]const u8{
716779 "__multf3",
717780 "__multi3",
718781 "__mulxc3",
782 "__mulxf3",
719783 "__nedf2",
720784 "__negdf2",
785 "__negdi2",
721786 "__negsf2",
787 "__negsi2",
788 "__negti2",
789 "__negvdi2",
790 "__negvsi2",
791 "__negvti2",
722792 "__nekf2",
723793 "__nesf2",
724794 "__netf2",
795 "__nexf2",
725796 "__paritydi2",
726797 "__paritysi2",
727798 "__parityti2",
728799 "__popcountdi2",
729800 "__popcountsi2",
730801 "__popcountti2",
802 "__roundh",
803 "__roundx",
804 "__sincosh",
805 "__sincosx",
806 "__sinh",
807 "__sinx",
808 "__sqrth",
809 "__sqrtx",
731810 "__subdf3",
732811 "__subkf3",
812 "__subodi4",
813 "__subosi4",
814 "__suboti4",
733815 "__subsf3",
734816 "__subtf3",
817 "__subxf3",
818 "__tanh",
819 "__tanx",
735820 "__truncdfhf2",
736821 "__truncdfsf2",
822 "__trunch",
737823 "__trunckfdf2",
738824 "__trunckfsf2",
739825 "__truncsfhf2",
740826 "__trunctfdf2",
741827 "__trunctfhf2",
742828 "__trunctfsf2",
829 "__trunctfxf2",
830 "__truncx",
831 "__truncxfdf2",
832 "__truncxfhf2",
833 "__truncxfsf2",
834 "__ucmpdi2",
835 "__ucmpsi2",
836 "__ucmpti2",
743837 "__udivdi3",
744838 "__udivmoddi4",
745839 "__udivmodsi4",
......@@ -754,5 +848,23 @@ const blacklisted_symbols = [_][]const u8{
754848 "__unordsf2",
755849 "__unordtf2",
756850 "__zig_probe_stack",
851 "ceilf128",
852 "cosf128",
853 "exp2f128",
854 "expf128",
855 "fabsf128",
856 "floorf128",
857 "fmaf128",
757858 "fmaq",
859 "fmaxf128",
860 "fminf128",
861 "fmodf128",
862 "log10f128",
863 "log2f128",
864 "logf128",
865 "roundf128",
866 "sincosf128",
867 "sinf128",
868 "sqrtf128",
869 "truncf128",
758870};