Home > Back-end >  clang-14: error: unsupported option '--no-entry'
clang-14: error: unsupported option '--no-entry'

Time:08-29

When running the command:

clang --target=wasm32 -nostdlib -Wl, --no-entry -Wl, --export-all howold.c -o howold.wasm

I get the following errors:

clang-14: error: unsupported option '--no-entry'
clang-14: error: unsupported option '--export-all'

I installed LLVM using brew install llvm and linked it properly with brew link llvm, then ran source .zshrc.

Does macOS not support these directives or am I missing an install or command somewhere? I am new to LLVM and clang on macOS so this may be an installation problem but not entirely sure.

CodePudding user response:

To pass arguments to the linker, there shouldn't be a space after -Wl,. With the extra space, you're trying to give the --no-entry option to clang itself, which isn't valid.

Try this:

clang --target=wasm32 -nostdlib -Wl,--no-entry -Wl,--export-all howold.c -o howold.wasm
  • Related