start: Don't emit CFI directives if unwind tables are disabled.

This commit is contained in:
Alex Rønne Petersen 2025-01-18 13:54:05 +01:00
parent 566cc4f99d
commit 4de661ef18
No known key found for this signature in database

View File

@ -231,8 +231,8 @@ fn _start() callconv(.naked) noreturn {
} }
// This is the first userspace frame. Prevent DWARF-based unwinders from unwinding further. We // This is the first userspace frame. Prevent DWARF-based unwinders from unwinding further. We
// prevent FP-based unwinders from unwinding further by zeroing the register further below. // prevent FP-based unwinders from unwinding further by zeroing the register below.
asm volatile (switch (native_arch) { if (builtin.unwind_tables != .none or !builtin.strip_debug_info) asm volatile (switch (native_arch) {
.arc => ".cfi_undefined blink", .arc => ".cfi_undefined blink",
.arm, .armeb, .thumb, .thumbeb => "", // https://github.com/llvm/llvm-project/issues/115891 .arm, .armeb, .thumb, .thumbeb => "", // https://github.com/llvm/llvm-project/issues/115891
.aarch64, .aarch64_be => ".cfi_undefined lr", .aarch64, .aarch64_be => ".cfi_undefined lr",