Skip to content

Commit 76307ea

Browse files
committed
libunwind: use correct compiler for cross compilation
Fixes #59917 Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
1 parent 81eb152 commit 76307ea

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/bootstrap/compile.rs

+5
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ pub fn std_cargo(builder: &Builder<'_>,
185185
String::new()
186186
};
187187

188+
if let Some(ar) = builder.ar(target) {
189+
cargo.env("RUSTBUILD_AR", ar);
190+
}
191+
cargo.env("RUSTBUILD_CC", builder.cc(target));
192+
188193
if builder.no_std(target) == Some(true) {
189194
let mut features = "compiler-builtins-mem".to_string();
190195
features.push_str(&compiler_builtins_c_feature);

src/libunwind/build.rs

+6
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ mod llvm_libunwind {
5353
let target_vendor = env::var("CARGO_CFG_TARGET_VENDOR").unwrap();
5454
let cfg = &mut cc::Build::new();
5555

56+
if let Ok(build_ar) = env::var("RUSTBUILD_AR") {
57+
cfg.archiver(build_ar);
58+
}
59+
if let Ok(build_cc) = env::var("RUSTBUILD_CC") {
60+
cfg.compiler(build_cc);
61+
}
5662
cfg.cpp(true);
5763
cfg.cpp_set_stdlib(None);
5864
cfg.warnings(false);

0 commit comments

Comments
 (0)