Implement remaining requested changes

- Replace @intCast with a checked version (std/debug.zig)
- Replace @intCast with i64() when casting from a smaller type (std/fs/file.zig)
- Replace `nakedcc` with appropriate calling convention for linking with c (std/os/linux/arm-eabi.zig)
- Only check if hwcap contains TLS when the hwcap field actually exists (std/os/linux/tls.zig)
This commit is contained in:
Robin Voetter
2019-09-04 16:23:25 +02:00
parent 6a76298740
commit 77d04c03e3
4 changed files with 9 additions and 8 deletions

View File

@@ -1053,7 +1053,8 @@ fn openSelfDebugInfoPosix(allocator: *mem.Allocator) !DwarfInfo {
S.self_exe_file = try fs.openSelfExe();
errdefer S.self_exe_file.close();
const self_exe_mmap_len = mem.alignForward(@intCast(usize, try S.self_exe_file.getEndPos()), mem.page_size);
const self_exe_len = math.cast(usize, try S.self_exe_file.getEndPos()) catch return error.DebugInfoTooLarge;
const self_exe_mmap_len = mem.alignForward(self_exe_len, mem.page_size);
const self_exe_mmap = try os.mmap(
null,
self_exe_mmap_len,