Skip to content

Commit 4fa69f1

Browse files
committed
build: compile C code for "xous" operating system
The "xous" operating system is enturely Rust-based, meaning it has no libc. Therefore, it relies on `compiler-builtins` for all intrinsics. Unfortunately, there are not yet Rust equivalents for all C functions. For example, triganometric functions are still missing. In the meantime, enable C replacements for these functions so that Rust programs compiled for Xous can call these functions. Signed-off-by: Sean Cross <[email protected]>
1 parent dde946c commit 4fa69f1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

build.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ fn main() {
5858
// unlikely that the C is really that much better than our own Rust.
5959
// * nvptx - everything is bitcode, not compatible with mixed C/Rust
6060
// * riscv - the rust-lang/rust distribution container doesn't have a C
61-
// compiler nor is cc-rs ready for compilation to riscv (at this
62-
// time). This can probably be removed in the future
63-
if !target.contains("wasm") && !target.contains("nvptx") && !target.starts_with("riscv") {
61+
// compiler.
62+
if !target.contains("wasm")
63+
&& !target.contains("nvptx")
64+
&& (!target.starts_with("riscv") || target.contains("xous"))
65+
{
6466
#[cfg(feature = "c")]
6567
c::compile(&llvm_target, &target);
6668
}

0 commit comments

Comments
 (0)