Skip to content

Commit caa19a7

Browse files
authored
Merge pull request #341 from vfreex/add-mips-compiler-rt-fallback
add mips/mips64 compiler-rt fallbacks so that libgcc is not required
2 parents f4c7940 + 3f012a8 commit caa19a7

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ jobs:
8888
- run: rustup component add llvm-tools-preview
8989
- name: Download compiler-rt reference sources
9090
run: |
91-
curl -L -o code.tar.gz https://github.com/rust-lang/llvm-project/archive/rustc/8.0-2019-03-18.tar.gz
92-
tar xzf code.tar.gz --strip-components 1 llvm-project-rustc-8.0-2019-03-18/compiler-rt
91+
curl -L -o code.tar.gz https://github.com/rust-lang/llvm-project/archive/rustc/10.0-2020-02-05.tar.gz
92+
tar xzf code.tar.gz --strip-components 1 llvm-project-rustc-10.0-2020-02-05/compiler-rt
9393
echo "##[set-env name=RUST_COMPILER_RT_ROOT]./compiler-rt"
9494
shell: bash
9595

build.rs

+19
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,25 @@ mod c {
421421
}
422422
}
423423

424+
if target_arch == "mips" {
425+
sources.extend(&[("__bswapsi2", "bswapsi2.c")]);
426+
}
427+
428+
if target_arch == "mips64" {
429+
sources.extend(&[
430+
("__extenddftf2", "extenddftf2.c"),
431+
("__netf2", "comparetf2.c"),
432+
("__addtf3", "addtf3.c"),
433+
("__multf3", "multf3.c"),
434+
("__subtf3", "subtf3.c"),
435+
("__fixtfsi", "fixtfsi.c"),
436+
("__floatsitf", "floatsitf.c"),
437+
("__fixunstfsi", "fixunstfsi.c"),
438+
("__floatunsitf", "floatunsitf.c"),
439+
("__fe_getround", "fp_mode.c"),
440+
]);
441+
}
442+
424443
// Remove the assembly implementations that won't compile for the target
425444
if llvm_target[0] == "thumbv6m" || llvm_target[0] == "thumbv8m.base" {
426445
let mut to_remove = Vec::new();

0 commit comments

Comments
 (0)