try to make everything -flto=thin compatible (librdkafka fails for some reason)

This commit is contained in:
DubbleClick
2025-07-26 21:44:01 +07:00
parent fb62a0e338
commit 978552136c
5 changed files with 36 additions and 6 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}
}