Skip to content

Commit 6b67cb9

Browse files
committed
fix: Postgres build with ancient libc
1 parent b89ff3c commit 6b67cb9

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/SPC/builder/unix/library/postgresql.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,14 @@
44

55
namespace SPC\builder\unix\library;
66

7-
use SPC\exception\FileSystemException;
87
use SPC\store\FileSystem;
98
use SPC\util\PkgConfigUtil;
109
use SPC\util\SPCConfigUtil;
11-
use SPC\util\SPCTarget;
1210

1311
trait postgresql
1412
{
1513
public function patchBeforeBuild(): bool
1614
{
17-
// fix aarch64 build on glibc 2.17 (e.g. CentOS 7)
18-
if (SPCTarget::getLibcVersion() === '2.17' && GNU_ARCH === 'aarch64') {
19-
try {
20-
FileSystem::replaceFileStr("{$this->source_dir}/src/port/pg_popcount_aarch64.c", 'HWCAP_SVE', '0');
21-
FileSystem::replaceFileStr(
22-
"{$this->source_dir}/src/port/pg_crc32c_armv8_choose.c",
23-
'#if defined(__linux__) && !defined(__aarch64__) && !defined(HWCAP2_CRC32)',
24-
'#if defined(__linux__) && !defined(HWCAP_CRC32)'
25-
);
26-
} catch (FileSystemException) {
27-
// allow file not-existence to make it compatible with old and new version
28-
}
29-
}
3015
// skip the test on platforms where libpq infrastructure may be provided by statically-linked libraries
3116
FileSystem::replaceFileStr("{$this->source_dir}/src/interfaces/libpq/Makefile", 'invokes exit\'; exit 1;', 'invokes exit\';');
3217
// disable shared libs build

0 commit comments

Comments
 (0)