aboutsummaryrefslogtreecommitdiff
path: root/src/Package/Module.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-12-13 03:09:24 +0100
committerGitHub <noreply@github.com>2024-12-13 03:09:24 +0100
commit130f7c2ed8e3358e24bb2fc7cca57f7a6f1f85c3 (patch)
treeebb88312b13fb8b1e67b852bcb0e42903ad11193 /src/Package/Module.zig
parentd48611ba67c7871cb348f28a01b89d8771170dd8 (diff)
parentc666ebb1f8aac440a4d0d554e9f8aa836bf58060 (diff)
downloadzig-130f7c2ed8e3358e24bb2fc7cca57f7a6f1f85c3.tar.gz
zig-130f7c2ed8e3358e24bb2fc7cca57f7a6f1f85c3.zip
Merge pull request #22035 from alexrp/unwind-fixes
Better unwind table support + unwind protection in `_start()` and `clone()`
Diffstat (limited to 'src/Package/Module.zig')
-rw-r--r--src/Package/Module.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Package/Module.zig b/src/Package/Module.zig
index 781a8e50c2..bfcef038ed 100644
--- a/src/Package/Module.zig
+++ b/src/Package/Module.zig
@@ -27,7 +27,7 @@ red_zone: bool,
sanitize_c: bool,
sanitize_thread: bool,
fuzz: bool,
-unwind_tables: bool,
+unwind_tables: std.builtin.UnwindTables,
cc_argv: []const []const u8,
/// (SPIR-V) whether to generate a structured control flow graph or not
structured_cfg: bool,
@@ -91,7 +91,7 @@ pub const CreateOptions = struct {
/// other number means stack protection with that buffer size.
stack_protector: ?u32 = null,
red_zone: ?bool = null,
- unwind_tables: ?bool = null,
+ unwind_tables: ?std.builtin.UnwindTables = null,
sanitize_c: ?bool = null,
sanitize_thread: ?bool = null,
fuzz: ?bool = null,
@@ -112,7 +112,7 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module {
if (options.inherited.sanitize_thread == true) assert(options.global.any_sanitize_thread);
if (options.inherited.fuzz == true) assert(options.global.any_fuzz);
if (options.inherited.single_threaded == false) assert(options.global.any_non_single_threaded);
- if (options.inherited.unwind_tables == true) assert(options.global.any_unwind_tables);
+ if (options.inherited.unwind_tables) |uwt| if (uwt != .none) assert(options.global.any_unwind_tables != .none);
if (options.inherited.error_tracing == true) assert(options.global.any_error_tracing);
const resolved_target = options.inherited.resolved_target orelse options.parent.?.resolved_target;
@@ -382,6 +382,7 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module {
.zig_backend = zig_backend,
.output_mode = options.global.output_mode,
.link_mode = options.global.link_mode,
+ .unwind_tables = options.global.any_unwind_tables,
.is_test = options.global.is_test,
.single_threaded = single_threaded,
.link_libc = options.global.link_libc,