# Building with system LLVM

**URL:** <https://internals.rust-lang.org/t/building-with-system-llvm/1647>\
**Category:** internals\
**Created:** [February 24, 2015, 5:36am UTC](https://internals.rust-lang.org/t/building-with-system-llvm/1647 "2015-02-24T05:36:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanxiyn](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/sanxiyn/32/8824_2.png) [@sanxiyn](https://internals.rust-lang.org/u/sanxiyn)\
**Post date:** [February 24, 2015, 5:36am UTC](https://internals.rust-lang.org/t/building-with-system-llvm/1647/1 "2015-02-24T05:36:15Z")

</div>

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](https://packages.debian.org/sid/llvm-3.6-dev) package. For Ubuntu, you can install from [llvm.org APT repository](http://llvm.org/apt/). [llvm.org](http://llvm.org) APT repository is maintained by the same people who maintain the official Debian/Ubuntu packages.

Instead of `./configure`, run:

```rust
$ ./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.

---

<div class="post-metadata">

**Author:** ![Uther](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/uther/32/6225_2.png) [@Uther](https://internals.rust-lang.org/u/Uther)\
**Post date:** [February 24, 2015, 1:27pm UTC](https://internals.rust-lang.org/t/building-with-system-llvm/1647/2 "2015-02-24T13:27:43Z")

</div>

Great! I guess compile time is far better?

---

<div class="post-metadata">

**Author:** ![tshepang](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/tshepang/32/179_2.png) [@tshepang](https://internals.rust-lang.org/u/tshepang)\
**Post date:** [February 28, 2015, 5:32am UTC](https://internals.rust-lang.org/t/building-with-system-llvm/1647/4 "2015-02-28T05:32:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sanxiyn](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/sanxiyn/32/8824_2.png) [@sanxiyn](https://internals.rust-lang.org/u/sanxiyn)\
**Post date:** [March 1, 2015, 1:31am UTC](https://internals.rust-lang.org/t/building-with-system-llvm/1647/5 "2015-03-01T01:31:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bryteise](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/bryteise/32/1072_2.png) [@bryteise](https://internals.rust-lang.org/u/bryteise)\
**Post date:** [June 3, 2015, 4:32am UTC](https://internals.rust-lang.org/t/building-with-system-llvm/1647/6 "2015-06-03T04:32:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [March 25, 2019, 8:23am UTC](https://internals.rust-lang.org/t/building-with-system-llvm/1647/7 "2019-03-25T08:23:59Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
