LLVM WebAssembly target

Hello.

Excuse me.

Why CMakeLists.txt from llvm-3.9.1.src does not contain WebAssembly target?

So, it is like

set(LLVM_ALL_TARGETS
AArch64
AMDGPU
ARM
BPF
Hexagon
Mips
MSP430
NVPTX
PowerPC
Sparc
SystemZ
X86
XCore
)

but not like

set(LLVM_ALL_TARGETS
AArch64
AMDGPU
ARM
BPF
Hexagon
Mips
MSP430
NVPTX
PowerPC
Sparc
SystemZ
Webassembly
X86
XCore
)

?

Is WebAssembly work state now in LLVM or not?

Thank you.

Hi,

WebAssembly is an experimental target (http://llvm.org/docs/DeveloperPolicy.html#new-targets ), and thus isn’t build by default, you need to explicitly ask for it to be built.

Just to add to this, the way you ask for it is by adding -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly to your CMake invocation. Also the primary reason that we have not yet proposed coming out of experimental yet is that the WebAssembly spec itself is not yet finalized (although it’s getting close: http://webassembly.org/roadmap/). So we didn’t want to be in a situation where e.g. stable LLVM or Linux distributions were shipping a wasm backend that didn’t match any stable format shipped in a wasm engine implementation. So if you want to experiment with wasm you should really use tip-of-tree. The other caveat is that we don’t have any stable ABIs or conventions yet so all of that is subject to change.

Having said all that, we would love to have you experiment, so do let us know if we can help you out.