Closed alexcrichton closed 3 months ago
cc: @whitequark, does this help towards resolving the discussion you were having over in https://github.com/WebAssembly/wasi-sdk/pull/443#issuecomment-2229049509? I'm thinking of merging this but wanted to hear whether you had any additional feedback here.
have you ever tested if this change actually "avoid modifying the host compiler's sysroot with compiler-rt things"? i don't think it works w/o https://github.com/WebAssembly/wasi-libc/pull/517. i suspect we need a bit more CI coverage.
Yes I tested this doesn't modify the host compiler's sysroot. No there is no test of using the host toolchain in CI. Yes it would be great to add tests.
Yes I tested this doesn't modify the host compiler's sysroot.
did your "host compiler" already happen to have wasi compiler-rt? otherwise, i don't understand why you didn't need https://github.com/WebAssembly/wasi-libc/pull/517. for me, gmake tried to create the directory for wasi compiler-rt in the host compiler's resource dir.
On Ubuntu 24.04 I ran:
$ cmake -G Ninja -B build -S . -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_NM=llvm-nm-18
$ ninja -C build dist
and everything compiled ok. No the host compiler does not have a compiler-rt for wasm.
On Ubuntu 24.04 I ran:
$ cmake -G Ninja -B build -S . -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_NM=llvm-nm-18 $ ninja -C build dist
and everything compiled ok. No the host compiler does not have a compiler-rt for wasm.
where did clang/clang++/llvm-nm-18 come from? ubuntu package?
which compiler-rt does it link for wasi-libc without https://github.com/WebAssembly/wasi-libc/pull/517?
The clang
package owns clang/clang++ and llvm-18
owns llvm-nm
. Yes, they're from ubuntu packages.
As to what links compiler-rt is linked, I'm not sure.
This commit updates the building of the wasi-sdk sysroot to leverage the
-resource-dir
argument from Clang to avoid modifying the host compiler's sysroot with compiler-rt things. This should help improve the experience of building a standalone sysroot with whatever host Clang is on the system.Closes #444