mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-03 23:05:41 +08:00
remove leftovers
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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'))
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user