Skip to content

Commit

Permalink
add mips/mips64 compiler-rt fallbacks so that libgcc is not required
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vfreex committed Feb 12, 2020
1 parent 3e6327a commit ea4c64f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,26 @@ mod c {
}
}

if target_arch == "mips" {
cfg.flag("-msoft-float");
sources.extend(&[("__bswapsi2", "bswapsi2.c")]);
}

if target_arch == "mips64" {
sources.extend(&[
("__extenddftf2", "extenddftf2.c"),
("__netf2", "comparetf2.c"),
("__addtf3", "addtf3.c"),
("__multf3", "multf3.c"),
("__subtf3", "subtf3.c"),
("__fixtfsi", "fixtfsi.c"),
("__floatsitf", "floatsitf.c"),
("__fixunstfsi", "fixunstfsi.c"),
("__floatunsitf", "floatunsitf.c"),
("__fe_getround", "aarch64/fp_mode.c"),
]);
}

// Remove the assembly implementations that won't compile for the target
if llvm_target[0] == "thumbv6m" || llvm_target[0] == "thumbv8m.base" {
let mut to_remove = Vec::new();
Expand Down

0 comments on commit ea4c64f

Please sign in to comment.