yet another damn centos 7 patch

This commit is contained in:
DubbleClick 2025-06-17 18:03:27 +07:00
parent 883cc4b6fd
commit 3a85d96fa4
2 changed files with 14 additions and 1 deletions

View File

@ -488,7 +488,7 @@ class Extension
*
* @return array [staticLibString, sharedLibString]
*/
private function getStaticAndSharedLibs(): array
protected function getStaticAndSharedLibs(): array
{
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()], with_dependencies: true);
$sharedLibString = '';

View File

@ -5,7 +5,9 @@ declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
use SPC\util\SPCConfigUtil;
#[CustomExt('imagick')]
class imagick extends Extension
@ -29,4 +31,15 @@ class imagick extends Extension
$disable_omp = !(getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) ? '' : ' ac_cv_func_omp_pause_resource_all=no';
return '--with-imagick=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $disable_omp;
}
protected function getStaticAndSharedLibs(): array
{
// on centos 7, it will use the symbol _ZTINSt6thread6_StateE, which is not defined in system libstdc++.so.6
[$static, $shared] = parent::getStaticAndSharedLibs();
if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) {
$static .= ' -lstdc++';
$shared = str_replace('-lstdc++', '', $shared);
}
return [$static, $shared];
}
}