```
/tmp/tmp.C3EY2NIDbS $ cat x.c 
#include <unwind.h>
#include <stddef.h>
int main() {}
/tmp/tmp.C3EY2NIDbS $ ./musl/prefix/bin/musl-clang -E x.c | grep stddef
clang: warning: argument unused during compilation: '-static-libgcc'
clang: warning: argument unused during compilation: '-L-user-start'
clang: warning: argument unused during compilation: '-L/tmp/tmp.C3EY2NIDbS/musl/prefix/lib'
clang: warning: argument unused during compilation: '-L-user-end'
# 1 "/tmp/tmp.C3EY2NIDbS/musl/prefix/include/stddef.h" 1 3
# 17 "/tmp/tmp.C3EY2NIDbS/musl/prefix/include/stddef.h" 3
# 18 "/tmp/tmp.C3EY2NIDbS/musl/prefix/include/stddef.h" 2 3
```

On 6 July 2016 at 18:44, Rich Felker <dalias@libc.org> wrote:
On Wed, Jul 06, 2016 at 06:22:05PM +0100, Aidan Hobson Sayers wrote:
> #include <unwind.h>
> int main() {}
>
> The above currently compiles with musl-gcc but not with musl-clang. This
> patch fixes the latter.
>
> ---
>  tools/musl-clang.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/musl-clang.in b/tools/musl-clang.in
> index 623de6f..0018932 100644
> --- a/tools/musl-clang.in
> +++ b/tools/musl-clang.in
> @@ -24,7 +24,7 @@ exec $cc \
>      -B"$thisdir" \
>      -fuse-ld=musl-clang \
>      -static-libgcc \
> -    -nostdinc \
> +    -nostdlibinc \
>      --sysroot "$libc" \
>      -isystem "$libc_inc" \
>      -L-user-start \
> --

What happens when you #include <stddef.h> after making this change? Do
you get the compiler-provided one or musl's? You should be able to
tell by running musl-clang -E foo.c

Rich



--
Aidan

Co-authored a book on Docker - get 39% off with the code 39miell