-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Instruction requires: bulk-memory #23456
Comments
Emscripten is built to run on LLVM tip-of-tree (which is currently v20) and has bulk memory enabled by default. It looks like you are trying to use emscripten with LLVM 19.1.7 which is not going to work. For more discussion on out support (or lack of it) for LLVM stable see #11362. I've recently started work on making that work: #23311. But for now I'm afraid this is WAI. |
I see from the output of your command you are even getting the corresponding warning message:
|
@sbc100 Yeah. I read that. Hmm but llvm 20 is still in progress I guess. |
You can also install via emsdk which gives you prebuilt llvm and binaryen. Building you own llvm can be quite time consuming, and its not always easy to build the exact version that emscripten needs. If you use emsdk you always get a tests set of binaries. |
emscripten always uses the "in progress" or "tip-of-tree" version of llvm, and never (yet) the stable verison. |
UPDATE: I updated my clang to 20-init, but still same error. |
UPDATE: SDK works well. |
I just updated Emscripten from 3.1.57 to 4.0.1, and I got an error about bulk-memory
instruction while compiling C and C++ to WASM.
I used clang 19.1.7 and failed
I updated my clang 20-init and also failed
I attach the log of emcc, and same error with em++:
Version of emscripten/emsdk:
~$emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.1-git (89ce854)
clang version 19.1.7 (/home/runner/work/llvm-project/llvm-project/clang cd708029e0b2869e80abe31ddb175f7c35361f90)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/x/WASM/packages/clang_llvm_19.1.7/bin
Failing command line in full:
~$emcc ./demo/hello_world_c.c -o ./demo/build/hello_world_c_emscripten.wasm -sWASM=1
emcc: warning: LLVM version for clang executable "/home/x/WASM/packages/clang_llvm_19.1.7/bin/clang" appears incorrect (seeing "19.1", expected "20") [-Wversion-check]
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libc-debug.a... (this will be cached in "/home/x/WASM/packages/emscripten_4.0.1/emscripten/cache/sysroot/lib/wasm32-emscripten/libc-debug.a" for subsequent builds)
../../../system/lib/libc/emscripten_memcpy_bulkmem.S:19:5: error: instruction requires: bulk-memory
memory.copy 0, 0
^
../../../system/lib/libc/emscripten_memcpy_bulkmem.S:22:3: error: 3 superfluous return values
end_function
^
../../../system/lib/libc/emscripten_memset_bulkmem.S:19:4: error: instruction requires: bulk-memory
memory.fill 0
^
../../../system/lib/libc/emscripten_memset_bulkmem.S:22:3: error: 3 superfluous return values
end_function
^
emcc: error: subprocess 17/17 failed (returned 1)! (cmdline: /home/x/WASM/packages/emscripten_4.0.1/emscripten/emcc -c -Wall -fno-unroll-loops -std=c99 -D_XOPEN_SOURCE=700 -Wno-unused-result -fno-inline-functions -fno-builtin -Wno-ignored-attributes -Wno-macro-redefined -Wno-shift-op-parentheses -Wno-string-plus-int -Wno-missing-braces -Wno-logical-op-parentheses -Wno-bitwise-op-parentheses -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-label -Wno-pointer-sign -g -sSTRICT -Werror -I/home/x/WASM/packages/emscripten_4.0.1/emscripten/system/lib/libc/musl/src/internal -I/home/x/WASM/packages/emscripten_4.0.1/emscripten/system/lib/libc/musl/src/include -I/home/x/WASM/packages/emscripten_4.0.1/emscripten/system/lib/libc/musl/include -I/home/x/WASM/packages/emscripten_4.0.1/emscripten/system/lib/libc -I/home/x/WASM/packages/emscripten_4.0.1/emscripten/system/lib/pthread -ffile-prefix-map=/home/x/WASM/packages/emscripten_4.0.1/emscripten=/emsdk/emscripten -ffile-prefix-map=../../..=/emsdk/emscripten -fdebug-compilation-dir=/emsdk/emscripten -O2 ../../../system/lib/libc/emscripten_memcpy.c ../../../system/lib/libc/emscripten_memmove.c ../../../system/lib/libc/emscripten_memset.c ../../../system/lib/libc/emscripten_memcpy_bulkmem.S ../../../system/lib/libc/emscripten_memset_bulkmem.S ../../../system/lib/libc/emscripten_scan_stack.c)
Full link command and output with
-v
appended:log_emcc_with_v_option.txt
The text was updated successfully, but these errors were encountered: