diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..e3808ca --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,5 @@ +[unstable] +build-std-features = ["compiler-builtins-mem"] +build-std = ["core", "compiler_builtins"] +[build] +target = "x86-roxy.json" \ No newline at end of file diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..68ada0d --- /dev/null +++ b/src/main.rs @@ -0,0 +1,21 @@ +#![no_std] +#![no_main] +#![feature(custom_test_frameworks)] +#![test_runner(test_runner)] + +use core::panic::PanicInfo; + +#[no_mangle] +pub extern "C" fn _start() -> ! { + loop {} +} + +#[panic_handler] +fn panic(_info: &PanicInfo) -> ! { // "!" is never type, since function should never return anything + loop {} +} + +#[cfg(test)] +fn test_runner(_test: &[&dyn Fn()]) { + loop {} +} \ No newline at end of file diff --git a/x86-roxy.json b/x86-roxy.json new file mode 100644 index 0000000..0956b04 --- /dev/null +++ b/x86-roxy.json @@ -0,0 +1,15 @@ +{ + "llvm-target": "x86_64-unknown-none", + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", + "arch": "x86_64", + "target-endian": "little", + "target-pointer-width": "64", + "target-c-int-width": "32", + "os": "none", + "executables": true, + "linker-flavor": "ld.lld", + "linker": "rust-lld", + "panic-strategy": "abort", + "disable-redzone": true, + "features": "-mmx,-sse,+soft-float" +} \ No newline at end of file