diff options
Diffstat (limited to 'src/target.zig')
| -rw-r--r-- | src/target.zig | 45 |
1 files changed, 12 insertions, 33 deletions
diff --git a/src/target.zig b/src/target.zig index 7d30781f43..8e0b90cd82 100644 --- a/src/target.zig +++ b/src/target.zig @@ -1,4 +1,6 @@ const std = @import("std"); +const assert = std.debug.assert; + const Type = @import("Type.zig"); const AddressSpace = std.builtin.AddressSpace; const Alignment = @import("InternPool.zig").Alignment; @@ -284,40 +286,17 @@ pub fn hasRedZone(target: std.Target) bool { pub fn libcFullLinkFlags(target: std.Target) []const []const u8 { // The linking order of these is significant and should match the order other // c compilers such as gcc or clang use. - return switch (target.os.tag) { - .netbsd, .openbsd => &[_][]const u8{ - "-lm", - "-lpthread", - "-lc", - "-lutil", - }, - .solaris, .illumos => &[_][]const u8{ - "-lm", - "-lsocket", - "-lnsl", - // Solaris releases after 10 merged the threading libraries into libc. - "-lc", - }, - .haiku => &[_][]const u8{ - "-lm", - "-lroot", - "-lpthread", - "-lc", - "-lnetwork", - }, - else => if (target.isAndroid() or target.abi.isOpenHarmony()) &[_][]const u8{ - "-lm", - "-lc", - "-ldl", - } else &[_][]const u8{ - "-lm", - "-lpthread", - "-lc", - "-ldl", - "-lrt", - "-lutil", - }, + const result: []const []const u8 = switch (target.os.tag) { + .netbsd, .openbsd => &.{ "-lm", "-lpthread", "-lc", "-lutil" }, + // Solaris releases after 10 merged the threading libraries into libc. + .solaris, .illumos => &.{ "-lm", "-lsocket", "-lnsl", "-lc" }, + .haiku => &.{ "-lm", "-lroot", "-lpthread", "-lc", "-lnetwork" }, + else => if (target.isAndroid() or target.abi.isOpenHarmony()) + &.{ "-lm", "-lc", "-ldl" } + else + &.{ "-lm", "-lpthread", "-lc", "-ldl", "-lrt", "-lutil" }, }; + return result; } pub fn clangMightShellOutForAssembly(target: std.Target) bool { |
