Skip to content
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

libunwind: use correct compiler for cross compilation #61544

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
5 changes: 5 additions & 0 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ pub fn std_cargo(builder: &Builder<'_>,
String::new()
};

if let Some(ar) = builder.ar(target) {
cargo.env("RUSTBUILD_AR", ar);
}
cargo.env("RUSTBUILD_CC", builder.cc(target));

if builder.no_std(target) == Some(true) {
let mut features = "compiler-builtins-mem".to_string();
features.push_str(&compiler_builtins_c_feature);
Expand Down
6 changes: 6 additions & 0 deletions src/libunwind/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ mod llvm_libunwind {
let target_vendor = env::var("CARGO_CFG_TARGET_VENDOR").unwrap();
let cfg = &mut cc::Build::new();

if let Ok(build_ar) = env::var("RUSTBUILD_AR") {
cfg.archiver(build_ar);
}
if let Ok(build_cc) = env::var("RUSTBUILD_CC") {
cfg.compiler(build_cc);
}
cfg.cpp(true);
cfg.cpp_set_stdlib(None);
cfg.warnings(false);
Expand Down