diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2023-08-19 16:59:56 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2023-08-29 11:39:34 +0200 |
| commit | 05c9d6c00babc4ccc7949b3eb0224f70719d12a5 (patch) | |
| tree | 35fc484baeda4c590d7fec3423468d06118e334a /src/Compilation.zig | |
| parent | 7b282dffe68a7187a4fa4b5c11c82f1f67248a96 (diff) | |
| download | zig-05c9d6c00babc4ccc7949b3eb0224f70719d12a5.tar.gz zig-05c9d6c00babc4ccc7949b3eb0224f70719d12a5.zip | |
macho: add simple error reporting for misc errors
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 069cc8a2c7..a30d97f1da 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2609,6 +2609,9 @@ pub fn totalErrorCount(self: *Compilation) u32 { } total += @intFromBool(self.link_error_flags.missing_libc); + // Misc linker errors + total += self.bin_file.miscErrors().len; + // Compile log errors only count if there are no other errors. if (total == 0) { if (self.bin_file.options.module) |module| { @@ -2759,6 +2762,19 @@ pub fn getAllErrorsAlloc(self: *Compilation) !ErrorBundle { })); } + for (self.bin_file.miscErrors()) |link_err| { + try bundle.addRootErrorMessage(.{ + .msg = try bundle.addString(link_err.msg), + .notes_len = @intCast(link_err.notes.len), + }); + const notes_start = try bundle.reserveNotes(@intCast(link_err.notes.len)); + for (link_err.notes, 0..) |note, i| { + bundle.extra.items[notes_start + i] = @intFromEnum(try bundle.addErrorMessage(.{ + .msg = try bundle.addString(note.msg), + })); + } + } + if (self.bin_file.options.module) |module| { if (bundle.root_list.items.len == 0 and module.compile_log_decls.count() != 0) { const keys = module.compile_log_decls.keys(); |
