Support -fPIC and -fPIE for most libs and PHP

This commit is contained in:
crazywhalecc
2025-03-10 00:39:20 +08:00
parent 4eeb48cdc2
commit 2a9cd436b6
37 changed files with 96 additions and 74 deletions

View File

@@ -102,7 +102,11 @@ trait UnixLibraryTrait
public function getLibExtraCFlags(): string
{
return getenv($this->getSnakeCaseName() . '_CFLAGS') ?: '';
$env = getenv($this->getSnakeCaseName() . '_CFLAGS') ?: '';
if (!str_contains($env, $this->builder->arch_c_flags)) {
$env .= $this->builder->arch_c_flags;
}
return $env;
}
public function getLibExtraLdFlags(): string