当我尝试使用emcc将C代码编译为Javascript时,我收到以下错误:
emcc tests/hello_world.c
CRITICAL root: fastcomp in use, but LLVM has not been built with the JavaScript backend as a target, llc reports:
===========================================================================
LLVM (http://llvm.org/):
LLVM version 3.5.1
Optimized build with assertions.
Built Feb 22 2015 (00:08:56).
Default target: x86_64-apple-darwin13.4.0
Host CPU: corei7-avx
Registered Targets:
x86 - 32-bit X86: Pentium-Pro and above
x86-64 - 64-bit X86: EM64T and AMD64
===========================================================================
CRITICAL root: you can fall back to the older (pre-fastcomp) compiler core, although that is not recommended, see https://github.com/kripken/emscripten/wiki/LLVM-Backend
INFO root: (Emscripten: Running sanity checks)
CRITICAL root: failing sanity checks due to previous fastcomp failure
Run Code Online (Sandbox Code Playgroud)
怎么解决这个?如何回退到pre-fast-comp?
当我从源手动构建Emscripten时,我解决了同样的错误.
Emscripten使用自己的LLVM分支 - Fastcomp ; 按照此处的说明从源代码构建它.然后编辑~/.emscripten有LLVM_ROOT这样的
LLVM_ROOT = os.path.expanduser('/home/yourpath/to/emscripten-fastcomp/build/Release/bin') # directory
Run Code Online (Sandbox Code Playgroud)
(它甚至可以/home/yourpath/to/emscripten-fastcomp/build/bin)
这看起来像是 Emscripten 安装配置错误。你是用SDK安装的吗?看起来像是emcc发现了错误clang(可能是您已经安装的版本,在您期望PATH的之前出现emcc),而不是clang通常随 Emscripten 附带的版本。
您使用的是哪个操作系统?
在 Linux 上检查which clang并echo $PATH找出clang存在哪个。
尝试调用emccwith:EMMAKEN_COMPILER=/path/to/emscripten-fastcomp/bin emcc test/hello.cc这应该覆盖上面的错误路径。
还可以尝试emcc使用-v选项进行调用以获取详细输出。
如果这些都不起作用,请发布这些命令的输出以及有关如何重现问题的信息。
| 归档时间: |
|
| 查看次数: |
3191 次 |
| 最近记录: |