mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-05-21 16:41:56 +03:00
ELF linker: support common-page-size and max-page-size lld opts
These linker flags are required to build static ELF binaries that can run under the Blink emulator: https://github.com/jart/blink/issues/14
This commit is contained in:
committed by
Andrew Kelley
parent
c28c38d1e5
commit
6ad92108e2
@@ -155,6 +155,12 @@ link_z_relro: bool = true,
|
||||
/// Allow relocations to be lazily processed after load.
|
||||
link_z_lazy: bool = false,
|
||||
|
||||
/// Common page size
|
||||
link_z_common_page_size: ?u64 = null,
|
||||
|
||||
/// Maximum page size
|
||||
link_z_max_page_size: ?u64 = null,
|
||||
|
||||
/// (Darwin) Install name for the dylib
|
||||
install_name: ?[]const u8 = null,
|
||||
|
||||
@@ -1338,6 +1344,14 @@ fn make(step: *Step) !void {
|
||||
try zig_args.append("-z");
|
||||
try zig_args.append("lazy");
|
||||
}
|
||||
if (self.link_z_common_page_size) |size| {
|
||||
try zig_args.append("-z");
|
||||
try zig_args.append(builder.fmt("common-page-size={d}", .{size}));
|
||||
}
|
||||
if (self.link_z_max_page_size) |size| {
|
||||
try zig_args.append("-z");
|
||||
try zig_args.append(builder.fmt("max-page-size={d}", .{size}));
|
||||
}
|
||||
|
||||
if (self.libc_file) |libc_file| {
|
||||
try zig_args.append("--libc");
|
||||
|
||||
Reference in New Issue
Block a user