diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2024-08-27 08:03:35 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2024-08-31 03:38:06 +0200 |
| commit | f10b226c7703f08b39f21d8739768818c4d57d0e (patch) | |
| tree | 78b084ec4359568fa990c04cdd3282250349534e /src/Compilation.zig | |
| parent | e084c46ed6906dc51724d99b29f0992272384f5a (diff) | |
| download | zig-f10b226c7703f08b39f21d8739768818c4d57d0e.tar.gz zig-f10b226c7703f08b39f21d8739768818c4d57d0e.zip | |
Compilation: Pass -fPIC for assembly files too, not just C files.
There are targets (e.g. MIPS) where PIC actually affects assembler behavior.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 3d40957a72..4d4f1527a2 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -5636,10 +5636,6 @@ pub fn addCCArgs( try argv.append("-Werror=date-time"); } - if (target_util.supports_fpic(target) and mod.pic) { - try argv.append("-fPIC"); - } - if (mod.unwind_tables) { try argv.append("-funwind-tables"); } else { @@ -5730,6 +5726,10 @@ pub fn addCCArgs( }, } + if (target_util.supports_fpic(target) and mod.pic) { + try argv.append("-fPIC"); + } + try argv.ensureUnusedCapacity(2); switch (comp.config.debug_format) { .strip => {}, |
