diff options
| author | Camelid <camelidcamel@gmail.com> | 2021-02-20 16:07:36 -0800 |
|---|---|---|
| committer | Joshua Nelson <joshua@yottadb.com> | 2021-02-26 15:38:01 -0500 |
| commit | 33d4d6082456220bc15da79eec6aa4e511625bda (patch) | |
| tree | 65098f8498c1d7da150add1ac47f5e3dacaf4842 /src/doc/rustc-dev-guide | |
| parent | 9f196f1337f01d48ee00996c0c88a838361c4c18 (diff) | |
| download | rust-33d4d6082456220bc15da79eec6aa4e511625bda.tar.gz rust-33d4d6082456220bc15da79eec6aa4e511625bda.zip | |
Restore instructions for using system LLVM
They were removed in #1030, but are still useful.
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/building/new-target.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/src/building/new-target.md b/src/doc/rustc-dev-guide/src/building/new-target.md index 305aa4de702..7701fdbac0a 100644 --- a/src/doc/rustc-dev-guide/src/building/new-target.md +++ b/src/doc/rustc-dev-guide/src/building/new-target.md @@ -24,6 +24,34 @@ git add llvm_target git commit -m 'Use my custom LLVM' ``` +### Using pre-built LLVM + +If you have a local LLVM checkout that is already built, you may be +able to configure Rust to treat your build as the [system LLVM][sysllvm] +to avoid redundant builds. + +You can tell Rust to use a pre-built version of LLVM using the `target` section +of `config.toml`: + +```toml +[target.x86_64-unknown-linux-gnu] +llvm-config = "/path/to/llvm/llvm-7.0.1/bin/llvm-config" +``` + +If you are attempting to use a system LLVM, we have observed the following paths +before, though they may be different from your system: + +- `/usr/bin/llvm-config-8` +- `/usr/lib/llvm-8/bin/llvm-config` + +Note that you need to have the LLVM `FileCheck` tool installed, which is used +for codegen tests. This tool is normally built with LLVM, but if you use your +own preinstalled LLVM, you will need to provide `FileCheck` in some other way. +On Debian-based systems, you can install the `llvm-N-tools` package (where `N` +is the LLVM version number, e.g. `llvm-8-tools`). Alternately, you can specify +the path to `FileCheck` with the `llvm-filecheck` config item in `config.toml` +or you can disable codegen test with the `codegen-tests` item in `config.toml`. + ## Creating a target specification You should start with a target JSON file. You can see the specification |
