mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 21:08:36 +00:00
zig cc: Pass -f(no-)PIE to clang.
Otherwise we rely on Clang's default which is known to not always match ours.
This commit is contained in:
parent
0ccd2b0c5c
commit
c620836945
@ -6169,6 +6169,9 @@ pub fn addCCArgs(
|
||||
}
|
||||
|
||||
if (target_util.supports_fpic(target)) {
|
||||
// PIE needs to go before PIC because Clang interprets `-fno-PIE` to imply `-fno-PIC`, which
|
||||
// we don't necessarily want.
|
||||
try argv.append(if (comp.config.pie) "-fPIE" else "-fno-PIE");
|
||||
try argv.append(if (mod.pic) "-fPIC" else "-fno-PIC");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user