gpt4 book ai didi

llvm - 如何使 emcc 工作?

转载 作者:行者123 更新时间:2023-12-04 13:59:33 25 4
gpt4 key购买 nike

当我尝试使用 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

如何解决这个问题?如何回退到 pre-fast-comp?

最佳答案

我在从源代码手动构建 Emscripten 时解决了同样的错误。

Emscripten 使用自己的 LLVM 分支 - Fastcomp ;
按照说明从源代码构建它 here .然后编辑~/.emscriptenLLVM_ROOT像这样

LLVM_ROOT = os.path.expanduser('/home/yourpath/to/emscripten-fastcomp/build/Release/bin') # directory

(它甚至可以是 /home/yourpath/to/emscripten-fastcomp/build/bin )

关于llvm - 如何使 emcc 工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29701748/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com