authorgravatar for edwards.harold@pm.meHarold <edwards.harold@pm.me> 2025-11-15 13:50:15+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-11-19 20:13:54+01:00
log2f240d0819b99999964ad2cee9193dc3d7b1df28
tree2413aa58469f73af89911d17764e98a0420d0534
parentbd832ed39ac60883a82668a24fcc0d863331428b

std.Build.Step.Compile: add support for '-z defs' flag


1 files changed, 7 insertions(+), 0 deletions(-)

lib/std/Build/Step/Compile.zig+7
...@@ -135,6 +135,9 @@ link_z_common_page_size: ?u64 = null,...@@ -135,6 +135,9 @@ link_z_common_page_size: ?u64 = null,
135/// Maximum page size135/// Maximum page size
136link_z_max_page_size: ?u64 = null,136link_z_max_page_size: ?u64 = null,
137137
138/// Force a fatal error if any undefined symbols remain.
139link_z_defs: bool = false,
140
138/// (Darwin) Install name for the dylib141/// (Darwin) Install name for the dylib
139install_name: ?[]const u8 = null,142install_name: ?[]const u8 = null,
140143
...@@ -1550,6 +1553,10 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 {...@@ -1550,6 +1553,10 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 {
1550 try zig_args.append("-z");1553 try zig_args.append("-z");
1551 try zig_args.append(b.fmt("max-page-size={d}", .{size}));1554 try zig_args.append(b.fmt("max-page-size={d}", .{size}));
1552 }1555 }
1556 if (compile.link_z_defs) {
1557 try zig_args.append("-z");
1558 try zig_args.append("defs");
1559 }
15531560
1554 if (compile.libc_file) |libc_file| {1561 if (compile.libc_file) |libc_file| {
1555 try zig_args.append("--libc");1562 try zig_args.append("--libc");