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 {...@@ -754,7 +754,6 @@ pub const File = struct {
754 SymbolMismatchingType,754 SymbolMismatchingType,
755 TODOImplementPlan9Objs,755 TODOImplementPlan9Objs,
756 TODOImplementWritingLibFiles,756 TODOImplementWritingLibFiles,
757 TODOImplementWritingStaticLibFiles,
758 UnableToSpawnSelf,757 UnableToSpawnSelf,
759 UnableToSpawnWasm,758 UnableToSpawnWasm,
760 UnableToWriteArchive,759 UnableToWriteArchive,
src/link/MachO.zig+7-4
...@@ -267,8 +267,11 @@ pub fn flush(self: *MachO, comp: *Compilation, prog_node: *std.Progress.Node) li...@@ -267,8 +267,11 @@ pub fn flush(self: *MachO, comp: *Compilation, prog_node: *std.Progress.Node) li
267 if (build_options.have_llvm) {267 if (build_options.have_llvm) {
268 return self.base.linkAsArchive(comp, prog_node);268 return self.base.linkAsArchive(comp, prog_node);
269 } else {269 } else {
270 log.err("TODO: non-LLVM archiver for MachO object files", .{});270 try self.misc_errors.ensureUnusedCapacity(self.base.allocator, 1);
271 return error.TODOImplementWritingStaticLibFiles;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;
272 }275 }
273 }276 }
274277
...@@ -2233,7 +2236,7 @@ pub fn lowerUnnamedConst(self: *MachO, typed_value: TypedValue, decl_index: Modu...@@ -2233,7 +2236,7 @@ pub fn lowerUnnamedConst(self: *MachO, typed_value: TypedValue, decl_index: Modu
2233 .fail => |em| {2236 .fail => |em| {
2234 decl.analysis = .codegen_failure;2237 decl.analysis = .codegen_failure;
2235 try mod.failed_decls.put(mod.gpa, decl_index, em);2238 try mod.failed_decls.put(mod.gpa, decl_index, em);
2236 log.err("{s}", .{em.msg});2239 log.debug("{s}", .{em.msg});
2237 return error.CodegenFail;2240 return error.CodegenFail;
2238 },2241 },
2239 };2242 };
...@@ -2388,7 +2391,7 @@ fn updateLazySymbolAtom(...@@ -2388,7 +2391,7 @@ fn updateLazySymbolAtom(
2388 const code = switch (res) {2391 const code = switch (res) {
2389 .ok => code_buffer.items,2392 .ok => code_buffer.items,
2390 .fail => |em| {2393 .fail => |em| {
2391 log.err("{s}", .{em.msg});2394 log.debug("{s}", .{em.msg});
2392 return error.CodegenFail;2395 return error.CodegenFail;
2393 },2396 },
2394 };2397 };