| ... | @@ -860,13 +860,17 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { | ... | @@ -860,13 +860,17 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { |
| 860 | | 860 | |
| 861 | // Add load dylib load command | 861 | // Add load dylib load command |
| 862 | self.libsystem_cmd_index = @intCast(u16, self.load_commands.items.len); | 862 | 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 | )); |
| 864 | // TODO Find a way to work out runtime version from the OS version triple stored in std.Target. | 868 | // TODO Find a way to work out runtime version from the OS version triple stored in std.Target. |
| 865 | // In the meantime, we're gonna hardcode to the minimum compatibility version of 0.0.0. | 869 | // In the meantime, we're gonna hardcode to the minimum compatibility version of 0.0.0. |
| 866 | const min_version = 0x0; | 870 | const min_version = 0x0; |
| 867 | var dylib_cmd = emptyGenericCommandWithData(macho.dylib_command{ | 871 | var dylib_cmd = emptyGenericCommandWithData(macho.dylib_command{ |
| 868 | .cmd = macho.LC_LOAD_DYLIB, | 872 | .cmd = macho.LC_LOAD_DYLIB, |
| 869 | .cmdsize = @intCast(u32, cmdsize), | 873 | .cmdsize = cmdsize, |
| 870 | .dylib = .{ | 874 | .dylib = .{ |
| 871 | .name = @sizeOf(macho.dylib_command), | 875 | .name = @sizeOf(macho.dylib_command), |
| 872 | .timestamp = 2, // not sure why not simply 0; this is reverse engineered from Mach-O files | 876 | .timestamp = 2, // not sure why not simply 0; this is reverse engineered from Mach-O files |