From 32edde868c1e7a37f9aa11e32c16cd3adce43c33 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Tue, 4 Jun 2024 22:33:00 +0200 Subject: toolchain: bump rust toolchain version 1. allow unexpected cfgs in lib.rs, in this case "no_global_oom_handling" is cause warnings [1] 2. for large code models the compiler (rust linkers) now put code and data in `.ltext`, `.ldata`, `.lbss`, `.lrodata` instead of the same `.text` , `.data` ... etc. We are adjusting accordingly in the linker script. 3. unsafe assertions identified undefined behaviours, in this case a repr(C) struct was not mared as repr(packed), therefore having an unexpected size. The unsafe assertions was not enabled by default in debug builds so the idt setup code with from_raw_parts_mut() has been working on UB. Glad we can catch this.... related: [1] https://github.com/rust-lang/rust/pull/123501 related: [2] https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html#asserting-unsafe-preconditions --- defs/x86_64-hm-linker.ld | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'defs/x86_64-hm-linker.ld') diff --git a/defs/x86_64-hm-linker.ld b/defs/x86_64-hm-linker.ld index 563940e..c8a213c 100644 --- a/defs/x86_64-hm-linker.ld +++ b/defs/x86_64-hm-linker.ld @@ -82,6 +82,9 @@ SECTIONS *(".text") *(".text.*") *(".text$") + *(".ltext") + *(".ltext.*") + *(".ltext$") } .data : AT(ADDR(.data) - KERNEL_OFFSET) @@ -89,13 +92,19 @@ SECTIONS *(".data") *(".data.*") *(".data$") + *(".ldata") + *(".ldata.*") + *(".ldata$") } .bss : AT(ADDR(.bss) - KERNEL_OFFSET) { PROVIDE (___BSS_START__ = .); *(".bss") + *(".lbss") *(".bss.*") + *(".lbss.*") + *(".lbss$") PROVIDE (___BSS_END__ = .); } @@ -104,6 +113,9 @@ SECTIONS *(".rodata") *(".rodata$") *(".rodata.*") + *(".lrodata") + *(".lrodata$") + *(".lrodata.*") } PROVIDE (___KERNEL_PM_END__ = . - KERNEL_OFFSET); -- cgit v1.2.3-70-g09d2