Closed bw-86 closed 1 month ago
@llvm/issue-subscribers-backend-webassembly
Author: None (bw-86)
Those symbols should be defined in wasi-libc. The come from libc-top-half/musl/src/env/__stack_chk_fail.c
which looks like its gets included: https://github.com/WebAssembly/wasi-libc/blob/b9ef79d7dbd47c6c5bafdae760823467c2f60b70/Makefile#L215.
It looks like this got added to wasi-libc in https://github.com/WebAssembly/wasi-libc/pull/351 which in turn was released in wasi-sdk-17. Can you tell which version of wasi-sdk/wasi-libc you have installed?
Oh, I see ... my wasi-libc comes from Debian stable, which surely is older than the llvm packages:
The llvm repositories do not contain matching versions I could install instead, is that right? I do have to install a recent one from https://github.com/WebAssembly/wasi-sdk instead?
Edit: But my wasi-libc was installed as a dependency of llvm packages?
$ apt-cache rdepends --installed wasi-libc
wasi-libc
Reverse Depends:
libc++abi-18-dev-wasm32
libc++-18-dev-wasm32
clang-18
Yup it just looks like the version of wasi-libc that is included with your linux distro doesn't have -fstack-protector
support. You would need to somehow update the versions of wasi-libc you are using if you want this to work.
I don't think this is an llvm bug so this issue can probably be closed?
Okay, thank you. Unless you want to treat it as a packaging bug that llvm packages depend on a Debian package that not actually works?
If this is a packaging bug, the right place for filing packaging bugs is downstream with the Debian folks I believe.
The llvm project itself doesn't include any references to wasi-libc or how to package it as far as I know
Well, please see the apt-cache rdepends
output in my comment above, which shows exactly that: Packages from llvm depending on a Debian package that is not actually compatible. I do not believe that the Debian project would feel responsible for that.
Then again, even the wasi-libc package in Debian Sid currently has a version of 0.0~git20240411.9e8c542-3
, so I do not really see how the llvm packages should declare their dependencies better.
I will close this issue. Thanks to you, I know now how to proceed in fixing my system. Usability is not great, but I can live with it.
Oh, are you saying these are upstream llvm provides debian packages? I didn't know we did that. I that case it could conceivable be an issue for llvm to bump their wasi-libc dependency? I'm not sure who works on that.
Yes, I am using llvm packages from these repositories:
deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-18 main
deb-src http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-18 main
Should we reopen the issue then?
Hi everyone, I am on Debian Bookworm and installed the following packages from the llvm repository:
I am trying to link a small hello world binary for the wasm32-wasi target. This is my source file (wasm.cpp):
I get this error message:
It seems as if libclang_rt.builtins-wasm32.a was compiled with
-fstack-protector
, but there is no support for this with the chosen target. Adding-fno-stack-protector
to my invocation does not change anything since the symbol references do not belong to my translation unit.Am I doing something wrong here? Thanks for your help!