diff --git a/src/SPC/builder/extension/mongodb.php b/src/SPC/builder/extension/mongodb.php index 7ba1ea33..745417bb 100644 --- a/src/SPC/builder/extension/mongodb.php +++ b/src/SPC/builder/extension/mongodb.php @@ -12,9 +12,9 @@ class mongodb extends Extension { public function getUnixConfigureArg(bool $shared = false): string { - $arg = ' --enable-mongodb '; + $arg = ' --enable-mongodb' . ($shared ? '=shared' : '') . ' '; $arg .= ' --with-mongodb-system-libs=no --with-mongodb-client-side-encryption=no '; - $arg .= ' --with-mongodb-sasl=no '; + $arg .= ' --with-mongodb-sasl=no '; if ($this->builder->getLib('openssl')) { $arg .= '--with-mongodb-ssl=openssl'; } @@ -22,6 +22,6 @@ class mongodb extends Extension $arg .= $this->builder->getLib('zstd') ? ' --with-mongodb-zstd=yes ' : ' --with-mongodb-zstd=no '; // $arg .= $this->builder->getLib('snappy') ? ' --with-mongodb-snappy=yes ' : ' --with-mongodb-snappy=no '; $arg .= $this->builder->getLib('zlib') ? ' --with-mongodb-zlib=yes ' : ' --with-mongodb-zlib=bundled '; - return $arg; + return clean_spaces($arg); } } diff --git a/src/SPC/builder/extension/opcache.php b/src/SPC/builder/extension/opcache.php index 58139dd1..1d1267ec 100644 --- a/src/SPC/builder/extension/opcache.php +++ b/src/SPC/builder/extension/opcache.php @@ -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 diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index e7736852..373e1b21 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -64,10 +64,7 @@ class LinuxBuilder extends UnixBuilderBase // if opcache_jit is enabled for 8.5 or opcache enabled, // we need to disable undefined behavior sanitizer. f_putenv('SPC_COMPILER_EXTRA=-fno-sanitize=undefined'); - } elseif ($opcache_jit) { - $opcache_jit = false; } - $opcache_jit_arg = $opcache_jit ? '--enable-opcache-jit ' : '--disable-opcache-jit '; if ($this->getOption('enable-zts', false)) { $maxExecutionTimers = $phpVersionID >= 80100 ? '--enable-zend-max-execution-timers ' : ''; @@ -115,7 +112,6 @@ class LinuxBuilder extends UnixBuilderBase ($enableMicro ? '--enable-micro=all-static ' : '--disable-micro ') . $config_file_path . $config_file_scan_dir . - $opcache_jit_arg . $json_74 . $zts . $maxExecutionTimers . diff --git a/src/SPC/builder/macos/MacOSBuilder.php b/src/SPC/builder/macos/MacOSBuilder.php index 851d7de4..00c1da8c 100644 --- a/src/SPC/builder/macos/MacOSBuilder.php +++ b/src/SPC/builder/macos/MacOSBuilder.php @@ -90,13 +90,6 @@ class MacOSBuilder extends UnixBuilderBase $json_74 = $phpVersionID < 80000 ? '--enable-json ' : ''; $zts = $this->getOption('enable-zts', false) ? '--enable-zts --disable-zend-signals ' : ''; - $opcache_jit = !$this->getOption('disable-opcache-jit', false); - // disable opcache jit for PHP < 8.5.0 when opcache is not enabled - if ($opcache_jit && $phpVersionID < 80500 && !$this->getExt('opcache')) { - $opcache_jit = false; - } - $opcache_jit_arg = $opcache_jit ? '--enable-opcache-jit ' : '--disable-opcache-jit '; - $config_file_path = $this->getOption('with-config-file-path', false) ? ('--with-config-file-path=' . $this->getOption('with-config-file-path') . ' ') : ''; $config_file_scan_dir = $this->getOption('with-config-file-scan-dir', false) ? @@ -131,7 +124,6 @@ class MacOSBuilder extends UnixBuilderBase ($enableFpm ? '--enable-fpm ' : '--disable-fpm ') . ($enableEmbed ? "--enable-embed={$embed_type} " : '--disable-embed ') . ($enableMicro ? '--enable-micro ' : '--disable-micro ') . - $opcache_jit_arg . $config_file_path . $config_file_scan_dir . $json_74 .