aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2024-01-15 10:58:40 +0100
committerJakub Konka <kubkon@jakubkonka.com>2024-01-24 12:34:40 +0100
commitabeb0e3ea41888dd2f4ac04ae335927aba2e7b07 (patch)
treea6c521d1a62a922abe1fed06f02f655d5afa757f /src
parent7c65f0be375c7e4f0d2ecdc846ae5e9b49cf2737 (diff)
downloadzig-abeb0e3ea41888dd2f4ac04ae335927aba2e7b07.tar.gz
zig-abeb0e3ea41888dd2f4ac04ae335927aba2e7b07.zip
test/link/macho: test force-loading objects containing ObjC from archives
Diffstat (limited to 'src')
-rw-r--r--src/link/MachO.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/link/MachO.zig b/src/link/MachO.zig
index cbc0c8ec65..8d959275aa 100644
--- a/src/link/MachO.zig
+++ b/src/link/MachO.zig
@@ -116,6 +116,9 @@ platform: Platform,
sdk_version: ?std.SemanticVersion,
/// When set to true, the linker will hoist all dylibs including system dependent dylibs.
no_implicit_dylibs: bool = false,
+/// Whether the linker should parse and always force load objects containing ObjC in archives.
+// TODO: in Zig we currently take -ObjC as always on
+force_load_objc: bool = true,
/// Hot-code swapping state.
hot_state: if (is_hot_update_compatible) HotUpdateState else struct {} = .{},
@@ -998,7 +1001,7 @@ fn parseArchive(self: *MachO, lib: SystemLib, must_link: bool, fat_arch: ?fat.Ar
// Finally, we do a post-parse check for -ObjC to see if we need to force load this member
// anyhow.
- // TODO: object.alive = object.alive or (self.options.force_load_objc and object.hasObjc());
+ object.alive = object.alive or (self.force_load_objc and object.hasObjc());
}
if (has_parse_error) return error.MalformedArchive;
}