diff options
| author | Mario Nachbaur <marionauta@users.noreply.github.com> | 2024-10-29 22:12:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 22:12:57 +0100 |
| commit | 4661705a0e9b28ea008ffb85258daf1d5510b054 (patch) | |
| tree | 078d340cf691e574bf2ec1ec49e4c1582f58e391 /lib/std/debug/SelfInfo.zig | |
| parent | 3450809e3db14226b7f8e57bdfa7fde590e803d8 (diff) | |
| download | zig-4661705a0e9b28ea008ffb85258daf1d5510b054.tar.gz zig-4661705a0e9b28ea008ffb85258daf1d5510b054.zip | |
std.debug: watchOS: fixes for ilp32 ABI (#21765)
Xcode requires target arm64_32 (aarch64-watchos-ilp32) in order to
build code for Apple Watches. This commit fixes compilation errors
that appear when compiling with that target.
Diffstat (limited to 'lib/std/debug/SelfInfo.zig')
| -rw-r--r-- | lib/std/debug/SelfInfo.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/std/debug/SelfInfo.zig b/lib/std/debug/SelfInfo.zig index 5e9afc8cfd..228458aaef 100644 --- a/lib/std/debug/SelfInfo.zig +++ b/lib/std/debug/SelfInfo.zig @@ -184,10 +184,12 @@ fn lookupModuleDyld(self: *SelfInfo, address: usize) !*Module { } for (cmd.getSections()) |sect| { + const sect_addr: usize = @intCast(sect.addr); + const sect_size: usize = @intCast(sect.size); if (mem.eql(u8, "__unwind_info", sect.sectName())) { - unwind_info = @as([*]const u8, @ptrFromInt(sect.addr + vmaddr_slide))[0..sect.size]; + unwind_info = @as([*]const u8, @ptrFromInt(sect_addr + vmaddr_slide))[0..sect_size]; } else if (mem.eql(u8, "__eh_frame", sect.sectName())) { - eh_frame = @as([*]const u8, @ptrFromInt(sect.addr + vmaddr_slide))[0..sect.size]; + eh_frame = @as([*]const u8, @ptrFromInt(sect_addr + vmaddr_slide))[0..sect_size]; } } @@ -590,7 +592,7 @@ pub const Module = switch (native_os) { const section_bytes = try Dwarf.chopSlice(mapped_mem, sect.offset, sect.size); sections[section_index.?] = .{ .data = section_bytes, - .virtual_address = sect.addr, + .virtual_address = @intCast(sect.addr), .owned = false, }; } |
