Elichai Turkel via llvm-dev
2020-Feb-18 00:35 UTC
[llvm-dev] clang-9 and wasm32-unknown-unknown
Hi, I'm not sure if this is a bug or not, but would appreciate understanding what's going on and what's the right way to fix it. Running `clang --target=wasm32-unknown-unknown test.c` on a sample C file with `include <string.h>` returns: "fatal error: 'string.h' file not found". but without the target it works just fine. With some help of @jdoerfert in IRC I found this difference: `clang test.c -v` returns: ``` #include <...> search starts here: /usr/local/include /usr/local/lib/clang/9.0.1/include /usr/include End of search list. ``` But `clang --target=wasm32-unknown-unknown test.c -v` returns: ``` #include <...> search starts here: /usr/local/lib/clang/9.0.1/include End of search list. ``` Why are the other include paths missing? what's the right way to make this work? FWIW I'm pretty sure it worked to me in the past with older clang versions. Thanks. Elichai. -- PGP: 5607C93B5F86650C
Thomas Lively via llvm-dev
2020-Feb-18 18:14 UTC
[llvm-dev] clang-9 and wasm32-unknown-unknown
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. On Mon, Feb 17, 2020 at 6:15 PM Elichai Turkel via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi, > I'm not sure if this is a bug or not, but would appreciate > understanding what's going on and what's the right way to fix it. > Running `clang --target=wasm32-unknown-unknown test.c` on a sample C > file with `include <string.h>` returns: "fatal error: 'string.h' file > not found". but without the target it works just fine. > > With some help of @jdoerfert in IRC I found this difference: > `clang test.c -v` returns: > ``` > #include <...> search starts here: > /usr/local/include > /usr/local/lib/clang/9.0.1/include > /usr/include > End of search list. > ``` > But `clang --target=wasm32-unknown-unknown test.c -v` returns: > ``` > #include <...> search starts here: > /usr/local/lib/clang/9.0.1/include > End of search list. > ``` > > Why are the other include paths missing? what's the right way to make this > work? > FWIW I'm pretty sure it worked to me in the past with older clang versions. > > Thanks. > Elichai. > -- > PGP: 5607C93B5F86650C > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200218/05c716a2/attachment.html>