Skip to content

Commit 487664e

Browse files
committed
Introduced llvm-libtool option
An idea to allow to control used `libtool` to build LLVM. Useful in attmept to build / bootsrap rust to old or wired systems.
1 parent 4e8fb74 commit 487664e

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

config.toml.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ changelog-seen = 2
157157
# Whether to build the clang compiler.
158158
#clang = false
159159

160+
# The value specified here will be passed as `-DCMAKE_LIBTOOL` to CMake.
161+
#libtool = "/path/to/libtool"
162+
160163
# =============================================================================
161164
# General build configuration options
162165
# =============================================================================

src/bootstrap/config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pub struct Config {
104104
pub llvm_link_jobs: Option<u32>,
105105
pub llvm_version_suffix: Option<String>,
106106
pub llvm_use_linker: Option<String>,
107+
pub llvm_libtool: Option<String>,
107108
pub llvm_allow_old_toolchain: bool,
108109
pub llvm_polly: bool,
109110
pub llvm_clang: bool,
@@ -473,6 +474,7 @@ derive_merge! {
473474
ldflags: Option<String>,
474475
use_libcxx: Option<bool>,
475476
use_linker: Option<String>,
477+
libtool: Option<String>,
476478
allow_old_toolchain: Option<bool>,
477479
polly: Option<bool>,
478480
clang: Option<bool>,
@@ -804,6 +806,7 @@ impl Config {
804806
config.llvm_ldflags = llvm.ldflags.clone();
805807
set(&mut config.llvm_use_libcxx, llvm.use_libcxx);
806808
config.llvm_use_linker = llvm.use_linker.clone();
809+
config.llvm_libtool = llvm.libtool.clone();
807810
config.llvm_allow_old_toolchain = llvm.allow_old_toolchain.unwrap_or(false);
808811
config.llvm_polly = llvm.polly.unwrap_or(false);
809812
config.llvm_clang = llvm.clang.unwrap_or(false);
@@ -873,6 +876,7 @@ impl Config {
873876
check_ci_llvm!(llvm.ldflags);
874877
check_ci_llvm!(llvm.use_libcxx);
875878
check_ci_llvm!(llvm.use_linker);
879+
check_ci_llvm!(llvm.libtool);
876880
check_ci_llvm!(llvm.allow_old_toolchain);
877881
check_ci_llvm!(llvm.polly);
878882
check_ci_llvm!(llvm.clang);

src/bootstrap/configure.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def v(*args):
6868

6969
v("llvm-libunwind", "rust.llvm-libunwind", "use LLVM libunwind")
7070

71+
v("llvm-libtool", "llvm.libtool", "build LLVM with specified libtool")
72+
7173
# Optimization and debugging options. These may be overridden by the release
7274
# channel, etc.
7375
o("optimize", "rust.optimize", "build optimized rust code")

src/bootstrap/native.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,10 @@ impl Step for Llvm {
351351
cfg.define("LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN", "YES");
352352
}
353353

354+
if let Some(ref libtool) = builder.config.llvm_libtool {
355+
cfg.define("CMAKE_LIBTOOL", libtool);
356+
}
357+
354358
configure_cmake(builder, target, &mut cfg, true);
355359

356360
// FIXME: we don't actually need to build all LLVM tools and all LLVM

0 commit comments

Comments
 (0)