zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 16b87f708212850a9ebcda3d91d7ce675ec78fa1 (tree)
parent 33715cb28f5cc73339798048c4e3a2737c72c68f
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Thu, 31 Oct 2024 01:33:49 +0100

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:
Msrc/link.zig | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git 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;