commit c699bb81347dc0c9371c7c6c2cddab457cbe02ba (tree)
parent 909159ad8ea9203297c0b670446381c537554525
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Fri, 23 Jan 2026 19:45:39 +0100
zig cc: don't bother passing -fPIC to Clang for Windows and UEFI targets
It's completely ignored anyway, by design, for compatibility reasons.
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/target.zig b/src/target.zig
@@ -79,9 +79,7 @@ pub fn picLevel(target: *const std.Target) u32 {
/// C compiler argument is valid to Clang.
pub fn supports_fpic(target: *const std.Target) bool {
return switch (target.os.tag) {
- .windows,
- .uefi,
- => target.abi == .gnu,
+ .windows, .uefi => false, // Technically allowed for `Abi.gnu`, but completely ignored by Clang (by design) anyway.
else => true,
};
}