yac
/
coreutils
Archived
2
0
Fork 0

bloat-free true/false and necessary build stuff

This commit is contained in:
silt! 2022-12-04 23:43:05 -05:00 committed by emma
parent 1817f9b4ea
commit 7a110f7d09
4 changed files with 48 additions and 5 deletions

View File

@ -3,7 +3,10 @@ name = "coreutils"
version = "0.0.1"
edition = "2021"
license = "AGPL-3.0-or-later"
authors = [ "Emma Tebibyte <emma@tebibyte.media>" ]
authors = [
"Emma Tebibyte <emma@tebibyte.media>",
"silt <silt@tebibyte.media>"
]
[dependencies]

4
build.rs Normal file
View File

@ -0,0 +1,4 @@
fn main() {
println!("cargo:rustc-link-arg-bin=true=-nostartfiles");
println!("cargo:rustc-link-arg-bin=false=-nostartfiles");
}

View File

@ -1,4 +1,22 @@
// Copyright (c) 2022 Emma Tebibyte
// Copyright (c) 2022 silt <silt@tebibyte.media>
// 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)
)
}

View File

@ -1,4 +1,22 @@
// Copyright (c) 2022 Emma Tebibyte
// Copyright (c) 2022 silt <silt@tebibyte.media>
// 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)
)
}