Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
chore(init): support no_std
Browse files Browse the repository at this point in the history
  • Loading branch information
toku-sa-n committed Jun 29, 2021
1 parent 31de448 commit b8f5dc3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
9 changes: 9 additions & 0 deletions servers/init/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build]
rustflags = [
"-C", "relocation-model=static",
"-C", "link-args=-e main",
"-C", "no-redzone=y",
"-C", "default-linker-libraries=n",
"-C", "soft-float=y",
]

7 changes: 7 additions & 0 deletions servers/init/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#![no_std]
#![deny(unsafe_op_in_unsafe_fn)]

#[panic_handler]
fn panic(_: &core::panic::PanicInfo<'_>) -> ! {
loop {}
}
11 changes: 8 additions & 3 deletions servers/init/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
fn main() {
println!("Hello, world!");
}
#![no_std]
#![no_main]
#![deny(unsafe_op_in_unsafe_fn)]

extern crate init as _;

#[no_mangle]
fn main() {}

0 comments on commit b8f5dc3

Please sign in to comment.