Skip to content

Commit

Permalink
libunwind: use correct compiler for cross compilation
Browse files Browse the repository at this point in the history
Fixes #59917

Signed-off-by: Marc-Antoine Perennou <[email protected]>
  • Loading branch information
Keruspe committed Jun 6, 2019
1 parent 81eb152 commit 76307ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
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

0 comments on commit 76307ea

Please sign in to comment.