Skip to content

Commit

Permalink
minimal_build
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidharth-Singh10 committed Jul 3, 2024
1 parent 2757de8 commit cc32527
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[unstable]
build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins"]
[build]
target = "x86-roxy.json"
21 changes: 21 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -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 {}
}
15 changes: 15 additions & 0 deletions x86-roxy.json
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit cc32527

Please sign in to comment.