From 4730b92d93a91fa13d15aabfbc65b76a197e744b Mon Sep 17 00:00:00 2001 From: haomimi Date: Fri, 3 Nov 2023 11:08:43 +0800 Subject: [PATCH] Add sw_64 support --- builds/posix/prefix.linux_sw_64 | 28 +++++++++++++++++++++++++ configure.ac | 12 +++++++++++ src/common/classes/DbImplementation.cpp | 9 ++++---- src/common/common.h | 4 ++++ src/include/firebird/impl/inf_pub.h | 1 + 5 files changed, 50 insertions(+), 4 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 00000000000..ed35818fd2c --- /dev/null +++ b/builds/posix/prefix.linux_sw_64 @@ -0,0 +1,28 @@ +# The contents of this file are subject to the Interbase Public +# License Version 1.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy +# of the License at http://www.Inprise.com/IPL.html +# +# Software distributed under the License is distributed on an +# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express +# or implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code was created by Inprise Corporation +# and its predecessors. Portions created by Inprise Corporation are +# Copyright (C) Inprise Corporation. +# +# All Rights Reserved. +# Contributor(s): ______________________________________. +# Start of file prefix.linux: $(VERSION) $(PLATFORM) +# 14 Apr 2008 Alan Barclay alan AT escribe.co.uk +# 2018, "Manuel A. Fernandez Montecelo" + + +#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 17e7711160f..feb1c9de41c 100644 --- a/configure.ac +++ b/configure.ac @@ -400,6 +400,18 @@ dnl CPU_TYPE=ppc64 CPU_TYPE=x86 ;; + 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 + ;; + s390x-*-linux*) MAKEFILE_PREFIX=linux_s390x INSTALL_PREFIX=linux diff --git a/src/common/classes/DbImplementation.cpp b/src/common/classes/DbImplementation.cpp index 7c58ee9eb90..99f4da93b16 100644 --- a/src/common/classes/DbImplementation.cpp +++ b/src/common/classes/DbImplementation.cpp @@ -95,7 +95,8 @@ const char* hardware[] = { "M68k", "RiscV64", "MIPS64EL", - "LOONGARCH" + "LOONGARCH", + "sw_64" }; const char* operatingSystem[] = { @@ -122,9 +123,9 @@ 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 PPC64el M68k RiscV64 MIPS64EL LoongArch +// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PPC64el M68k RiscV64 MIPS64EL LoongArch sw_64 /* Windows */ 50, 68, 0, 0, 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, 87, 88, 90, 93, +/* Linux */ 60, 66, 65, 69, 86, 71, 72, 75, 76, 79, 78, 80, 81, 82, 83, 84, 85, 87, 88, 90, 93, 94, /* Darwin */ 70, 73, 0, 63, 77, 0, 0, 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, 0, 0, /* HPUX */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, @@ -137,7 +138,7 @@ const UCHAR backwardTable[FB_NELEM(hardware) * FB_NELEM(operatingSystem)] = const UCHAR backEndianess[FB_NELEM(hardware)] = { -// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PPC64el M68k RiscV64 MIPS64EL LoongArch +// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PPC64el M68k RiscV64 MIPS64EL LoongArch sw_64 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, }; diff --git a/src/common/common.h b/src/common/common.h index 2162205a3b4..1262aef5c76 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -147,6 +147,10 @@ #define FB_CPU CpuLoongArch #endif /* LOONGARCH */ +#ifdef sw_64 +#define FB_CPU Cpusw_64 +#endif /* sw_64 */ + #ifdef sparc #define FB_CPU CpuUltraSparc #define RISC_ALIGNMENT diff --git a/src/include/firebird/impl/inf_pub.h b/src/include/firebird/impl/inf_pub.h index 06afa3c7397..ac1d713685b 100644 --- a/src/include/firebird/impl/inf_pub.h +++ b/src/include/firebird/impl/inf_pub.h @@ -306,6 +306,7 @@ enum info_db_implementations isc_info_db_impl_freebsd_ppc64 = 91, isc_info_db_impl_freebsd_ppc = 92, + isc_info_db_impl_linux_sw_64 = 94, isc_info_db_impl_last_value // Leave this LAST! };