Skip to content

Commit dc20c8c

Browse files
bootstrap: Expose LLVM_USE_LINKER cmake option to config.toml.
1 parent 4f534ff commit dc20c8c

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

config.toml.example

+4
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@
9696
# that your host compiler ships with libc++.
9797
#use-libcxx = true
9898

99+
# The value specified here will be passed as `-DLLVM_USE_LINKER` to CMake.
100+
#use-linker = "lld"
101+
102+
99103
# =============================================================================
100104
# General build configuration options
101105
# =============================================================================

src/bootstrap/config.rs

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ pub struct Config {
7777
pub llvm_experimental_targets: String,
7878
pub llvm_link_jobs: Option<u32>,
7979
pub llvm_version_suffix: Option<String>,
80+
pub llvm_use_linker: Option<String>,
8081

8182
pub lld_enabled: bool,
8283
pub lldb_enabled: bool,
@@ -255,6 +256,7 @@ struct Llvm {
255256
version_suffix: Option<String>,
256257
clang_cl: Option<String>,
257258
use_libcxx: Option<bool>,
259+
use_linker: Option<String>,
258260
}
259261

260262
#[derive(Deserialize, Default, Clone)]
@@ -517,6 +519,7 @@ impl Config {
517519
config.llvm_version_suffix = llvm.version_suffix.clone();
518520
config.llvm_clang_cl = llvm.clang_cl.clone();
519521
set(&mut config.llvm_use_libcxx, llvm.use_libcxx);
522+
config.llvm_use_linker = llvm.use_linker.clone();
520523
}
521524

522525
if let Some(ref rust) = toml.rust {

src/bootstrap/native.rs

+4
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ impl Step for Llvm {
231231
cfg.define("LLVM_VERSION_SUFFIX", suffix);
232232
}
233233

234+
if let Some(ref linker) = builder.config.llvm_use_linker {
235+
cfg.define("LLVM_USE_LINKER", linker);
236+
}
237+
234238
if let Some(ref python) = builder.config.python {
235239
cfg.define("PYTHON_EXECUTABLE", python);
236240
}

0 commit comments

Comments
 (0)