feat(cargo): compile freestanding binary

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
Julien CLEMENT 2021-11-27 18:41:04 +01:00
parent 66724cf0bf
commit 84a599e8f5
5 changed files with 40 additions and 0 deletions

2
.cargo/config.toml Normal file

@ -0,0 +1,2 @@
[target.'cfg(target_os = "linux")']
rustflags = ["-C", "link-arg=-nostartfiles"]

1
.gitignore vendored Normal file

@ -0,0 +1 @@
/target

7
Cargo.lock generated Normal file

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "julios"
version = "0.1.0"

16
Cargo.toml Normal file

@ -0,0 +1,16 @@
[package]
name = "julios"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"

14
src/main.rs Normal file

@ -0,0 +1,14 @@
#![no_std]
#![no_main]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> !
{
loop {}
}
#[no_mangle]
pub extern "C" fn _start() -> !
{
loop {}
}