LLVM compiled to JavaScript using Emscripten

Github 星跟踪图

llvm.js

LLVM compiled to JavaScript using Emscripten

Generating the Bitcode

In a build directory under llvm root, run

emconfigure ../configure --enable-optimized --enable-targets=x86 --enable-libcpp --disable-jit --disable-threads --disable-pthreads
emmake make

You will hit errors on attempting to use tblgen and others, the build system is self-executing, but we generate bitcode that is unrunnable. When the errors happen, copy in the file from a parallel native build, and edit the Makefile of the parent dir (for llvm-tblgen, utils/, for llvm-config, tools/ and ./) that generates that file to not call it (otherwise, running make again will go back and overwrite the one you just copied in). Re-run make.

You may also hit errors on all-targets including Hexagon stuff, not sure why. To avoid that, edit the Makefiles and replace all-targets with x86 (specifically, in tools/opt, tools/llc. Note that these seem to be created/updated on the fly, as the later ones only show up after you fix earlier bugs, requiring multiple invocations of make.)

Then copy from the bin/ directory the relevant bitcode files to here, with suffix .bc

TODO: automate all preceding steps

Run doit.sh

项目概况

主要编程语言JavaScript
编程语言JavaScript
最后一次提交2015-03-02 16:22:18
创建于2012-12-23T22:16:37
推送于2015-03-03T00:22:18
提交数41
关注者数34
名称与所有者kripken/llvm.js
派生数35
星数432
问题数6
打开的问题数6
语言数3
拉请求数2
关闭的拉请求数1
已启用问题?
已启用Wiki?
已存档?
是分叉?
已锁定?
是镜像?
是私有?
To the top