emsdk error: LLVM IR bitcode is generated, bt not js/html
emsdk error: LLVM IR bitcode is generated, bt not js/html
我正在尝试使用 emscripten 为 webassembly 编译一个现有的 C++ 项目。使用 em++ 我能够生成 LLVM IR 位码文件,但不能生成 js/html。 IE。当我尝试时,例如 emcc project.bc -o project.html
我收到以下错误:
LLVM ERROR: asm() with non-empty content not supported, use EM_ASM() (see emscripten.h)
shared:ERROR
网上搜索没有帮助。我如何追溯这个错误?有什么建议吗
您的代码似乎包含 asm-declaration。这允许直接将汇编代码嵌入到您的 C++ 代码中。
由于 WebAssembly 的工作方式不同,此汇编代码无用,这就是编译器在发现 non-empty asm()
语句时抱怨的原因(如果它们为空,编译器将忽略它们)。
您可以尝试将此代码放入条件宏中,看看生成的 WebAssembly 代码是否仍然有效。
#ifndef __EMSCRIPTEN__
asm( stuff here )
#endif
我正在尝试使用 emscripten 为 webassembly 编译一个现有的 C++ 项目。使用 em++ 我能够生成 LLVM IR 位码文件,但不能生成 js/html。 IE。当我尝试时,例如 emcc project.bc -o project.html
我收到以下错误:
LLVM ERROR: asm() with non-empty content not supported, use EM_ASM() (see emscripten.h)
shared:ERROR
网上搜索没有帮助。我如何追溯这个错误?有什么建议吗
您的代码似乎包含 asm-declaration。这允许直接将汇编代码嵌入到您的 C++ 代码中。
由于 WebAssembly 的工作方式不同,此汇编代码无用,这就是编译器在发现 non-empty asm()
语句时抱怨的原因(如果它们为空,编译器将忽略它们)。
您可以尝试将此代码放入条件宏中,看看生成的 WebAssembly 代码是否仍然有效。
#ifndef __EMSCRIPTEN__
asm( stuff here )
#endif