authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-12-31 14:30:39+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-12-31 14:30:53+01:00
log707b81ec3722e67979683b5adbc9edd507bdbf9d
treebdce387b6b29ae839cbb2dfd63361d08f677e530
parent46ea7a704ce4ce0669941b324296ca6092f9f2f6

Make sure MachO.zig compiles on 32bit hosts

This should fix #7614 or part of it.

1 files changed, 6 insertions(+), 2 deletions(-)

src/link/MachO.zig+6-2
......@@ -860,13 +860,17 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
860860
861861 // Add load dylib load command
862862 self.libsystem_cmd_index = @intCast(u16, self.load_commands.items.len);
863 const cmdsize = mem.alignForwardGeneric(u64, @sizeOf(macho.dylib_command) + mem.lenZ(LIB_SYSTEM_PATH), @sizeOf(u64));
863 const cmdsize = @intCast(u32, mem.alignForwardGeneric(
864 u64,
865 @sizeOf(macho.dylib_command) + mem.lenZ(LIB_SYSTEM_PATH),
866 @sizeOf(u64),
867 ));
864868 // TODO Find a way to work out runtime version from the OS version triple stored in std.Target.
865869 // In the meantime, we're gonna hardcode to the minimum compatibility version of 0.0.0.
866870 const min_version = 0x0;
867871 var dylib_cmd = emptyGenericCommandWithData(macho.dylib_command{
868872 .cmd = macho.LC_LOAD_DYLIB,
869 .cmdsize = @intCast(u32, cmdsize),
873 .cmdsize = cmdsize,
870874 .dylib = .{
871875 .name = @sizeOf(macho.dylib_command),
872876 .timestamp = 2, // not sure why not simply 0; this is reverse engineered from Mach-O files