Support for LLILC on Linux and OS X is still in its early stages. While the instructions below should get you up and running, the workflow is a bit rough around the edges and there are certainly holes with respect to what is supported. The most obvious missing piece is that without following the steps on the CoreCLR wiki to obtain a version of mscorlib that is functional on these platforms, there is no way to run or test the output of the LLILC build.
The prerequisites for building LLILC on Linux and OS X are the same as the prerequisites for building LLVM with CMake unioned with the prerequisites for building CoreCLR.
In addition, LLILC requires very recent builds of the Microsoft fork of LLVM and CoreCLR. Instructions for fetching and building both can be found below.
-
Clone and build CoreCLR:
$ git clone https://github.com/dotnet/coreclr $ cd coreclr $ ./build.sh $ cd ..
After it completes, the build will indicate where the CoreCLR binaries are available. Make a note of this location (typically binaries/Product/.x64.debug).
-
Clone the Microsoft fork of LLVM:
$ git clone -b MS https://github.com/microsoft/llvm
-
Clone LLILC:
$ cd llvm/tools $ git clone https://github.com/dotnet/llilc $ cd ..
-
Configure LLVM and LLILC:
$ mkdir build $ cd build $ cmake -DWITH_CORECLR=../../coreclr/path/to/CoreCLR/binaries -DLLVM_OPTIMIZED_TABLEGEN=ON ..
Ie, ../../coreclr/bin/Product/OSX.x64.Debug
-
Build LLVM and LLILC:
$ make
If all goes well, the build will complete without errors.