This document describes how to compile LLVM distribution and use it to build Kotlin/Native.
Usually, you don't need to compile LLVM by yourself: it is downloaded
automatically when you run or build Kotlin/Native compiler.
But if you don't want to download prebuilt LLVM or want to experiment with your own distribution, you come to the right place.
Use package.py script to build LLVM distribution the same way the Kotlin team does.
To do so, we need to edit konan.properties file:
llvmHome.<HOST_NAME>
should point to the freshly built LLVM distribution.llvmVersion.<HOST_NAME>
should specify its version (for example,11.1.0
).
Now we are ready to build Kotlin/Native itself. The process is described in README.md.
— Can I override .konan
location?
— Yes, by setting $KONAN_DATA_DIR
environment variable. See HACKING.md.
— Can I use another LLVM distribution without rebuilding Kotlin/Native?
— Yes, see HACKING.md.