emcc can't find wasm-ld

1,067 views
Skip to first unread message

Osman Zakir

unread,
Nov 22, 2018, 8:03:59 PM11/22/18
to emscripten-discuss
Just now I tried to run em++ after setting EMCC_WASM_BACKEND and EMCC_DEBUG variables to 1 and I got this error:

shared:ERROR: WASM_BACKEND selected but could not find lld (wasm-ld): C:/Users/Osman/emsdk/clang/e1.38.20_64bit\wasm-ld.exe


I'd ran these commands before that:

emsdk install latest --vs2017 --build=Release
emsdk activate latest --vs2017 --build=Release
emsdk_env


I'd really like some help here.  Thanks in advance.

Floh

unread,
Nov 26, 2018, 5:01:00 AM11/26/18
to emscripten-discuss
Just FYI (no solution unfortunately) I also ran into problem when trying to use the LLVM backend, my order of trial-and-error steps was roughly (from memory):

- .emscripten file needs path to binaryen (BINARYEN_ROOT), so I pulled and built binaryen from github, and added the line the .emscripten
- the next error message was a note to install emscripten (via emsdk) with the '--enable-wasm' flag, so I did that (hoping that this would produce the requested wasm-ld executable)
- ...but no luck, the wasm-ld executable isn't found (it's there no wasm-* executables at all at the path where emscripten is looking for)

This was on macOS and with the emscripten incoming branch (and binaryen master).

That's where I gave up :) I'd be interested in testing the llvm backend with my code too, so some help or pointers into the right direction would be welcome.

-Floh.

Alon Zakai

unread,
Nov 26, 2018, 12:34:21 PM11/26/18
to emscripte...@googlegroups.com
Emscripten's github CI now tests the LLVM backend, so you may be able to do something similar to what we do there,


The key part there is

./emsdk --notty install clang-upstream-NUM

where NUM needs to be found out first. We should probably simplify that - this is all pretty new and in progress.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Floh

unread,
Nov 27, 2018, 6:44:32 AM11/27/18
to emscripten-discuss
Hmm, I followed those CI scripts step by step but it failed on Mac because emsdk complains that clang-upstream-12345 doesn't exist or something (don't remember what the exact build-number was, it's the one extracted from the lkgr.json file).

I'm trying my luck now with building my own llvm toolchain via the scripts in here:


It's not high-priority for me though, just playing around and I wanted to check whether my emulators work at all and what's the performance difference is :)

To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.

Floh

unread,
Nov 27, 2018, 8:31:33 AM11/27/18
to emscripten-discuss
Heh, interesting: when building the LLVM toolchain myself, with:

cmake -G Ninja -DCMAKE_INSTALL_PREFIX=../llvm-wasm -DLLVM_TARGETS_TO_BUILD= -DLLVM_TARGET_ARCH=wasm32 -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly ../llvm

...and then trying to compile a simple .c file with:

llvm-wasm/bin/clang example/sample.c -o sample.wasm --target=wasm32 -nostdlib -Xlinker --no-entry -Xlinker --allow-undefined

I'm getting *exactly* the same error message as the OP:

clang-8: error: unable to execute command: Executable "wasm-ld" doesn't exist!
clang-8: error: lld command failed with exit code 1 (use -v to see invocation)

...because lld/wasm-lld doesn't seem included in a normal LLVM build.

I'm currently trying to figure out how to build wasm-ldd... (it seems to be different from building other optional
LLVM components, like the clang frontend).

Alon Zakai

unread,
Nov 27, 2018, 12:12:28 PM11/27/18
to emscripte...@googlegroups.com
Hmm, yeah, I'm not sure if the waterfall builders have anything other than linux yet. Using it this way is pretty new.

You can grab lld from source and build it, i do that locally, then I add a symlink to the llvm bin dir so tools find it.

To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages