From 9ba65d2834b56eccdaa0c9c7537606e9579092a8 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Fri, 25 Oct 2024 10:32:53 +0200 Subject: [PATCH] macho: handle -no_fixup_chains flag --- src/MachO/Options.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MachO/Options.zig b/src/MachO/Options.zig index 10d38c1b..9ebf6454 100644 --- a/src/MachO/Options.zig +++ b/src/MachO/Options.zig @@ -59,6 +59,7 @@ const usage = \\-needed-l[name] Link against library (even if unused) \\ -needed_library [name] \\-no_deduplicate Do not run deduplication pass in linker + \\-no_fixup_chains Do not emit fixup chains \\-no_implicit_dylibs Do not hoist public dylibs/frameworks into the final image. \\-o [path] Specify output path for the final artifact \\-ObjC Force load all members of static archives that implement an @@ -135,6 +136,7 @@ all_load: bool = false, force_load_objc: bool = false, adhoc_codesign: ?bool = null, exported_symbols: []const []const u8 = &[0][]const u8{}, +fixup_chains: bool = false, // TODO default should be true but probably depends on the host version pub fn parse(arena: Allocator, args: []const []const u8, ctx: anytype) !Options { if (args.len == 0) ctx.fatal(usage ++ "\n", .{cmd}); @@ -337,6 +339,8 @@ pub fn parse(arena: Allocator, args: []const []const u8, ctx: anytype) !Options opts.no_deduplicate = true; } else if (p.flag1("no_implicit_dylibs")) { opts.no_implicit_dylibs = true; + } else if (p.flag1("no_fixup_chains")) { + opts.fixup_chains = false; } else if (p.flag1("two_levelnamespace")) { opts.namespace = .two_level; } else if (p.flag1("flat_namespace")) {