authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-08-30 12:37:05+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-08-30 12:37:05+02:00
log22c81740ef611fe6e3b7ac2390fa9cf058f0ac6b
tree4b144cbe802213ab6c87421998001288c6baf65b
parentf21245f5e773c61a8d1f5fb91309faadf0d2f103

macho: convert error.TODOImplementWritingStaticLibFiles into an actual error


2 files changed, 7 insertions(+), 5 deletions(-)

src/link.zig-1
......@@ -754,7 +754,6 @@ pub const File = struct {
754754 SymbolMismatchingType,
755755 TODOImplementPlan9Objs,
756756 TODOImplementWritingLibFiles,
757 TODOImplementWritingStaticLibFiles,
758757 UnableToSpawnSelf,
759758 UnableToSpawnWasm,
760759 UnableToWriteArchive,
src/link/MachO.zig+7-4
......@@ -267,8 +267,11 @@ pub fn flush(self: *MachO, comp: *Compilation, prog_node: *std.Progress.Node) li
267267 if (build_options.have_llvm) {
268268 return self.base.linkAsArchive(comp, prog_node);
269269 } else {
270 log.err("TODO: non-LLVM archiver for MachO object files", .{});
271 return error.TODOImplementWritingStaticLibFiles;
270 try self.misc_errors.ensureUnusedCapacity(self.base.allocator, 1);
271 self.misc_errors.appendAssumeCapacity(.{
272 .msg = try self.base.allocator.dupe(u8, "TODO: non-LLVM archiver for MachO object files"),
273 });
274 return error.FlushFailure;
272275 }
273276 }
274277
......@@ -2233,7 +2236,7 @@ pub fn lowerUnnamedConst(self: *MachO, typed_value: TypedValue, decl_index: Modu
22332236 .fail => |em| {
22342237 decl.analysis = .codegen_failure;
22352238 try mod.failed_decls.put(mod.gpa, decl_index, em);
2236 log.err("{s}", .{em.msg});
2239 log.debug("{s}", .{em.msg});
22372240 return error.CodegenFail;
22382241 },
22392242 };
......@@ -2388,7 +2391,7 @@ fn updateLazySymbolAtom(
23882391 const code = switch (res) {
23892392 .ok => code_buffer.items,
23902393 .fail => |em| {
2391 log.err("{s}", .{em.msg});
2394 log.debug("{s}", .{em.msg});
23922395 return error.CodegenFail;
23932396 },
23942397 };