Skip to content

Commit cc90d0e

Browse files
committed
add mips/mips64 compiler-rt fallbacks so that libgcc is not required
This adds compiler-rt fallbacks for mips and mips64 arches. Solves linking issues like rust-lang/rust#57820. Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>
1 parent 3e6327a commit cc90d0e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

build.rs

+20
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,26 @@ mod c {
396396
}
397397
}
398398

399+
if target_arch == "mips" {
400+
cfg.flag("-msoft-float");
401+
sources.extend(&[("__bswapsi2", "bswapsi2.c")]);
402+
}
403+
404+
if target_arch == "mips64" {
405+
sources.extend(&[
406+
("__extenddftf2", "extenddftf2.c"),
407+
("__netf2", "comparetf2.c"),
408+
("__addtf3", "addtf3.c"),
409+
("__multf3", "multf3.c"),
410+
("__subtf3", "subtf3.c"),
411+
("__fixtfsi", "fixtfsi.c"),
412+
("__floatsitf", "floatsitf.c"),
413+
("__fixunstfsi", "fixunstfsi.c"),
414+
("__floatunsitf", "floatunsitf.c"),
415+
("__fe_getround", "fp_mode.c"),
416+
]);
417+
}
418+
399419
// Remove the assembly implementations that won't compile for the target
400420
if llvm_target[0] == "thumbv6m" || llvm_target[0] == "thumbv8m.base" {
401421
let mut to_remove = Vec::new();

0 commit comments

Comments
 (0)