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:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user