From 3a85d96fa4fc252c4a79d6f72c3db0280ff7181f Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Tue, 17 Jun 2025 18:03:27 +0700 Subject: [PATCH] yet another damn centos 7 patch --- src/SPC/builder/Extension.php | 2 +- src/SPC/builder/extension/imagick.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/SPC/builder/Extension.php b/src/SPC/builder/Extension.php index 7a68ad09..4ea135a4 100644 --- a/src/SPC/builder/Extension.php +++ b/src/SPC/builder/Extension.php @@ -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 = ''; diff --git a/src/SPC/builder/extension/imagick.php b/src/SPC/builder/extension/imagick.php index d78627ef..90af2c49 100644 --- a/src/SPC/builder/extension/imagick.php +++ b/src/SPC/builder/extension/imagick.php @@ -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]; + } }