From 7cb86da49d31d6f455415976e1f449fea7f25baa Mon Sep 17 00:00:00 2001 From: Wenlong Zhang Date: Mon, 30 Oct 2023 06:26:18 +0000 Subject: [PATCH] fix build error for loongarch64 --- 0001-disable-spinlocks-for-loongarch64.patch | 29 +++++++++++--------- polardb.spec | 7 +++-- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/0001-disable-spinlocks-for-loongarch64.patch b/0001-disable-spinlocks-for-loongarch64.patch index b41f650..bbd0e7f 100644 --- a/0001-disable-spinlocks-for-loongarch64.patch +++ b/0001-disable-spinlocks-for-loongarch64.patch @@ -1,25 +1,28 @@ -From 2a146da0f04bad53c42076f814fd1ef9ad40872c Mon Sep 17 00:00:00 2001 +From d2d65034774ff9abde70b6c696e68be4d048eb01 Mon Sep 17 00:00:00 2001 From: Wenlong Zhang -Date: Mon, 25 Sep 2023 11:15:11 +0800 +Date: Mon, 30 Oct 2023 03:33:13 +0000 Subject: [PATCH] disable spinlocks for loongarch64 --- - polardb_build.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + polardb_build.sh | 5 +++++ + 1 file changed, 5 insertions(+) diff --git a/polardb_build.sh b/polardb_build.sh -index 8344b40..58fe888 100755 +index 58fe888..6cfb51f 100755 --- a/polardb_build.sh +++ b/polardb_build.sh -@@ -527,7 +527,7 @@ export PATH=$pg_bld_basedir/bin:$PATH - #################### PHASE 3: compile and install ################### - if [[ $nocompile == "off" ]]; - then -- ./configure --prefix=$pg_bld_basedir --with-pgport=$pg_bld_port $common_configure_flag $configure_flag -+ ./configure --prefix=$pg_bld_basedir --with-pgport=$pg_bld_port $common_configure_flag $configure_flag --disable-spinlocks +@@ -510,6 +510,11 @@ then + configure_flag+=" --with-dma" + fi - for target in . contrib external - do ++if [[ `uname -m` == "loongarch64" ]] ++then ++ configure_flag+=" --disable-spinlocks" ++fi ++ + # setup env + export CFLAGS=" $gcc_opt_level_flag" + export CXXFLAGS="$gcc_opt_level_flag" -- 2.40.1 diff --git a/polardb.spec b/polardb.spec index c248643..230935c 100644 --- a/polardb.spec +++ b/polardb.spec @@ -1,4 +1,4 @@ -%define anolis_release 3 +%define anolis_release 4 %global debug_package %{nil} %global _privatelibs lib(.*).so* %global __provides_exclude ^(%{_privatelibs})$ @@ -10,9 +10,7 @@ Summary: An open-source database system based on PostgreSQL. License: Apache License Url: https://github.com/ApsaraDB/PolarDB-for-PostgreSQL Source0: https://github.com/ApsaraDB/PolarDB-for-PostgreSQL/archive/refs/tags/v%{version}.tar.gz -%ifarch loongarch64 Patch001: 0001-disable-spinlocks-for-loongarch64.patch -%endif BuildRequires: libzstd-devel openssl-devel protobuf-devel readline-devel libxml2-devel libxslt-devel zlib-devel bzip2-devel lz4-devel snappy-devel BuildRequires: libzstd zstd cmake perl bison flex @@ -52,6 +50,9 @@ mkdir -p %{buildroot}/%{_prefix} %{_datadir}/* %changelog +* Mon Oct 30 2023 Wenlong Zhang - 11.9.20.0-4 +- fix build error for loongarch64 + * Thu Oct 26 2023 Wenlong Zhang - 11.9.20.0-3 - fix build error for loongarch64 -- Gitee