Skip to content

Commit

Permalink
Rollup merge of rust-lang#53987 - Keruspe:llvm-suffix, r=alexcrichton
Browse files Browse the repository at this point in the history
rustbuild: allow configuring llvm version suffix

Fixes rust-lang#53852 by allowing user to install different versions of rust to the same sysroot.
  • Loading branch information
kennytm committed Sep 8, 2018
2 parents 14c21a1 + ef44068 commit e2e3608
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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>
}

Expand Down Expand Up @@ -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();
}

Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e2e3608

Please sign in to comment.