aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2022-06-25 10:39:53 +0200
committerJakub Konka <kubkon@jakubkonka.com>2022-06-25 18:04:40 +0200
commit589bf67635a9fe9c3e6df4b63c09e0cc4954d29a (patch)
treec8e26db7d4f8d83facb6b4a91514bbbff496ed78 /src/main.zig
parenta6fbdfabb9b60262594da012b8d877a43d8d8e99 (diff)
downloadzig-589bf67635a9fe9c3e6df4b63c09e0cc4954d29a.tar.gz
zig-589bf67635a9fe9c3e6df4b63c09e0cc4954d29a.zip
macho: implement -headerpad_max_install_names
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.zig b/src/main.zig
index 87b0e6fc8a..d63e235360 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -450,7 +450,7 @@ const usage_build_generic =
\\ -pagezero_size [value] (Darwin) size of the __PAGEZERO segment in hexadecimal notation
\\ -search_paths_first (Darwin) search each dir in library search paths for `libx.dylib` then `libx.a`
\\ -search_dylibs_first (Darwin) search `libx.dylib` in each dir in library search paths, then `libx.a`
- \\ -headerpad_size [value] (Darwin) set minimum space for future expansion of the load commands in hexadecimal notation
+ \\ -headerpad [value] (Darwin) set minimum space for future expansion of the load commands in hexadecimal notation
\\ -headerpad_max_install_names (Darwin) set enough space as if all paths were MAXPATHLEN
\\ --import-memory (WebAssembly) import memory from the environment
\\ --import-table (WebAssembly) import function table from the host environment
@@ -701,7 +701,7 @@ fn buildOutputType(
var entitlements: ?[]const u8 = null;
var pagezero_size: ?u64 = null;
var search_strategy: ?link.File.MachO.SearchStrategy = null;
- var headerpad_size: ?u64 = null;
+ var headerpad_size: ?u32 = null;
var headerpad_max_install_names: bool = false;
// e.g. -m3dnow or -mno-outline-atomics. They correspond to std.Target llvm cpu feature names.
@@ -928,11 +928,11 @@ fn buildOutputType(
search_strategy = .paths_first;
} else if (mem.eql(u8, arg, "-search_dylibs_first")) {
search_strategy = .dylibs_first;
- } else if (mem.eql(u8, arg, "-headerpad_size")) {
+ } else if (mem.eql(u8, arg, "-headerpad")) {
const next_arg = args_iter.next() orelse {
fatal("expected parameter after {s}", .{arg});
};
- headerpad_size = std.fmt.parseUnsigned(u64, eatIntPrefix(next_arg, 16), 16) catch |err| {
+ headerpad_size = std.fmt.parseUnsigned(u32, eatIntPrefix(next_arg, 16), 16) catch |err| {
fatal("unable to parser '{s}': {s}", .{ arg, @errorName(err) });
};
} else if (mem.eql(u8, arg, "-headerpad_max_install_names")) {
@@ -1689,13 +1689,13 @@ fn buildOutputType(
pagezero_size = std.fmt.parseUnsigned(u64, eatIntPrefix(next_arg, 16), 16) catch |err| {
fatal("unable to parse '{s}': {s}", .{ arg, @errorName(err) });
};
- } else if (mem.eql(u8, arg, "-headerpad_size")) {
+ } else if (mem.eql(u8, arg, "-headerpad")) {
i += 1;
if (i >= linker_args.items.len) {
fatal("expected linker arg after '{s}'", .{arg});
}
const next_arg = linker_args.items[i];
- headerpad_size = std.fmt.parseUnsigned(u64, eatIntPrefix(next_arg, 16), 16) catch |err| {
+ headerpad_size = std.fmt.parseUnsigned(u32, eatIntPrefix(next_arg, 16), 16) catch |err| {
fatal("unable to parse '{s}': {s}", .{ arg, @errorName(err) });
};
} else if (mem.eql(u8, arg, "-headerpad_max_install_names")) {