From 16b87f708212850a9ebcda3d91d7ce675ec78fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Thu, 31 Oct 2024 01:33:49 +0100 Subject: [PATCH] link: Fix archive format selection for some OSs. * AIX has its own bespoke format. * Handle all Apple platforms. * FreeBSD and OpenBSD both use the GNU format in LLVM. * Windows has since been switched to the COFF format by default in LLVM. --- src/link.zig | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/link.zig b/src/link.zig index b784e21f06..ef0c2fa269 100644 --- a/src/link.zig +++ b/src/link.zig @@ -1214,11 +1214,9 @@ pub const File = struct { object_files.items.ptr, object_files.items.len, switch (target.os.tag) { - .linux => .GNU, - .freebsd, .openbsd => .BSD, - .macos, .ios => .DARWIN, - .windows => .GNU, - else => .GNU, + .aix => .AIXBIG, + .windows => .COFF, + else => if (target.os.tag.isDarwin()) .DARWIN else .GNU, }, ); if (bad) return error.UnableToWriteArchive;