Skip to content

Commit

Permalink
Merge pull request #563 from alistair23/alistair/riscv-builtins
Browse files Browse the repository at this point in the history
build: Allow building C compiler-rt fallbacks for RISC-V
  • Loading branch information
Amanieu authored Jan 18, 2024
2 parents 47e64bf + d3210c5 commit 85c395b
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 85c395b

Please sign in to comment.