Building with system LLVM


#1

If you are on Debian or Ubuntu, it is now possible to build rustc with system LLVM that passes make check. This is a howto.

You want LLVM 3.6 RC4 or later.

For Debian, you can install the official llvm-3.6-dev package. For Ubuntu, you can install from llvm.org APT repository. llvm.org APT repository is maintained by the same people who maintain the official Debian/Ubuntu packages.

Instead of ./configure, run:

$ ./configure --llvm-root=/usr/lib/llvm-3.6

Now if you run make, no LLVM would be downloaded or compiled. System LLVM will be used instead.


#2

Great! I guess compile time is far better?


#4

Is this not risky, given that there’s patches made to the llvm used by official builds?


#5

Currently, there are patchs made to Rust’s fork of LLVM, but all of them are optimizations and none are required. More patches may be made in the future, but I’d prefer for Rust to keep LLVM 3.6 release compatibility for a while.


#6

That’s really nice! Have you been able to rebootstrap rustc with a previously built version so that doesn’t need to be downloaded as well?