问题
What version of LLVM does the latest emscripten use? I googled for this quite a while but could not find any info. The background is that I've got some C++ code that requires clang-5.0 - what are the chances that it would compile with emscripten? Or at least code that needs clang-4.0?
回答1:
The latest version of emscripten uses clang version 4:
$ emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.37.21
clang version 4.0.0 (https://github.com/kripken/emscripten-fastcomp-clang.git 974b55fd84ca447c4297fc3b00cefb6394571d18) (https://github.com/kripken/emscripten-fastcomp.git 087c6b7b18b7b769d4ad8f2ac3e0dd0ae6b924c2) (emscripten 1.37.21 : 1.37.21)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
However, you can build WebAssembly without emscripten, by using the clang, llc, s2wasm and wasm tools separately as documented in this gist.
Another good alternative is the wasm-toolchain project:
https://github.com/tpimh/wasm-toolchain
With this installed, I have clang version 6:
$ ./clang --version
clang version 6.0.0 (http://llvm.org/git/clang.git 9411957410813aeefc1bb299abcb856ce1ef8aae) (http://llvm.org/git/llvm.git 68b21d6108df63d65d6735e9686d53cca844e37a)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
来源:https://stackoverflow.com/questions/46458087/what-version-of-llvm-does-the-latest-emscripten-use