<div dir="ltr">Source: llvm-toolchain-22<br>Version: 1:22.1.6-1<br>Severity: normal<br>Tags: patch<br><br>Dear Maintainer,<br><br>Currently, clang searches for compiler-rt builtins for WASI preview<br>targets (wasm32-wasip{1,2,3}) in the wrong place. Namely, instead of<br>searching for<br>/usr/lib/llvm-22/lib/clang/22/lib/wasi/libclang_rt.builtins-wasm32.a,<br>clang-22 instead searches for<br>/usr/lib/llvm-22/lib/clang/22/lib/wasip{1,2,3}/libclang_rt.builtins-wasm32.a.<br><br>This bug was originally reported in Ubuntu LP: #2152147[1] but is also<br>reproducible upstream. I have submitted an issue[2] and a PR[3] to<br>the upstream LLVM project.<br><br>I have included a patch which fixes the problem by making clang search<br>for wasip{1,2,3} builtins under the "wasi" folder which compiler-rt<br>installs them in.<br><br>Steps to reproduce in a fresh Debian sid install:<br><br># apt update<br># apt install -y clang-22 libclang-rt-22-dev-wasm32 libc++-22-dev-wasm32 lld-22<br>$ touch test.c<br>$ clang-22 --target=wasm32-wasip1 test.c<br>wasm-ld-22: error: cannot open /usr/lib/llvm-22/lib/clang/22/lib/wasm32-unknown-wasip1/libclang_rt.builtins.a: No such file or directory<br>clang-22: error: linker command failed with exit code 1 (use -v to see invocation)<br><br>[1]: <a href="https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-22/+bug/2152147">https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-22/+bug/2152147</a><br>[2]: <a href="https://github.com/llvm/llvm-project/issues/200500">https://github.com/llvm/llvm-project/issues/200500</a><br>[3]: <a href="https://github.com/llvm/llvm-project/pull/200501">https://github.com/llvm/llvm-project/pull/200501</a></div>