aboutsummaryrefslogtreecommitdiff
path: root/src/link.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-10-31 01:33:49 +0100
committerAlex Rønne Petersen <alex@alexrp.com>2024-10-31 01:33:49 +0100
commit16b87f708212850a9ebcda3d91d7ce675ec78fa1 (patch)
tree4d3ee7025e4b2805c9df95a77b38e0d95da47431 /src/link.zig
parent33715cb28f5cc73339798048c4e3a2737c72c68f (diff)
downloadzig-16b87f708212850a9ebcda3d91d7ce675ec78fa1.tar.gz
zig-16b87f708212850a9ebcda3d91d7ce675ec78fa1.zip
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.
Diffstat (limited to 'src/link.zig')
-rw-r--r--src/link.zig8
1 files 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;