From aed01c9312d9b85aff7c5cc731a9c06a80c96e0b Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 5 May 2026 14:51:26 +0700 Subject: [PATCH] remove leftovers --- src/SPC/builder/Extension.php | 12 +----------- src/SPC/builder/extension/imagick.php | 4 ++-- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/SPC/builder/Extension.php b/src/SPC/builder/Extension.php index 12175cee..48e0a32e 100644 --- a/src/SPC/builder/Extension.php +++ b/src/SPC/builder/Extension.php @@ -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 { diff --git a/src/SPC/builder/extension/imagick.php b/src/SPC/builder/extension/imagick.php index 0965250c..a548a8a3 100644 --- a/src/SPC/builder/extension/imagick.php +++ b/src/SPC/builder/extension/imagick.php @@ -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')) ) {