add --disable-opcache-jit option for alpine

This commit is contained in:
DubbleClick
2023-10-16 14:05:07 +02:00
parent c9b544f8c4
commit 830f379bf6
2 changed files with 7 additions and 15 deletions

View File

@@ -140,19 +140,8 @@ class LinuxBuilder extends BuilderBase
$cflags = $this->arch_c_flags; $cflags = $this->arch_c_flags;
$use_lld = ''; $use_lld = '';
if (str_ends_with($this->getOption('cc'), 'clang') && SystemUtil::findCommand('lld')) {
switch ($this->libc) { $use_lld = '-Xcompiler -fuse-ld=lld';
case 'musl_wrapper':
case 'glibc':
$cflags .= ' -static-libgcc -I"' . BUILD_INCLUDE_PATH . '"';
break;
case 'musl':
if (str_ends_with($this->getOption('cc'), 'clang') && SystemUtil::findCommand('lld')) {
$use_lld = '-Xcompiler -fuse-ld=lld';
}
break;
default:
throw new WrongUsageException('libc ' . $this->libc . ' is not implemented yet');
} }
$envs = $this->pkgconf_env . ' ' . SystemUtil::makeEnvVarString([ $envs = $this->pkgconf_env . ' ' . SystemUtil::makeEnvVarString([
@@ -179,6 +168,7 @@ class LinuxBuilder extends BuilderBase
$maxExecutionTimers = ''; $maxExecutionTimers = '';
$zts = ''; $zts = '';
} }
$disable_jit = $this->getOption('disable-opcache-jit', false) ? '--disable-opcache-jit ' : '';
$enableCli = ($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI; $enableCli = ($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI;
$enableFpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM; $enableFpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM;
@@ -197,11 +187,12 @@ class LinuxBuilder extends BuilderBase
'--disable-phpdbg ' . '--disable-phpdbg ' .
($enableCli ? '--enable-cli ' : '--disable-cli ') . ($enableCli ? '--enable-cli ' : '--disable-cli ') .
($enableFpm ? '--enable-fpm ' : '--disable-fpm ') . ($enableFpm ? '--enable-fpm ' : '--disable-fpm ') .
($enableEmbed ? '--enable-embed=static --disable-opcache-jit ' : '--disable-embed ') . ($enableEmbed ? '--enable-embed=static ' : '--disable-embed ') .
($enableMicro ? '--enable-micro=all-static ' : '--disable-micro ') .
$disable_jit .
$json_74 . $json_74 .
$zts . $zts .
$maxExecutionTimers . $maxExecutionTimers .
($enableMicro ? '--enable-micro=all-static ' : '--disable-micro ') .
$this->makeExtensionArgs() . ' ' . $this->makeExtensionArgs() . ' ' .
$envs $envs
); );

View File

@@ -30,6 +30,7 @@ class BuildCliCommand extends BuildCommand
$this->addOption('build-all', null, null, 'build cli, micro, fpm, embed'); $this->addOption('build-all', null, null, 'build cli, micro, fpm, embed');
$this->addOption('no-strip', null, null, 'build without strip, in order to debug and load external extensions'); $this->addOption('no-strip', null, null, 'build without strip, in order to debug and load external extensions');
$this->addOption('enable-zts', null, null, 'enable ZTS support'); $this->addOption('enable-zts', null, null, 'enable ZTS support');
$this->addOption('disable-opcache-jit', null, null, 'disable opcache jit');
$this->addOption('with-hardcoded-ini', 'I', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Patch PHP source code, inject hardcoded INI'); $this->addOption('with-hardcoded-ini', 'I', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Patch PHP source code, inject hardcoded INI');
$this->addOption('with-micro-fake-cli', null, null, 'Enable phpmicro fake cli'); $this->addOption('with-micro-fake-cli', null, null, 'Enable phpmicro fake cli');
} }