bloat-free true/false and necessary build stuff
This commit is contained in:
parent
1817f9b4ea
commit
7a110f7d09
@ -3,7 +3,10 @@ name = "coreutils"
|
|||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
authors = [ "Emma Tebibyte <emma@tebibyte.media>" ]
|
authors = [
|
||||||
|
"Emma Tebibyte <emma@tebibyte.media>",
|
||||||
|
"silt <silt@tebibyte.media>"
|
||||||
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
||||||
|
4
build.rs
Normal file
4
build.rs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
fn main() {
|
||||||
|
println!("cargo:rustc-link-arg-bin=true=-nostartfiles");
|
||||||
|
println!("cargo:rustc-link-arg-bin=false=-nostartfiles");
|
||||||
|
}
|
@ -1,4 +1,22 @@
|
|||||||
// Copyright (c) 2022 Emma Tebibyte
|
// Copyright (c) 2022 silt <silt@tebibyte.media>
|
||||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
fn main() { std::process::exit(1); }
|
#![feature(lang_items, start)]
|
||||||
|
#![no_main]
|
||||||
|
#![no_std]
|
||||||
|
|
||||||
|
use core::panic::PanicInfo;
|
||||||
|
use core::arch::asm;
|
||||||
|
|
||||||
|
#[lang = "eh_personality"] extern fn rust_eh_personality() {}
|
||||||
|
#[lang = "panic_impl"] extern fn rust_begin_panic(_: &PanicInfo) -> ! { loop {} }
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub unsafe fn _start() -> ! {
|
||||||
|
asm!(
|
||||||
|
"syscall",
|
||||||
|
in("rax") 60, // Syscall number
|
||||||
|
in("rdi") 1, // Exit code
|
||||||
|
options(noreturn)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
@ -1,4 +1,22 @@
|
|||||||
// Copyright (c) 2022 Emma Tebibyte
|
// Copyright (c) 2022 silt <silt@tebibyte.media>
|
||||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
fn main() { }
|
#![feature(lang_items, start)]
|
||||||
|
#![no_main]
|
||||||
|
#![no_std]
|
||||||
|
|
||||||
|
use core::panic::PanicInfo;
|
||||||
|
use core::arch::asm;
|
||||||
|
|
||||||
|
#[lang = "eh_personality"] extern fn rust_eh_personality() {}
|
||||||
|
#[lang = "panic_impl"] extern fn rust_begin_panic(_: &PanicInfo) -> ! { loop {} }
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub unsafe fn _start() -> ! {
|
||||||
|
asm!(
|
||||||
|
"syscall",
|
||||||
|
in("rax") 60, // Syscall number
|
||||||
|
in("rdi") 0, // Exit code
|
||||||
|
options(noreturn)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user