| author | |
| committer | |
| log | 2622575fde2b5d70926fe62ed272412d72eef7b0 |
| tree | 4949baa8e28e79b0e28349e55cfd89ca249a6d75 |
| parent | daed2ba2a01ca0d65daebf5401d99bc1f2e292fa |
Make osRequiresLibC call Os.requiresLibC, let's keep a single list of OS
that require the libc to be linked in.2 files changed, 4 insertions(+), 4 deletions(-)
lib/std/target.zig+3| ... | @@ -337,6 +337,9 @@ pub const Target = struct { | ... | @@ -337,6 +337,9 @@ pub const Target = struct { |
| 337 | }; | 337 | }; |
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | /// On Darwin, we always link libSystem which contains libc. | ||
| 341 | /// Similarly on FreeBSD and NetBSD we always link system libc | ||
| 342 | /// since this is the stable syscall interface. | ||
| 340 | pub fn requiresLibC(os: Os) bool { | 343 | pub fn requiresLibC(os: Os) bool { |
| 341 | return switch (os.tag) { | 344 | return switch (os.tag) { |
| 342 | .freebsd, | 345 | .freebsd, |
src/target.zig+1-4| ... | @@ -128,10 +128,7 @@ pub fn cannotDynamicLink(target: std.Target) bool { | ... | @@ -128,10 +128,7 @@ pub fn cannotDynamicLink(target: std.Target) bool { |
| 128 | /// Similarly on FreeBSD and NetBSD we always link system libc | 128 | /// Similarly on FreeBSD and NetBSD we always link system libc |
| 129 | /// since this is the stable syscall interface. | 129 | /// since this is the stable syscall interface. |
| 130 | pub fn osRequiresLibC(target: std.Target) bool { | 130 | pub fn osRequiresLibC(target: std.Target) bool { |
| 131 | return switch (target.os.tag) { | 131 | return target.os.requiresLibC(); |
| 132 | .freebsd, .netbsd, .dragonfly, .openbsd, .macos, .ios, .watchos, .tvos => true, | ||
| 133 | else => false, | ||
| 134 | }; | ||
| 135 | } | 132 | } |
| 136 | 133 | ||
| 137 | pub fn libcNeedsLibUnwind(target: std.Target) bool { | 134 | pub fn libcNeedsLibUnwind(target: std.Target) bool { |