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

This commit is contained in:
Harold 2025-11-15 13:50:15 +01:00 committed by Alex Rønne Petersen
parent bd832ed39a
commit 2f240d0819

View file

@ -135,6 +135,9 @@ link_z_common_page_size: ?u64 = null,
/// Maximum page size
link_z_max_page_size: ?u64 = null,
/// Force a fatal error if any undefined symbols remain.
link_z_defs: bool = false,
/// (Darwin) Install name for the dylib
install_name: ?[]const u8 = null,
@ -1550,6 +1553,10 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 {
try zig_args.append("-z");
try zig_args.append(b.fmt("max-page-size={d}", .{size}));
}
if (compile.link_z_defs) {
try zig_args.append("-z");
try zig_args.append("defs");
}
if (compile.libc_file) |libc_file| {
try zig_args.append("--libc");