Skip to content
Vladislav Ivanishin edited this page Mar 30, 2016 · 28 revisions

LLVM

First you need to check out and build our version of LLVM:

git clone https://github.com/ispras/llvm-for-v8.git
mkdir build-llvm
cd build-llvm
export CC=$LLV8_ROOT/v8/third_party/llvm-build/Release+Asserts/bin/clang
export CXX=$LLV8_ROOT/v8/third_party/llvm-build/Release+Asserts/bin/clang++
../llvm-for-v8/configure --enable-assertions --enable-optimized --disable-zlib
make -j9
sudo make install # Note: this installs the built version of llvm system-wide

You can in theory pass --prefix to configure or not install llvm at all and use it from the build directory, because all you need to build llv8 is the llvm-configure of this freshly built llvm in your $PATH. But this makes the subsequent compilation of llv8 a bit more involved (the C++ compiler spews warnings-errors as it compiles LLVM headers).

V8 (LLV8)

The easiest way is to follow the process of building regular V8, adding the LLV8 branch as a remote.

Install depot_tools:

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"

Fetch all the code:

fetch v8
cd v8
git remote add llv8 https://github.com/ispras/llv8.git
git pull llv8 llv8
git checkout llv8
gclient sync

Finally, run make (substitute "release" for "debug" if you'd like to test performance):

make x64.debug -j9 i18nsupport=off gdbjit=off

Caveats

By default v8's make uses the clang compiler from v8/third_party/llvm-build/Release+Asserts/bin. If you use different compilers for building llvm and v8, make sure they conform to the same ABI. Newer versions of g++ use C++11 ABI by default, the behavior is controlled with the _GLIBCXX_USE_CXX11_ABI flag.

Clone this wiki locally