diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2024-10-04 20:25:13 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2024-11-03 09:29:33 +0100 |
| commit | 39abcc303c471c0180cdb0f5dce4303bbbe45362 (patch) | |
| tree | a050d71f2413d81b18c609052b676a01f2395acb /src | |
| parent | c9e67e71c146d9a9c217d3f47e75258a1ffeedd9 (diff) | |
| download | zig-39abcc303c471c0180cdb0f5dce4303bbbe45362.tar.gz zig-39abcc303c471c0180cdb0f5dce4303bbbe45362.zip | |
Compilation: Pass -fno-PIC to clang if PIC is disabled.
Let's not implicitly rely on whatever Clang's default is.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Compilation.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 7777aa1371..7c08b74b04 100644 --- 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); |
