Reputation:
I have a simple hello.c
file with the following contents:
#include <emscripten.h>
#include <stdlib.h>
#include <stdio.h>
int main() {
printf("hello wasm\n");
}
I am trying to compile this into a .html
with emscripten emcc
command using:
emcc hello.c --emrun -o hello.html
But the output that I get is:
emcc: warning: LLVM version appears incorrect (seeing "10.0", expected "11.0") [-Wversion-check]
clang-10: error: unknown argument: '-fignore-exceptions'
emcc: error: '/usr/local/opt/llvm/bin/clang -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=39 -D__EMSCRIPTEN_tiny__=18 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/include/compat -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/include -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/include/libc -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/lib/libc/musl/arch/emscripten -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/local/include -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/include/SSE -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/cache/wasm/include -DEMSCRIPTEN -fignore-exceptions hello.c -Xclang -isystem/usr/local/Cellar/emscripten/1.39.18/libexec/system/include/SDL -c -o /var/folders/74/19dk0c293ps0fmfj5vsqld1w0000gn/T/emscripten_temp_xakv8jzi/hello_0.o -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr' failed (1)
I have emscripten and dependencies installed via homebrew. These are the necessary exports in my .zshrc
are :
export LLVM="/usr/local/opt/llvm/bin"
export BINARYEN="/usr/local/opt/binaryen/bin"
How can I get this to work?
Upvotes: 1
Views: 895
Reputation: 3032
emscripten requires llvm tip of tree (11). Its not compatible with LLVM 10 or any other stable version. The simplest way to install emscripten along with a compatible version of llvm is to use emsdk to install rather than homebrew.
Upvotes: 3