diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-01-18 14:09:47 +0100 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-01-19 02:15:30 +0100 |
| commit | 8a78d875cc1cdab2648e7413fc0d2eea5afc6991 (patch) | |
| tree | 57301c426505167cbe1580e2912304fe2a5483ac /lib/std/os/linux/riscv64.zig | |
| parent | 4de661ef18d4cdc7f859c8bc1990e8a0519163db (diff) | |
| download | zig-8a78d875cc1cdab2648e7413fc0d2eea5afc6991.tar.gz zig-8a78d875cc1cdab2648e7413fc0d2eea5afc6991.zip | |
std.os.linux: Don't emit CFI directives if unwind tables are disabled.
Diffstat (limited to 'lib/std/os/linux/riscv64.zig')
| -rw-r--r-- | lib/std/os/linux/riscv64.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/std/os/linux/riscv64.zig b/lib/std/os/linux/riscv64.zig index 45ba568c1b..c402e9e894 100644 --- a/lib/std/os/linux/riscv64.zig +++ b/lib/std/os/linux/riscv64.zig @@ -1,3 +1,4 @@ +const builtin = @import("builtin"); const std = @import("../../std.zig"); const iovec = std.posix.iovec; const iovec_const = std.posix.iovec_const; @@ -120,7 +121,12 @@ pub fn clone() callconv(.Naked) usize { \\ ret \\ \\ # Child - \\1: .cfi_undefined ra + \\1: + ); + if (builtin.unwind_tables != .none or !builtin.strip_debug_info) asm volatile ( + \\ .cfi_undefined ra + ); + asm volatile ( \\ mv fp, zero \\ mv ra, zero \\ |
