mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 08:45:40 +08:00
disable opcache jit automatically on alpine target (only required for php < 8.5)
This commit is contained in:
@@ -8,6 +8,7 @@ use SPC\builder\Extension;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\store\SourcePatcher;
|
||||
use SPC\util\CustomExt;
|
||||
use SPC\util\SPCTarget;
|
||||
|
||||
#[CustomExt('opcache')]
|
||||
class opcache extends Extension
|
||||
@@ -46,7 +47,17 @@ class opcache extends Extension
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--enable-opcache';
|
||||
$phpVersionID = $this->builder->getPHPVersionID();
|
||||
$opcache_jit = ' --enable-opcache-jit';
|
||||
if ((SPCTarget::getTargetOS() === 'Linux' &&
|
||||
SPCTarget::getLibc() === 'musl' &&
|
||||
$this->builder->getOption('enable-zts') &&
|
||||
$phpVersionID < 80500) ||
|
||||
$this->builder->getOption('disable-opcache-jit')
|
||||
) {
|
||||
$opcache_jit = ' --disable-opcache-jit';
|
||||
}
|
||||
return '--enable-opcache' . ($shared ? '=shared' : '') . $opcache_jit;
|
||||
}
|
||||
|
||||
public function getDistName(): string
|
||||
|
||||
Reference in New Issue
Block a user