diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2021-05-12 22:39:10 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-05-13 00:44:56 -0400 |
| commit | 459c9f05359e3405f39e4c954c62c61a493e49ae (patch) | |
| tree | bbb88d1dd59b9699f1f58f948412fc63f694695e /src/target.zig | |
| parent | 799d1f0d36f69c8aead5184a76f87b557d690d7b (diff) | |
| download | zig-459c9f05359e3405f39e4c954c62c61a493e49ae.tar.gz zig-459c9f05359e3405f39e4c954c62c61a493e49ae.zip | |
stage2: fix build on OpenBSD/NetBSD
Apparently these systems do not provide libdl or librt.
Diffstat (limited to 'src/target.zig')
| -rw-r--r-- | src/target.zig | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/target.zig b/src/target.zig index 1e31f99dc1..c2018db012 100644 --- a/src/target.zig +++ b/src/target.zig @@ -374,3 +374,24 @@ pub fn hasRedZone(target: std.Target) bool { else => false, }; } + +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", + }, + else => &[_][]const u8{ + "-lm", + "-lpthread", + "-lc", + "-ldl", + "-lrt", + "-lutil", + }, + }; +} |
