Skip to content

Commit

Permalink
build: Allow building C compiler-rt fallbacks for RISC-V
Browse files Browse the repository at this point in the history
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: rust-lang#350
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
  • Loading branch information
alistair23 committed Dec 19, 2023
1 parent 80ed5f8 commit d3210c5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,7 @@ fn main() {
// * wasm - clang for wasm is somewhat hard to come by and it's
// unlikely that the C is really that much better than our own Rust.
// * nvptx - everything is bitcode, not compatible with mixed C/Rust
// * riscv - the rust-lang/rust distribution container doesn't have a C
// compiler.
if !target.contains("wasm")
&& !target.contains("nvptx")
&& (!target.starts_with("riscv") || target.contains("xous"))
{
if !target.contains("wasm") && !target.contains("nvptx") {
#[cfg(feature = "c")]
c::compile(&llvm_target, &target);
}
Expand Down Expand Up @@ -519,7 +514,7 @@ mod c {
}
}

if target_arch == "mips" {
if target_arch == "mips" || target_arch == "riscv32" || target_arch == "riscv64" {
sources.extend(&[("__bswapsi2", "bswapsi2.c")]);
}

Expand Down

0 comments on commit d3210c5

Please sign in to comment.