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).