Skip to content
Snippets Groups Projects
Commit 8c0be732 authored by bjorn3's avatar bjorn3
Browse files

Build the kernel with panic=abort

This reduces the kernel size and avoids the need to define the
eh_personality lang item.
parent acefb888
No related branches found
No related tags found
1 merge request!229Build the kernel with panic=abort
......@@ -6,4 +6,3 @@ rustflags = [
[unstable]
build-std = ["core", "alloc", "compiler_builtins"]
build-std-features = ["panic-unwind"]
......@@ -61,8 +61,14 @@ slab = ["slab_allocator"]
x86_fsgsbase = []
[profile.dev]
# Avoids having to define the eh_personality lang item and reduces kernel size
panic = "abort"
# Kernel doesn't yet work great with debug mode :(
opt-level = 3
[profile.release]
# Avoids having to define the eh_personality lang item and reduces kernel size
panic = "abort"
lto = true
......@@ -50,7 +50,6 @@
#![feature(concat_idents)]
#![feature(core_intrinsics)]
#![feature(integer_atomics)]
#![feature(lang_items)]
#![feature(naked_functions)]
#![feature(ptr_internals)]
#![feature(slice_ptr_get, slice_ptr_len)]
......
......@@ -5,10 +5,6 @@ use core::panic::PanicInfo;
use crate::{cpu_id, context, interrupt, syscall};
#[lang = "eh_personality"]
#[no_mangle]
pub extern "C" fn rust_eh_personality() {}
/// Required to handle panics
#[panic_handler]
#[no_mangle]
......@@ -44,12 +40,3 @@ pub extern "C" fn rust_begin_unwind(info: &PanicInfo) -> ! {
pub extern fn rust_oom(_layout: Layout) -> ! {
panic!("kernel memory allocation failed");
}
#[allow(non_snake_case)]
#[no_mangle]
/// Required to handle panics
pub extern "C" fn _Unwind_Resume() -> ! {
loop {
unsafe { interrupt::halt(); }
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment