emscripten issue with ubuntu version “aborting from js compiler due to exception: unknown vector type <4 x i8> | undefined”

匆匆过客 提交于 2019-12-12 02:09:25

问题


I cannot compile anything with the current version of emscripten from the ubuntu repos

Here is the error

http://pastebin.com/j5Z0ztTs

I suspect it might be because emscripten is outdated in the repos, but why is there no bug reports??

Could anyone help? I cannot find any updated information.

Thanks in advance.


回答1:


The reason is because you are using the /usr/bin/clang++ that comes with your Linux distribution.

This version does not support Javascript backend. In order to use emscripten, you have to compile fastcomp (an LLVM clang compiler with Javascript backend added)

If you have not built fastcomp yet, Emscripten won't work.

Check out this page for installation instructions:

http://kripken.github.io/emscripten-site/docs/building_from_source/LLVM-Backend.html


If you have already built fastcomp, then the problem is in your emscriptenrc file, and moreover your PATH.

This is how I worked around the issue:

I created a file called emscriptenrc.sh that did this:

export PATH=/home/mike/emscripten/fastcomp/build/master/bin:/home/mike/emscripten/fastcomp/build/master/include:/home/mike/emscripten/fastcomp/build/master/lib:$PATH

then after I created that file

I rebuilt the ~/.emscripten configuration file by calling

./emcc -v from the emscripten build directory -- this seemed to get the right version of clang registered...

now you can go ahead and compile with emcc

I would suggest reading http://kripken.github.io/emscripten-site/docs/building_from_source/LLVM-Backend.html as well as the rest of the documentation prior to trying to use emscripten.



来源:https://stackoverflow.com/questions/26445496/emscripten-issue-with-ubuntu-version-aborting-from-js-compiler-due-to-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!