Skip to content

Introduced llvm-libtool option #93629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ changelog-seen = 2
# Whether to build the clang compiler.
#clang = false

# The value specified here will be passed as `-DCMAKE_LIBTOOL` to CMake.
#libtool = "/path/to/libtool"

# =============================================================================
# General build configuration options
# =============================================================================
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ pub struct Config {
pub llvm_link_jobs: Option<u32>,
pub llvm_version_suffix: Option<String>,
pub llvm_use_linker: Option<String>,
pub llvm_libtool: Option<String>,
pub llvm_allow_old_toolchain: bool,
pub llvm_polly: bool,
pub llvm_clang: bool,
Expand Down Expand Up @@ -473,6 +474,7 @@ derive_merge! {
ldflags: Option<String>,
use_libcxx: Option<bool>,
use_linker: Option<String>,
libtool: Option<String>,
allow_old_toolchain: Option<bool>,
polly: Option<bool>,
clang: Option<bool>,
Expand Down Expand Up @@ -804,6 +806,7 @@ impl Config {
config.llvm_ldflags = llvm.ldflags.clone();
set(&mut config.llvm_use_libcxx, llvm.use_libcxx);
config.llvm_use_linker = llvm.use_linker.clone();
config.llvm_libtool = llvm.libtool.clone();
config.llvm_allow_old_toolchain = llvm.allow_old_toolchain.unwrap_or(false);
config.llvm_polly = llvm.polly.unwrap_or(false);
config.llvm_clang = llvm.clang.unwrap_or(false);
Expand Down Expand Up @@ -873,6 +876,7 @@ impl Config {
check_ci_llvm!(llvm.ldflags);
check_ci_llvm!(llvm.use_libcxx);
check_ci_llvm!(llvm.use_linker);
check_ci_llvm!(llvm.libtool);
check_ci_llvm!(llvm.allow_old_toolchain);
check_ci_llvm!(llvm.polly);
check_ci_llvm!(llvm.clang);
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def v(*args):

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

v("llvm-libtool", "llvm.libtool", "build LLVM with specified libtool")

# Optimization and debugging options. These may be overridden by the release
# channel, etc.
o("optimize", "rust.optimize", "build optimized rust code")
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ impl Step for Llvm {
cfg.define("LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN", "YES");
}

if let Some(ref libtool) = builder.config.llvm_libtool {
cfg.define("CMAKE_LIBTOOL", libtool);
}

configure_cmake(builder, target, &mut cfg, true);

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