<div dir="ltr">My understanding is that wasm32-unknown-unknown does not make assumptions about that layout of the host system and needs to be explicitly configured with a sysroot (with -isysroot). Both wasi-sdk and Emscripten ship with their own sysroots and pass this flag for you.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 17, 2020 at 6:15 PM Elichai Turkel via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
I'm not sure if this is a bug or not, but would appreciate<br>
understanding what's going on and what's the right way to fix it.<br>
Running `clang --target=wasm32-unknown-unknown test.c` on a sample C<br>
file with `include <string.h>` returns: "fatal error: 'string.h' file<br>
not found". but without the target it works just fine.<br>
<br>
With some help of @jdoerfert in IRC I found this difference:<br>
`clang test.c -v` returns:<br>
```<br>
#include <...> search starts here:<br>
 /usr/local/include<br>
 /usr/local/lib/clang/9.0.1/include<br>
 /usr/include<br>
End of search list.<br>
```<br>
But `clang --target=wasm32-unknown-unknown test.c -v` returns:<br>
```<br>
#include <...> search starts here:<br>
 /usr/local/lib/clang/9.0.1/include<br>
End of search list.<br>
```<br>
<br>
Why are the other include paths missing? what's the right way to make this work?<br>
FWIW I'm pretty sure it worked to me in the past with older clang versions.<br>
<br>
Thanks.<br>
Elichai.<br>
-- <br>
PGP: 5607C93B5F86650C<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>