Commit 16b87f7082

Alex Rønne Petersen <alex@alexrp.com>
2024-10-31 01:33:49
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.
1 parent 33715cb
Changed files (1)
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;