authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-27 08:03:35+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-31 03:38:06+02:00
logf10b226c7703f08b39f21d8739768818c4d57d0e
tree78b084ec4359568fa990c04cdd3282250349534e
parente084c46ed6906dc51724d99b29f0992272384f5a
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

Compilation: Pass -fPIC for assembly files too, not just C files.

There are targets (e.g. MIPS) where PIC actually affects assembler behavior.

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

src/Compilation.zig+4-4
...@@ -5636,10 +5636,6 @@ pub fn addCCArgs(...@@ -5636,10 +5636,6 @@ pub fn addCCArgs(
5636 try argv.append("-Werror=date-time");5636 try argv.append("-Werror=date-time");
5637 }5637 }
56385638
5639 if (target_util.supports_fpic(target) and mod.pic) {
5640 try argv.append("-fPIC");
5641 }
5642
5643 if (mod.unwind_tables) {5639 if (mod.unwind_tables) {
5644 try argv.append("-funwind-tables");5640 try argv.append("-funwind-tables");
5645 } else {5641 } else {
...@@ -5730,6 +5726,10 @@ pub fn addCCArgs(...@@ -5730,6 +5726,10 @@ pub fn addCCArgs(
5730 },5726 },
5731 }5727 }
57325728
5729 if (target_util.supports_fpic(target) and mod.pic) {
5730 try argv.append("-fPIC");
5731 }
5732
5733 try argv.ensureUnusedCapacity(2);5733 try argv.ensureUnusedCapacity(2);
5734 switch (comp.config.debug_format) {5734 switch (comp.config.debug_format) {
5735 .strip => {},5735 .strip => {},