diff --git a/src/SPC/builder/extension/imagick.php b/src/SPC/builder/extension/imagick.php index f9189245..6478a5b7 100644 --- a/src/SPC/builder/extension/imagick.php +++ b/src/SPC/builder/extension/imagick.php @@ -12,7 +12,7 @@ class imagick extends Extension { public function patchBeforeMake(): bool { - if (getenv('SPC_LIBC') !== 'musl') { + if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) { return false; } // imagick with calls omp_pause_all which requires -lgomp, on non-musl we build imagick without openmp diff --git a/src/SPC/builder/unix/library/imagemagick.php b/src/SPC/builder/unix/library/imagemagick.php index deb1e402..61c79e49 100644 --- a/src/SPC/builder/unix/library/imagemagick.php +++ b/src/SPC/builder/unix/library/imagemagick.php @@ -18,8 +18,11 @@ trait imagemagick */ protected function build(): void { - // TODO: glibc rh 10 toolset's libgomp.a was built without -fPIC -fPIE so we can't use openmp without depending on libgomp.so - $openmp = getenv('SPC_LIBC') === 'musl' ? '--enable-openmp' : '--disable-openmp'; + $openmp = '--enable-openmp'; + // TODO: glibc rh 10 toolset's libgomp.a was built without -fPIC so we can't use openmp without depending on libgomp.so + if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) { + $openmp = '--disable-openmp'; + } $extra = "--without-jxl --without-x {$openmp} "; $required_libs = ''; $optional_libs = [ diff --git a/src/SPC/util/SPCConfigUtil.php b/src/SPC/util/SPCConfigUtil.php index 0a059463..9f75b41f 100644 --- a/src/SPC/util/SPCConfigUtil.php +++ b/src/SPC/util/SPCConfigUtil.php @@ -144,7 +144,7 @@ class SPCConfigUtil } } // patch: imagick (imagemagick wrapper) for linux needs libgomp - if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Linux' && getenv('SPC_LIBC') === 'musl') { + if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Linux' && !(getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10'))) { $short_name[] = '-lgomp'; } return implode(' ', $short_name);