Skip to content

Commit a707a61

Browse files
committed
rustbuild: Fix compiler-rt build on gnueabihf
Needs a different target to get built and also we apparently need to appease the C++ compiler somehow.
1 parent 52ec682 commit a707a61

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/bootstrap/build/native.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ pub fn compiler_rt(build: &Build, target: &str) {
115115
let mode = if build.config.rust_optimize {"Release"} else {"Debug"};
116116
let (dir, build_target, libname) = if target.contains("linux") {
117117
let os = if target.contains("android") {"-android"} else {""};
118+
let arch = if arch.starts_with("arm") && target.contains("eabihf") {
119+
"armhf"
120+
} else {
121+
arch
122+
};
118123
let target = format!("clang_rt.builtins-{}{}", arch, os);
119124
("linux".to_string(), target.clone(), target)
120125
} else if target.contains("darwin") {
@@ -151,7 +156,10 @@ pub fn compiler_rt(build: &Build, target: &str) {
151156
.define("COMPILER_RT_DEFAULT_TARGET_TRIPLE", target)
152157
.define("COMPILER_RT_BUILD_SANITIZERS", "OFF")
153158
.define("COMPILER_RT_BUILD_EMUTLS", "OFF")
159+
// inform about c/c++ compilers, the c++ compiler isn't actually used but
160+
// it's needed to get the initial configure to work on all platforms.
154161
.define("CMAKE_C_COMPILER", build.cc(target))
162+
.define("CMAKE_CXX_COMPILER", build.cc(target))
155163
.build_target(&build_target);
156164
cfg.build();
157165
}

0 commit comments

Comments
 (0)