mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
remove openmp support entirely, system packages distribute it disabled, the ini disables it by default and the authors recommend disabling it. WIth a distinction between libgomp, libomp and the non-existent usable static libraries for them, it's just not worth it.
This commit is contained in:
parent
5334727528
commit
40ac705c46
@ -48,17 +48,17 @@ This extension contains an implementation of the coroutine environment for `pdo_
|
||||
|
||||
## swow
|
||||
|
||||
1. Only PHP 8.0 ~ 8.4 is supported.
|
||||
1. Only PHP 8.0+ is supported.
|
||||
|
||||
## imagick
|
||||
|
||||
1. The imagick extension currently only has openmp support on musl libc. This means that multithreading is disabled on glibc or other operating systems. The extension is still fully functional.
|
||||
1. Openmp support is disabled, this is recommended by the maintainers and also the case system packages.
|
||||
|
||||
## imap
|
||||
|
||||
1. Kerberos is not supported
|
||||
2. ext-imap is not thread safe due to the underlying c-client. It's not possible to use it in --enable-zts builds.
|
||||
3. Because the extension may be dropped from php, we recommend you look for an alternative implementation, such as [Webklex/php-imap](https://github.com/Webklex/php-imap)
|
||||
2. ext-imap is not thread safe due to the underlying c-client. It's not possible to use it in `--enable-zts` builds.
|
||||
3. The extension was dropped from php 8.4, we recommend you look for an alternative implementation, such as [Webklex/php-imap](https://github.com/Webklex/php-imap)
|
||||
|
||||
## gd
|
||||
|
||||
|
||||
@ -45,17 +45,17 @@ swoole-hook-sqlite 与 `pdo_sqlite` 扩展冲突。如需使用 Swoole 和 `pdo_
|
||||
|
||||
## swow
|
||||
|
||||
1. swow 仅支持 PHP 8.0 ~ 8.4 版本。
|
||||
1. swow 仅支持 PHP 8.0+ 版本。
|
||||
|
||||
## imagick
|
||||
|
||||
imagick 扩展目前仅在 musl libc 上支持 OpenMP(libgomp)。使用 glibc 方式构建的 imagick 扩展无法支持多线程特性。
|
||||
1. OpenMP 支持已被禁用,这是维护者推荐的做法,系统软件包也是如此配置。
|
||||
|
||||
## imap
|
||||
|
||||
1. 该扩展目前不支持 Kerberos。
|
||||
2. 由于底层的 c-client、ext-imap 不是线程安全的。 无法在 `--enable-zts` 构建中使用它。
|
||||
3. 由于该扩展可能会从未来的 PHP 中删除,因此我们建议您寻找替代实现,例如 [Webklex/php-imap](https://github.com/Webklex/php-imap)。
|
||||
3. 该扩展已在 PHP 8.4 中被移除,因此我们建议您寻找替代实现,例如 [Webklex/php-imap](https://github.com/Webklex/php-imap)。
|
||||
|
||||
## gd
|
||||
|
||||
|
||||
@ -10,31 +10,16 @@ use SPC\util\CustomExt;
|
||||
#[CustomExt('imagick')]
|
||||
class imagick extends Extension
|
||||
{
|
||||
public function patchBeforeMake(): bool
|
||||
{
|
||||
if (PHP_OS_FAMILY !== 'Linux') {
|
||||
return false;
|
||||
}
|
||||
if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) {
|
||||
return false;
|
||||
}
|
||||
// imagick with calls omp_pause_all, which requires openmp, on non-musl we build imagick without openmp
|
||||
$extra_libs = trim(getenv('SPC_EXTRA_LIBS') . ' -lomp');
|
||||
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$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;
|
||||
return '--with-imagick=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . ' ac_cv_func_omp_pause_resource_all=no';
|
||||
}
|
||||
|
||||
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')) {
|
||||
if (str_contains(getenv('CC'), 'devtoolset-10')) {
|
||||
$static .= ' -lstdc++';
|
||||
$shared = str_replace('-lstdc++', '', $shared);
|
||||
}
|
||||
|
||||
@ -32,8 +32,7 @@ trait imagemagick
|
||||
->optionalLib('freetype', ...ac_with_args('freetype'))
|
||||
->optionalLib('bzip2', ...ac_with_args('bzlib'))
|
||||
->addConfigureArgs(
|
||||
// TODO: glibc rh 10 toolset's libgomp.a was built without -fPIC so we can't use openmp without depending on libgomp.so
|
||||
getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10') ? '--disable-openmp' : '--enable-openmp',
|
||||
'--disable-openmp',
|
||||
'--without-jxl',
|
||||
'--without-x',
|
||||
);
|
||||
|
||||
@ -149,10 +149,6 @@ class SPCConfigUtil
|
||||
}
|
||||
}
|
||||
}
|
||||
// patch: imagick (imagemagick wrapper) for linux needs libgomp
|
||||
if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Linux' && !(getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10'))) {
|
||||
$short_name[] = '-lomp';
|
||||
}
|
||||
return implode(' ', $short_name);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user