Skip to content

Commit d3210c5

Browse files
committed
build: Allow building C compiler-rt fallbacks for RISC-V
Now that rust-lang/rust#117654 has been merged the rust-lang/rust distribution containers contain RISC-V C compilers. This means that we can now enable the "c" feature fallback. Resolves: #350 Signed-off-by: Alistair Francis <[email protected]>
1 parent 80ed5f8 commit d3210c5

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

build.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,7 @@ fn main() {
5959
// * wasm - clang for wasm is somewhat hard to come by and it's
6060
// unlikely that the C is really that much better than our own Rust.
6161
// * nvptx - everything is bitcode, not compatible with mixed C/Rust
62-
// * riscv - the rust-lang/rust distribution container doesn't have a C
63-
// compiler.
64-
if !target.contains("wasm")
65-
&& !target.contains("nvptx")
66-
&& (!target.starts_with("riscv") || target.contains("xous"))
67-
{
62+
if !target.contains("wasm") && !target.contains("nvptx") {
6863
#[cfg(feature = "c")]
6964
c::compile(&llvm_target, &target);
7065
}
@@ -519,7 +514,7 @@ mod c {
519514
}
520515
}
521516

522-
if target_arch == "mips" {
517+
if target_arch == "mips" || target_arch == "riscv32" || target_arch == "riscv64" {
523518
sources.extend(&[("__bswapsi2", "bswapsi2.c")]);
524519
}
525520

0 commit comments

Comments
 (0)