zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 39abcc303c471c0180cdb0f5dce4303bbbe45362 (tree)
parent c9e67e71c146d9a9c217d3f47e75258a1ffeedd9
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Fri,  4 Oct 2024 20:25:13 +0200

Compilation: Pass -fno-PIC to clang if PIC is disabled.

Let's not implicitly rely on whatever Clang's default is.

Diffstat:
Msrc/Compilation.zig | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Compilation.zig b/src/Compilation.zig @@ -5628,8 +5628,8 @@ pub fn addCCArgs( try argv.append("-mthumb"); } - if (target_util.supports_fpic(target) and mod.pic) { - try argv.append("-fPIC"); + if (target_util.supports_fpic(target)) { + try argv.append(if (mod.pic) "-fPIC" else "-fno-PIC"); } try argv.ensureUnusedCapacity(2);