about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-09-08 16:07:43 +0800
committerkennytm <kennytm@gmail.com>2018-09-08 18:26:41 +0800
commite2e3608a4befa37d44571664f63bf9c4dae566cf (patch)
tree1b3a94780aed39de838277cda38cf3acf36946e6
parent14c21a11b31b54c0fa237d593880c8164e0db564 (diff)
parentef440686131096e08635df418a70507bfc621a30 (diff)
downloadrust-e2e3608a4befa37d44571664f63bf9c4dae566cf.tar.gz
rust-e2e3608a4befa37d44571664f63bf9c4dae566cf.zip
Rollup merge of #53987 - Keruspe:llvm-suffix, r=alexcrichton
rustbuild: allow configuring llvm version suffix

Fixes #53852 by allowing user to install different versions of rust to the same sysroot.
-rw-r--r--config.toml.example4
-rw-r--r--src/bootstrap/config.rs3
-rw-r--r--src/bootstrap/native.rs4
3 files changed, 11 insertions, 0 deletions
diff --git a/config.toml.example b/config.toml.example
index 35f69cd05b6..087dc418e2d 100644
--- a/config.toml.example
+++ b/config.toml.example
@@ -82,6 +82,10 @@
 # passed to prefer linking to shared libraries.
 #link-shared = false
 
+# When building llvm, this configures what is being appended to the version.
+# If absent, we let the version as-is.
+#version-suffix = "-rust"
+
 # On MSVC you can compile LLVM with clang-cl, but the test suite doesn't pass
 # with clang-cl, so this is special in that it only compiles LLVM with clang-cl
 #clang-cl = '/path/to/clang-cl.exe'
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index bf4d39c4947..70b21a1567b 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -86,6 +86,7 @@ pub struct Config {
     pub llvm_targets: Option<String>,
     pub llvm_experimental_targets: String,
     pub llvm_link_jobs: Option<u32>,
+    pub llvm_version_suffix: Option<String>,
 
     pub lld_enabled: bool,
     pub lldb_enabled: bool,
@@ -256,6 +257,7 @@ struct Llvm {
     experimental_targets: Option<String>,
     link_jobs: Option<u32>,
     link_shared: Option<bool>,
+    version_suffix: Option<String>,
     clang_cl: Option<String>
 }
 
@@ -516,6 +518,7 @@ impl Config {
             config.llvm_experimental_targets = llvm.experimental_targets.clone()
                 .unwrap_or("WebAssembly;RISCV".to_string());
             config.llvm_link_jobs = llvm.link_jobs;
+            config.llvm_version_suffix = llvm.version_suffix.clone();
             config.llvm_clang_cl = llvm.clang_cl.clone();
         }
 
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
index caf38d766f5..828a7d14c04 100644
--- a/src/bootstrap/native.rs
+++ b/src/bootstrap/native.rs
@@ -239,6 +239,10 @@ impl Step for Llvm {
             cfg.define("LLVM_NATIVE_BUILD", builder.llvm_out(builder.config.build).join("build"));
         }
 
+        if let Some(ref suffix) = builder.config.llvm_version_suffix {
+            cfg.define("LLVM_VERSION_SUFFIX", suffix);
+        }
+
         if let Some(ref python) = builder.config.python {
             cfg.define("PYTHON_EXECUTABLE", python);
         }