From 94f0b32d50bae136df948a244976a37b3e0682c6 Mon Sep 17 00:00:00 2001 From: ut004615 Date: Wed, 19 Jul 2023 14:48:53 +0800 Subject: [PATCH] Add sw_64 support --- 0001-Add-sw_64-support.patch | 166 +++++++++++++++++++++++++++++++++++ firebird.spec | 10 ++- 2 files changed, 173 insertions(+), 3 deletions(-) create mode 100644 0001-Add-sw_64-support.patch diff --git a/0001-Add-sw_64-support.patch b/0001-Add-sw_64-support.patch new file mode 100644 index 0000000..2469094 --- /dev/null +++ b/0001-Add-sw_64-support.patch @@ -0,0 +1,166 @@ +From 76b1f89c29904a6f7b2c138d2a98d752f6649fea Mon Sep 17 00:00:00 2001 +From: konglidong +Date: Wed, 19 Jul 2023 11:38:14 +0800 +Subject: [PATCH] Add sw_64 support + +--- + builds/posix/prefix.linux_sw_64 | 7 +++++++ + configure.ac | 13 ++++++++++++ + extern/editline/config.guess | 3 +++ + extern/editline/config.sub | 1 + + src/common/classes/DbImplementation.cpp | 28 +++++++++++++------------ + src/common/common.h | 4 ++++ + src/jrd/inf_pub.h | 1 + + 7 files changed, 44 insertions(+), 13 deletions(-) + create mode 100644 builds/posix/prefix.linux_sw_64 + +diff --git a/builds/posix/prefix.linux_sw_64 b/builds/posix/prefix.linux_sw_64 +new file mode 100644 +index 0000000..a7cb6c6 +--- /dev/null ++++ b/builds/posix/prefix.linux_sw_64 +@@ -0,0 +1,7 @@ ++#LD=@CXX@ ++ ++#PROD_FLAGS=-ggdb -O3 -fno-omit-frame-pointer -DLINUX -pipe -MMD -fPIC ++#DEV_FLAGS=-ggdb -DLINUX -DDEBUG_GDS_ALLOC -pipe -MMD -p -fPIC -Werror=delete-incomplete -Wall -Wno-switch ++ ++PROD_FLAGS=-O3 -DLINUX -Dsw_64 -pipe -p -MMD -fPIC -fsigned-char -fmessage-length=0 -std=gnu++03 -fno-delete-null-pointer-checks ++DEV_FLAGS=-ggdb -DLINUX -Dsw_64 -pipe -p -MMD -fPIC -Werror=delete-incomplete -Wall -fsigned-char -fmessage-length=0 -Wno-non-virtual-dtor +diff --git a/configure.ac b/configure.ac +index 31924ea..6cc0072 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -325,6 +325,19 @@ dnl CPU_TYPE=ppc64 + SHRLIB_EXT=so + ;; + ++ sw_64*-*-linux*) ++ MAKEFILE_PREFIX=linux_sw_64 ++ INSTALL_PREFIX=linux ++ PLATFORM=LINUX ++ AC_DEFINE(LINUX, 1, [Define this if OS is Linux]) ++ EDITLINE_FLG=Y ++ SHRLIB_EXT=so ++ STD_EDITLINE=true ++ STD_ICU=true ++ libdir=/usr/lib64 ++ CPU_TYPE=sw_64 ++ ;; ++ + s390x-*-linux*) + MAKEFILE_PREFIX=linux_s390x + INSTALL_PREFIX=linux +diff --git a/extern/editline/config.guess b/extern/editline/config.guess +index 9afd676..0d9db4f 100755 +--- a/extern/editline/config.guess ++++ b/extern/editline/config.guess +@@ -1001,6 +1001,9 @@ EOF + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; ++ sw_64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; +diff --git a/extern/editline/config.sub b/extern/editline/config.sub +index 61cb4bc..d19648f 100755 +--- a/extern/editline/config.sub ++++ b/extern/editline/config.sub +@@ -302,6 +302,7 @@ case $basic_machine in + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ ++ | sw_64 \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ +diff --git a/src/common/classes/DbImplementation.cpp b/src/common/classes/DbImplementation.cpp +index 0315ea9..a5a9e23 100644 +--- a/src/common/classes/DbImplementation.cpp ++++ b/src/common/classes/DbImplementation.cpp +@@ -51,6 +51,7 @@ static const UCHAR CpuPowerPc64el = 16; + static const UCHAR CpuM68k = 17; + static const UCHAR CpuRiscV64 = 18; + static const UCHAR CpuLoongArch64 = 19; ++static const UCHAR CpuSw_64 = 20; + + static const UCHAR OsWindows = 0; + static const UCHAR OsLinux = 1; +@@ -93,7 +94,8 @@ const char* hardware[] = { + "PowerPC64el", + "M68k", + "RiscV64", +- "LoongArch64" ++ "LoongArch64", ++ "Sw_64" + }; + + const char* operatingSystem[] = { +@@ -120,22 +122,22 @@ const char* compiler[] = { + // This table lists pre-fb3 implementation codes + const UCHAR backwardTable[FB_NELEM(hardware) * FB_NELEM(operatingSystem)] = + { +-// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PowerPC64el RiscV64 LoongArch64 +-/* Windows */ 50, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +-/* Linux */ 60, 66, 65, 69, 86, 71, 72, 75, 76, 79, 78, 80, 81, 82, 83, 84, 85, 88, +-/* Darwin */ 70, 73, 0, 63, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +-/* Solaris */ 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +-/* HPUX */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, +-/* AIX */ 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +-/* MVS */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +-/* FreeBSD */ 61, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +-/* NetBSD */ 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ++// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PowerPC64el RiscV64 LoongArch64 Sw_64 ++/* Windows */ 50, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++/* Linux */ 60, 66, 65, 69, 86, 71, 72, 75, 76, 79, 78, 80, 81, 82, 83, 84, 85, 88, 90, ++/* Darwin */ 70, 73, 0, 63, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++/* Solaris */ 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++/* HPUX */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, ++/* AIX */ 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++/* MVS */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++/* FreeBSD */ 61, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++/* NetBSD */ 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + + const UCHAR backEndianess[FB_NELEM(hardware)] = + { +-// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PowerPC64el M68k RiscV64 LoongArch64 +- 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, ++// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PowerPC64el M68k RiscV64 LoongArch64 Sw_64 ++ 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, + }; + + } // anonymous namespace +diff --git a/src/common/common.h b/src/common/common.h +index 0fe7421..dda3c17 100644 +--- a/src/common/common.h ++++ b/src/common/common.h +@@ -167,6 +167,10 @@ + #define USE_POSIX_THREADS + #endif + ++#ifdef sw_64 ++#define FB_CPU CpuSw_64 ++#endif /* sw_64 */ ++ + #ifdef __s390__ + #ifdef __s390x__ + #define FB_CPU CpuS390x +diff --git a/src/jrd/inf_pub.h b/src/jrd/inf_pub.h +index 5ca75ea..cfbd14f 100644 +--- a/src/jrd/inf_pub.h ++++ b/src/jrd/inf_pub.h +@@ -247,6 +247,7 @@ enum info_db_implementations + isc_info_db_impl_linux_m68k = 87, + isc_info_db_impl_linux_riscv64 = 88, + isc_info_db_impl_linux_loongarch64 = 89, ++ isc_info_db_impl_linux_sw_64 = 90, + + isc_info_db_impl_last_value // Leave this LAST! + }; +-- +2.33.0 + diff --git a/firebird.spec b/firebird.spec index 8bac760..c6556d9 100644 --- a/firebird.spec +++ b/firebird.spec @@ -1,6 +1,6 @@ Name: firebird Version: 3.0.3.32900 -Release: 11 +Release: 12 Summary: SQL relational database management system License: Interbase URL: http://www.firebirdsql.org/ @@ -19,8 +19,9 @@ Patch0005: cloop-honour-build-flags.patch Patch0006: a4cb621bf55ef2101e22b1e7da5c458a1e0cc2ab.patch Patch0007: 0001-Port-to-RISC-V-64-bit-riscv64.patch Patch0008: fix-failed-to-parse-pid-from-pid-file.patch -Patch0010: 0001-add-loongarch64-support-for-Firebird.patch -Patch0011: 0002-Modify-PROD_FLAGS-and-DEV_FLAGS-parameters-for-loongarch64.patch +Patch0010: 0001-add-loongarch64-support-for-Firebird.patch +Patch0011: 0002-Modify-PROD_FLAGS-and-DEV_FLAGS-parameters-for-loongarch64.patch +Patch0012: 0001-Add-sw_64-support.patch BuildRequires: autoconf automake libtommath-devel libtool ncurses-devel libicu-devel BuildRequires: libedit-devel gcc-c++ libstdc++-static systemd-units chrpath zlib-devel procmail @@ -206,6 +207,9 @@ systemd-tmpfiles --create %{_tmpfilesdir}/firebird.conf %exclude %{_docdir}/firebird/IPLicense.txt %changelog +* Wed Jul 19 2023 haomimi - 3.0.3.32900-12 +- Add sw_64 support + * Thu May 25 2023 Wenlong Zhang - 3.0.3.32900-11 - Modify PROD_FLAGS and DEV_FLAGS parameters for loongarch64 -- Gitee