Compilation: Pass -fno-PIC to clang if PIC is disabled.

Let's not implicitly rely on whatever Clang's default is.
This commit is contained in:
Alex Rønne Petersen
2024-10-04 20:25:13 +02:00
parent c9e67e71c1
commit 39abcc303c

View File

@@ -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);