remove leftovers

This commit is contained in:
henderkes
2026-05-05 14:51:26 +07:00
parent b4e7080b6f
commit aed01c9312
2 changed files with 3 additions and 13 deletions

View File

@@ -592,7 +592,7 @@ class Extension
* of static library flags, and the second is a space-separated string
* of shared library flags
*/
protected function splitLibsIntoStaticAndShared(string $allLibs, array $excludeFromStatic = []): array
protected function splitLibsIntoStaticAndShared(string $allLibs): array
{
$staticLibString = '';
$sharedLibString = '';
@@ -602,16 +602,6 @@ class Extension
if (str_starts_with($lib, BUILD_LIB_PATH . '/lib') && str_ends_with($lib, '.a')) {
$staticLib = $lib;
}
// Libs in $excludeFromStatic are statically linked into php-cli already and re-export their
// symbols; including them as static archives in a shared extension creates a second in-process
// copy of the same library (e.g. libssl/libcrypto), causing duplicated atexit handlers and
// shared-state corruption (NULL engine_lock at exit). Drop them here so the shared extension's
// undefined refs resolve at runtime against php-cli's exported symbols instead.
$libName = str_starts_with($lib, '-l') ? substr($lib, 2) : basename($lib, '.a');
$libName = str_starts_with($libName, 'lib') ? substr($libName, 3) : $libName;
if (in_array($libName, $excludeFromStatic, true)) {
continue;
}
if ($lib === '-lphp' || !file_exists($staticLib)) {
$sharedLibString .= " {$lib}";
} else {

View File

@@ -18,9 +18,9 @@ class imagick extends Extension
return '--with-imagick=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $disable_omp;
}
protected function splitLibsIntoStaticAndShared(string $allLibs, array $excludeFromStatic = []): array
protected function splitLibsIntoStaticAndShared(string $allLibs): array
{
[$static, $shared] = parent::splitLibsIntoStaticAndShared($allLibs, $excludeFromStatic);
[$static, $shared] = parent::splitLibsIntoStaticAndShared($allLibs);
if (ToolchainManager::getToolchainClass() !== ZigToolchain::class &&
(str_contains(getenv('PATH'), 'rh/devtoolset') || str_contains(getenv('PATH'), 'rh/gcc-toolset'))
) {