Skip to content

Commit 33e8b51

Browse files
committed
Omit musl's stdarg.h and stddef.h from the sysroot.
We already use the compiler's versions of these; this just moves from having libc #include_next them to having libc just omit them entirely, which is simpler. This removes the special code to define musl's include guard, however I originally added that when I was still working out how WASI's stddef.h would interact with other code. I believe it's no longer important.
1 parent 1f40984 commit 33e8b51

5 files changed

Lines changed: 5 additions & 20 deletions

File tree

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,11 @@ override MUSL_OMIT_HEADERS += \
243243
"bits/alltypes.h.in" \
244244
"alltypes.h.in"
245245

246+
# Use the compiler's version of these headers.
247+
override MUSL_OMIT_HEADERS += \
248+
"stdarg.h" \
249+
"stddef.h"
250+
246251
# Use the WASI errno definitions.
247252
override MUSL_OMIT_HEADERS += \
248253
"bits/errno.h"

expected/wasm32-wasi/include-all.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,8 @@
120120
#include <semaphore.h>
121121
#include <signal.h>
122122
#include <stdalign.h>
123-
#include <stdarg.h>
124123
#include <stdbool.h>
125124
#include <stdc-predef.h>
126-
#include <stddef.h>
127125
#include <stdint.h>
128126
#include <stdio.h>
129127
#include <stdio_ext.h>

expected/wasm32-wasi/predefined-macros.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2370,7 +2370,6 @@
23702370
#define _STDALIGN_H
23712371
#define _STDBOOL_H
23722372
#define _STDC_PREDEF_H
2373-
#define _STDDEF_H
23742373
#define _STDINT_H
23752374
#define _STDIO_EXT_H
23762375
#define _STDIO_H

libc-top-half/musl/include/stdarg.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#ifdef __wasilibc_unmodified_upstream /* Use the compiler's stdarg.h */
21
#ifndef _STDARG_H
32
#define _STDARG_H
43

@@ -20,7 +19,3 @@ extern "C" {
2019
#endif
2120

2221
#endif
23-
#else
24-
/* Just use the compiler's stdarg.h. */
25-
#include_next <stdarg.h>
26-
#endif

libc-top-half/musl/include/stddef.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#ifdef __wasilibc_unmodified_upstream /* Use the compiler's stddef.h */
21
#ifndef _STDDEF_H
32
#define _STDDEF_H
43

@@ -24,14 +23,3 @@
2423
#endif
2524

2625
#endif
27-
#else
28-
29-
/* Just use the compiler's stddef.h. */
30-
#include_next <stddef.h>
31-
32-
/* Define musl's include guard, in case any code depends on that. */
33-
#if defined(__STDDEF_H) && !defined(_STDDEF_H)
34-
#define _STDDEF_H
35-
#endif
36-
37-
#endif

0 commit comments

Comments
 (0)