Bug#1138702: llvm-toolchain-22: WASI preview targets can't find compiler-rt builtins in flat library layout
Max Gilmour
max.gilmour at canonical.com
Tue Jun 2 16:15:43 BST 2026
Source: llvm-toolchain-22
Version: 1:22.1.6-1
Severity: normal
Tags: patch
Dear Maintainer,
Currently, clang searches for compiler-rt builtins for WASI preview
targets (wasm32-wasip{1,2,3}) in the wrong place. Namely, instead of
searching for
/usr/lib/llvm-22/lib/clang/22/lib/wasi/libclang_rt.builtins-wasm32.a,
clang-22 instead searches for
/usr/lib/llvm-22/lib/clang/22/lib/wasip{1,2,3}/libclang_rt.builtins-wasm32.a.
This bug was originally reported in Ubuntu LP: #2152147[1] but is also
reproducible upstream. I have submitted an issue[2] and a PR[3] to
the upstream LLVM project.
I have included a patch which fixes the problem by making clang search
for wasip{1,2,3} builtins under the "wasi" folder which compiler-rt
installs them in.
Steps to reproduce in a fresh Debian sid install:
# apt update
# apt install -y clang-22 libclang-rt-22-dev-wasm32 libc++-22-dev-wasm32
lld-22
$ touch test.c
$ clang-22 --target=wasm32-wasip1 test.c
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
clang-22: error: linker command failed with exit code 1 (use -v to see
invocation)
[1]:
https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-22/+bug/2152147
[2]: https://github.com/llvm/llvm-project/issues/200500
[3]: https://github.com/llvm/llvm-project/pull/200501
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-llvm-team/attachments/20260602/495ddbe6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-wasi-path-search.patch
Type: text/x-patch
Size: 1160 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-llvm-team/attachments/20260602/495ddbe6/attachment.bin>
More information about the Pkg-llvm-team
mailing list