diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-01-23 01:38:20 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-01-23 23:22:38 +0000 |
| commit | ef4d7f01a5c26d8ed6fa8236d1b64e4091a51be3 (patch) | |
| tree | 80da7b2ae3a66a5e394d31ccd62421529a14929b /src/Compilation.zig | |
| parent | b46a40ff1db6c4d467925a9a0d72436cdb3a6a74 (diff) | |
| download | zig-ef4d7f01a5c26d8ed6fa8236d1b64e4091a51be3.tar.gz zig-ef4d7f01a5c26d8ed6fa8236d1b64e4091a51be3.zip | |
compiler: Fix computation of Compilation.Config.any_unwind_tables.
This moves the default value logic to Package.Module.create() instead and makes
it so that Compilation.Config.any_unwind_tables is computed similarly to
any_sanitize_thread, any_fuzz, etc. It turns out that for any_unwind_tables, we
only actually care if unwind tables are enabled at all, not at what level.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index ac8fb8a59b..81d95df9ef 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1274,15 +1274,12 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil // The "any" values provided by resolved config only account for // explicitly-provided settings. We now make them additionally account // for default setting resolution. - const any_unwind_tables = switch (options.config.any_unwind_tables) { - .none => options.root_mod.unwind_tables, - .sync, .@"async" => |uwt| uwt, - }; + const any_unwind_tables = options.config.any_unwind_tables or options.root_mod.unwind_tables != .none; const any_non_single_threaded = options.config.any_non_single_threaded or !options.root_mod.single_threaded; const any_sanitize_thread = options.config.any_sanitize_thread or options.root_mod.sanitize_thread; const any_fuzz = options.config.any_fuzz or options.root_mod.fuzz; - const link_eh_frame_hdr = options.link_eh_frame_hdr or any_unwind_tables != .none; + const link_eh_frame_hdr = options.link_eh_frame_hdr or any_unwind_tables; const build_id = options.build_id orelse .none; const link_libc = options.config.link_libc; @@ -6459,6 +6456,7 @@ fn buildOutputFromZig( .root_optimize_mode = optimize_mode, .root_strip = strip, .link_libc = comp.config.link_libc, + .any_unwind_tables = comp.root_mod.unwind_tables != .none, }); const root_mod = try Package.Module.create(arena, .{ @@ -6595,6 +6593,7 @@ pub fn build_crt_file( .root_optimize_mode = comp.compilerRtOptMode(), .root_strip = comp.compilerRtStrip(), .link_libc = false, + .any_unwind_tables = options.unwind_tables != .none, .lto = switch (output_mode) { .Lib => comp.config.lto, .Obj, .Exe => .none, |
