-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wasi-libc fails to build #368
Comments
It could be that the expectations were built with llvm 14 and using llvm 13 can produce slightly different results. It looks like we test with 10 and 14: wasi-libc/.github/workflows/main.yml Line 12 in 957c711
We do make some effort to try to account for different llvm version here: Lines 621 to 632 in 957c711
I think its safe to say is not consequential and you can probably ignore it. |
So, just tried w/ clang 14 and get the same results (also tested w/ 15 and fails in the same way).
|
"__emutls_v" indicates that LLVM's "emulated TLS" feature is getting enabled. Could the Apple-distributed clang have something like -femulated-tls enabled by default? If that's true, I wonder if we could work around the problem by adding |
Note that these are the MacPort installed versions of clang (installed in /opt), and not Apple's version. Apple's version of clang does not have wasm support compiled in. |
minor note, I did end up compiling wasi-sdk which compiles wasi-libc as part of it because the MacPort's clang is missing the file |
Does that mean it's MacPorts that's enabling -femulated-tls? If so, then we may need a way to add -fno-emulated-tls in order to disable it. |
Not sure. It looks like it's "enabled" for 10.6 and before: But that shouldn't made a difference, as I'm not on that version of MacOSX. So I don't know how/why it's being enabled. I also don't know HOW to enable emulated tls, so I don't really know where to look. |
Not really sure if you're looking for a fix here or a workaround, but wasi-libc builds fine on my M1 Mac using homebrew's llvm ( # Set up WASI Libc sysroot
LLVM_BIN="/opt/homebrew/opt/llvm/bin"
WASI_VERSION_TAG="wasi-sdk-19"
WASI_LIBC_ROOT=wasi-libc
git clone --recursive https://github.com/WebAssembly/wasi-libc $WASI_LIBC_ROOT
(
cd $WASI_LIBC_ROOT &&
git checkout $WASI_VERSION_TAG &&
make CC=$LLVM_BIN/clang AR=$LLVM_BIN/llvm-ar NM=$LLVM_BIN/llvm-nm THREAD_MODEL=posix # TODO remove THREAD_MODEL?
) |
On my Mac M1, the build fails. Even when supplying the llvm paths from brew, this is what I get: In file included from dlmalloc/src/malloc.c:1468:
Any suggestion? |
Could you share the full failing command line along with the full error output? (Perhaps just re-run |
This is the full output from make, along with system specifications: MacBook Pro 16", 2021, Apple M1 Pro 16 GB Flags have been set with:
|
Can you try running that failing command but adding
I'm guess you don't see this? Which version of stddef.h is being included in your case? What does the definition of |
When attempting to build wasm-libc, I get the following error:
I have simply cloned wasm-libc, and did a make in the directory. I am not sure why it is failing.
Environment:
macOS Ventura 13.0.1, MBP 14-inch, 2021, M1 Pro, Rosetta 2 is NOT installed, so only native arm binaries.
Let me know if you need additional environment information.
Thanks.
The text was updated successfully, but these errors were encountered: