authorgravatar for carl@astholm.seCarl Åstholm <carl@astholm.se> 2026-01-11 21:15:10+01:00
committergravatar for carl@astholm.seCarl Åstholm <carl@astholm.se> 2026-01-12 22:33:29+01:00
log6376103b23617735044970f08c2a314c46b97c98
treeea060581a37b1151fea0bf4057da3e2085b72b33
parentf1267e02c49f5d571420d687a6337a85ab76767d

wasi-libc: De-deduplicate erroneously removed headers

05d8b565ad1a1d6c0c1e93dc47f1d828043fcafc deduplicated wasi-libc headers that are identical to upstream musl, but because some public headers match the same `#include <>` patterns as private headers, this resulted in unmodified upstream musl headers sometimes getting prioritized when compiling wasi-libc, resulting in incorrect definitions. For example, `UTIME_OMIT` is supposed to be -2 on WASI, but became 0x3ffffffe. The restored headers were sourced from <https://github.com/WebAssembly/wasi-libc/tree/c89896107d7b57aef69dcadede47409ee4f702ee> which is the same revision as the most recent wasi-libc sync 07cc32b0041e5e12f72d682fd06a995fe904d556.

6 files changed, 75 insertions(+), 0 deletions(-)

lib/libc/wasi/libc-top-half/musl/src/include/arpa/inet.h created+8
...@@ -0,0 +1,8 @@
1#ifndef ARPA_INET_H
2#define ARPA_INET_H
3
4#include "../../../include/arpa/inet.h"
5
6hidden int __inet_aton(const char *, struct in_addr *);
7
8#endif
lib/libc/wasi/libc-top-half/musl/src/include/stdlib.h created+19
...@@ -0,0 +1,19 @@
1#ifndef STDLIB_H
2#define STDLIB_H
3
4#include "../../include/stdlib.h"
5
6hidden int __putenv(char *, size_t, char *);
7hidden void __env_rm_add(char *, char *);
8hidden int __mkostemps(char *, int, int);
9hidden int __ptsname_r(int, char *, size_t);
10hidden char *__randname(char *);
11hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
12
13hidden void *__libc_malloc(size_t);
14hidden void *__libc_malloc_impl(size_t);
15hidden void *__libc_calloc(size_t, size_t);
16hidden void *__libc_realloc(void *, size_t);
17hidden void __libc_free(void *);
18
19#endif
lib/libc/wasi/libc-top-half/musl/src/include/string.h created+11
...@@ -0,0 +1,11 @@
1#ifndef STRING_H
2#define STRING_H
3
4#include "../../include/string.h"
5
6hidden void *__memrchr(const void *, int, size_t);
7hidden char *__stpcpy(char *, const char *);
8hidden char *__stpncpy(char *, const char *, size_t);
9hidden char *__strchrnul(const char *, int);
10
11#endif
lib/libc/wasi/libc-top-half/musl/src/include/sys/mman.h created+20
...@@ -0,0 +1,20 @@
1#ifndef SYS_MMAN_H
2#define SYS_MMAN_H
3
4#include "../../../include/sys/mman.h"
5
6hidden void __vm_wait(void);
7hidden void __vm_lock(void);
8hidden void __vm_unlock(void);
9
10hidden void *__mmap(void *, size_t, int, int, int, off_t);
11hidden int __munmap(void *, size_t);
12hidden void *__mremap(void *, size_t, size_t, int, ...);
13hidden int __madvise(void *, size_t, int);
14hidden int __mprotect(void *, size_t, int);
15
16hidden const unsigned char *__map_file(const char *, size_t *);
17
18hidden char *__shm_mapname(const char *, char *);
19
20#endif
lib/libc/wasi/libc-top-half/musl/src/include/sys/stat.h created+9
...@@ -0,0 +1,9 @@
1#ifndef SYS_STAT_H
2#define SYS_STAT_H
3
4#include "../../../include/sys/stat.h"
5
6hidden int __fstat(int, struct stat *);
7hidden int __fstatat(int, const char *restrict, struct stat *restrict, int);
8
9#endif
lib/libc/wasi/libc-top-half/musl/src/include/sys/time.h created+8
...@@ -0,0 +1,8 @@
1#ifndef SYS_TIME_H
2#define SYS_TIME_H
3
4#include "../../../include/sys/time.h"
5
6hidden int __futimesat(int, const char *, const struct timeval [2]);
7
8#endif