mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
fix: Postgres build with ancient libc
This commit is contained in:
parent
b89ff3c083
commit
6b67cb90fc
@ -4,29 +4,14 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace SPC\builder\unix\library;
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
use SPC\exception\FileSystemException;
|
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\PkgConfigUtil;
|
use SPC\util\PkgConfigUtil;
|
||||||
use SPC\util\SPCConfigUtil;
|
use SPC\util\SPCConfigUtil;
|
||||||
use SPC\util\SPCTarget;
|
|
||||||
|
|
||||||
trait postgresql
|
trait postgresql
|
||||||
{
|
{
|
||||||
public function patchBeforeBuild(): bool
|
public function patchBeforeBuild(): bool
|
||||||
{
|
{
|
||||||
// fix aarch64 build on glibc 2.17 (e.g. CentOS 7)
|
|
||||||
if (SPCTarget::getLibcVersion() === '2.17' && GNU_ARCH === 'aarch64') {
|
|
||||||
try {
|
|
||||||
FileSystem::replaceFileStr("{$this->source_dir}/src/port/pg_popcount_aarch64.c", 'HWCAP_SVE', '0');
|
|
||||||
FileSystem::replaceFileStr(
|
|
||||||
"{$this->source_dir}/src/port/pg_crc32c_armv8_choose.c",
|
|
||||||
'#if defined(__linux__) && !defined(__aarch64__) && !defined(HWCAP2_CRC32)',
|
|
||||||
'#if defined(__linux__) && !defined(HWCAP_CRC32)'
|
|
||||||
);
|
|
||||||
} catch (FileSystemException) {
|
|
||||||
// allow file not-existence to make it compatible with old and new version
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// skip the test on platforms where libpq infrastructure may be provided by statically-linked libraries
|
// skip the test on platforms where libpq infrastructure may be provided by statically-linked libraries
|
||||||
FileSystem::replaceFileStr("{$this->source_dir}/src/interfaces/libpq/Makefile", 'invokes exit\'; exit 1;', 'invokes exit\';');
|
FileSystem::replaceFileStr("{$this->source_dir}/src/interfaces/libpq/Makefile", 'invokes exit\'; exit 1;', 'invokes exit\';');
|
||||||
// disable shared libs build
|
// disable shared libs build
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user