authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-04 10:35:04+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-04 10:35:04+02:00
logc8b92f3a8ed740148c225608b6504fb8461249bc
tree2d80f5aeaa53bcc19581a086da0ae10a55afc6e4
parentc6208369458208f097b8ce1ad1bb6c2bf40f211d
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

zig cc: Pass -f(no-)(PIC,PIE) to Clang for *-(windows,uefi)-(gnu,cygnus).

The previous supports_fpic() check was too broad.

1 files changed, 6 insertions(+), 1 deletions(-)

src/target.zig+6-1
...@@ -60,7 +60,12 @@ pub fn picLevel(target: std.Target) u32 {...@@ -60,7 +60,12 @@ pub fn picLevel(target: std.Target) u32 {
60/// This is not whether the target supports Position Independent Code, but whether the -fPIC60/// This is not whether the target supports Position Independent Code, but whether the -fPIC
61/// C compiler argument is valid to Clang.61/// C compiler argument is valid to Clang.
62pub fn supports_fpic(target: std.Target) bool {62pub fn supports_fpic(target: std.Target) bool {
63 return target.os.tag != .windows and target.os.tag != .uefi;63 return switch (target.os.tag) {
64 .windows,
65 .uefi,
66 => target.abi == .gnu or target.abi == .cygnus,
67 else => true,
68 };
64}69}
6570
66pub fn alwaysSingleThreaded(target: std.Target) bool {71pub fn alwaysSingleThreaded(target: std.Target) bool {