diff options
| author | Matthew Lugg <mlugg@mlugg.co.uk> | 2025-01-24 05:11:26 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-24 05:11:26 +0000 |
| commit | f77e1b86225cd49c2d04dfa6ca4a7ede315dc0b1 (patch) | |
| tree | c30cddc29ae1f1162f3ec38fcaf89b94ecb4e6dd /src/libunwind.zig | |
| parent | d916954bee0f477bcada0693d4aa952197cf1eef (diff) | |
| parent | 180db2bf23f05a02876d4567cac3b04842c11acb (diff) | |
| download | zig-f77e1b86225cd49c2d04dfa6ca4a7ede315dc0b1.tar.gz zig-f77e1b86225cd49c2d04dfa6ca4a7ede315dc0b1.zip | |
Merge pull request #22578 from mlugg/stack-trace-tests-x86_64
tests: enable stack trace tests for x86_64-selfhosted
Diffstat (limited to 'src/libunwind.zig')
| -rw-r--r-- | src/libunwind.zig | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libunwind.zig b/src/libunwind.zig index c52b579890..c7753b9587 100644 --- a/src/libunwind.zig +++ b/src/libunwind.zig @@ -27,6 +27,9 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr const arena = arena_allocator.allocator(); const output_mode = .Lib; + const target = comp.root_mod.resolved_target.result; + const unwind_tables: std.builtin.UnwindTables = + if (target.cpu.arch == .x86 and target.os.tag == .windows) .none else .@"async"; const config = Compilation.Config.resolve(.{ .output_mode = .Lib, .resolved_target = comp.root_mod.resolved_target, @@ -36,6 +39,7 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr .root_optimize_mode = comp.compilerRtOptMode(), .root_strip = comp.compilerRtStrip(), .link_libc = true, + .any_unwind_tables = unwind_tables != .none, .lto = comp.config.lto, }) catch |err| { comp.setMiscFailure( @@ -45,7 +49,6 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr ); return error.SubCompilationFailed; }; - const target = comp.root_mod.resolved_target.result; const root_mod = Module.create(arena, .{ .global_cache_directory = comp.global_cache_directory, .paths = .{ @@ -65,7 +68,7 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr .sanitize_thread = false, // necessary so that libunwind can unwind through its own stack frames // The old 32-bit x86 variant of SEH doesn't use tables. - .unwind_tables = if (target.cpu.arch == .x86 and target.os.tag == .windows) .none else .@"async", + .unwind_tables = unwind_tables, .pic = if (target_util.supports_fpic(target)) true else null, .optimize_mode = comp.compilerRtOptMode(), }, |
