diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2020-12-31 14:30:39 +0100 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2020-12-31 14:30:53 +0100 |
| commit | 707b81ec3722e67979683b5adbc9edd507bdbf9d (patch) | |
| tree | bdce387b6b29ae839cbb2dfd63361d08f677e530 /src | |
| parent | 46ea7a704ce4ce0669941b324296ca6092f9f2f6 (diff) | |
| download | zig-707b81ec3722e67979683b5adbc9edd507bdbf9d.tar.gz zig-707b81ec3722e67979683b5adbc9edd507bdbf9d.zip | |
Make sure MachO.zig compiles on 32bit hosts
This should fix #7614 or part of it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/link/MachO.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/link/MachO.zig b/src/link/MachO.zig index 2be7cb5199..ea6dcbbc33 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -860,13 +860,17 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { // Add load dylib load command self.libsystem_cmd_index = @intCast(u16, self.load_commands.items.len); - const cmdsize = mem.alignForwardGeneric(u64, @sizeOf(macho.dylib_command) + mem.lenZ(LIB_SYSTEM_PATH), @sizeOf(u64)); + const cmdsize = @intCast(u32, mem.alignForwardGeneric( + u64, + @sizeOf(macho.dylib_command) + mem.lenZ(LIB_SYSTEM_PATH), + @sizeOf(u64), + )); // TODO Find a way to work out runtime version from the OS version triple stored in std.Target. // In the meantime, we're gonna hardcode to the minimum compatibility version of 0.0.0. const min_version = 0x0; var dylib_cmd = emptyGenericCommandWithData(macho.dylib_command{ .cmd = macho.LC_LOAD_DYLIB, - .cmdsize = @intCast(u32, cmdsize), + .cmdsize = cmdsize, .dylib = .{ .name = @sizeOf(macho.dylib_command), .timestamp = 2, // not sure why not simply 0; this is reverse engineered from Mach-O files |
