Skip to content

Commit 335360b

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 <[email protected]>
1 parent 3e6327a commit 335360b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

build.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,28 @@ mod c {
396396
}
397397
}
398398

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

0 commit comments

Comments
 (0)