mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 00:05:42 +08:00
try to make everything -flto=thin compatible (librdkafka fails for some reason)
This commit is contained in:
@@ -92,7 +92,7 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
'CFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS'),
|
||||
'CPPFLAGS' => '-I' . BUILD_INCLUDE_PATH,
|
||||
'LDFLAGS' => '-L' . BUILD_LIB_PATH,
|
||||
'LIBS' => SPCTarget::getRuntimeLibs(), // do not pass static libraries here yet, they may contain polyfills for libc functions!
|
||||
//'LIBS' => SPCTarget::getRuntimeLibs(), // do not pass static libraries here yet, they may contain polyfills for libc functions!
|
||||
]);
|
||||
|
||||
$embed_type = getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') ?: 'static';
|
||||
@@ -103,7 +103,7 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
);
|
||||
}
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec(
|
||||
->exec($php_configure_env . ' ' .
|
||||
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
|
||||
($enableCli ? '--enable-cli ' : '--disable-cli ') .
|
||||
($enableFpm ? '--enable-fpm ' . ($this->getLib('libacl') !== null ? '--with-fpm-acl ' : '') : '--disable-fpm ') .
|
||||
@@ -115,8 +115,8 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
$json_74 .
|
||||
$zts .
|
||||
$maxExecutionTimers .
|
||||
$this->makeStaticExtensionArgs() .
|
||||
' ' . $php_configure_env . ' '
|
||||
$this->makeStaticExtensionArgs() . ' '
|
||||
//'ac_cv_lib_readline_rl_pending_input=yes'
|
||||
);
|
||||
|
||||
$this->emitPatchPoint('before-php-make');
|
||||
|
||||
@@ -17,6 +17,14 @@ trait librdkafka
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
$cflags = $this->builder->arch_c_flags;
|
||||
$cxxflags = $this->builder->arch_cxx_flags;
|
||||
$patched_cflags = preg_replace('/\s*-flto(=\S*)?\s*/', ' ', $cflags);
|
||||
$patched_cxxflags = preg_replace('/\s*-flto(=\S*)?\s*/', ' ', $cxxflags);
|
||||
|
||||
$this->builder->arch_c_flags = $patched_cflags;
|
||||
$this->builder->arch_cxx_flags = $patched_cxxflags;
|
||||
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/lds-gen.py',
|
||||
"funcs.append('rd_ut_coverage_check')",
|
||||
@@ -56,5 +64,8 @@ trait librdkafka
|
||||
->exec("rm -rf {$this->getLibDir()}/*.so.*")
|
||||
->exec("rm -rf {$this->getLibDir()}/*.so")
|
||||
->exec("rm -rf {$this->getLibDir()}/*.dylib");
|
||||
|
||||
$this->builder->arch_c_flags = $cflags;
|
||||
$this->builder->arch_cxx_flags = $cxxflags;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,14 @@ trait unixodbc
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
$cflags = $this->builder->arch_c_flags;
|
||||
$cxxflags = $this->builder->arch_cxx_flags;
|
||||
$patched_cflags = preg_replace('/\s*-flto(=\S*)?\s*/', ' ', $cflags);
|
||||
$patched_cxxflags = preg_replace('/\s*-flto(=\S*)?\s*/', ' ', $cxxflags);
|
||||
|
||||
$this->builder->arch_c_flags = $patched_cflags;
|
||||
$this->builder->arch_cxx_flags = $patched_cxxflags;
|
||||
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->configure(
|
||||
'--disable-debug',
|
||||
@@ -27,5 +35,8 @@ trait unixodbc
|
||||
->make();
|
||||
$this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']);
|
||||
$this->patchLaDependencyPrefix();
|
||||
|
||||
$this->builder->arch_c_flags = $cflags;
|
||||
$this->builder->arch_cxx_flags = $cxxflags;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user