From 22846322070ddd9a6f4801a3605f690d9f70049c Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Wed, 3 Aug 2022 18:14:26 +0100 Subject: [PATCH] Add linux/mips64el support Signed-off-by: Jiaxun Yang --- builds/posix/prefix.linux_mips64el | 27 ++++++++++++++++++++++++ configure.ac | 9 ++++++++ src/common/classes/DbImplementation.cpp | 28 +++++++++++++------------ src/common/common.h | 4 ++++ src/include/firebird/impl/inf_pub.h | 2 ++ 5 files changed, 57 insertions(+), 13 deletions(-) create mode 100644 builds/posix/prefix.linux_mips64el diff --git a/builds/posix/prefix.linux_mips64el b/builds/posix/prefix.linux_mips64el new file mode 100644 index 0000000000..eb16512b8b --- /dev/null +++ b/builds/posix/prefix.linux_mips64el @@ -0,0 +1,27 @@ +# 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 + + +#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 -DMIPS64EL -pipe -p -MMD -fPIC -fsigned-char -fmessage-length=0 +DEV_FLAGS=-ggdb -DLINUX -DMIPS64EL -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 0c9ae7d44b..426bb24361 100644 --- a/configure.ac +++ b/configure.ac @@ -230,6 +230,15 @@ dnl CPU_TYPE=ppc64 SHRLIB_EXT=so ;; + mips64el-*-linux* | mips*64*el-*-linux*) + MAKEFILE_PREFIX=linux_mips64el + INSTALL_PREFIX=linux + PLATFORM=LINUX + AC_DEFINE(LINUX) + EDITLINE_FLG=Y + SHRLIB_EXT=so + ;; + x86_64*-*-linux* | x86_64*-*-gnu*) MAKEFILE_PREFIX=linux_amd64 INSTALL_PREFIX=linux diff --git a/src/common/classes/DbImplementation.cpp b/src/common/classes/DbImplementation.cpp index 8068681a3c..fdfde4fdd7 100644 --- a/src/common/classes/DbImplementation.cpp +++ b/src/common/classes/DbImplementation.cpp @@ -50,6 +50,7 @@ static const UCHAR CpuArm64 = 15; static const UCHAR CpuPowerPc64el = 16; static const UCHAR CpuM68k = 17; static const UCHAR CpuRiscV64 = 18; +static const UCHAR CpuMips64el = 19; static const UCHAR OsWindows = 0; static const UCHAR OsLinux = 1; @@ -91,7 +92,8 @@ const char* hardware[] = { "ARM64", "PowerPC64el", "M68k", - "RiscV64" + "RiscV64", + "MIPS64EL" }; const char* operatingSystem[] = { @@ -118,23 +120,23 @@ 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 -/* 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, 87, 88, -/* 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, 89, 0, 0, -/* NetBSD */ 62, 0, 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 PPC64el M68k RiscV64 MIPS64EL +/* Windows */ 50, 68, 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, +/* Darwin */ 70, 73, 0, 63, 77, 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, +/* HPUX */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 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, 0, +/* MVS */ 0, 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, 89, 0, 0, 0, +/* NetBSD */ 62, 0, 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 PPC64el M68k RiscV64 - 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 PPC64el M68k RiscV64 MIPS64EL + 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 f58b065dcb..1b8aff0c76 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -156,6 +156,10 @@ #define FB_CPU CpuMips #endif /* mips */ +#ifdef MIPS64EL +#define FB_CPU CpuMips64el +#endif /* mips64el */ + #ifdef IA64 #define FB_CPU CpuIa64 #define RISC_ALIGNMENT diff --git a/src/include/firebird/impl/inf_pub.h b/src/include/firebird/impl/inf_pub.h index 40e6d70ed1..e3d6ce04d2 100644 --- a/src/include/firebird/impl/inf_pub.h +++ b/src/include/firebird/impl/inf_pub.h @@ -300,6 +300,8 @@ enum info_db_implementations isc_info_db_impl_freebsd_ppc64el = 89, + isc_info_db_impl_linux_mips64el = 90, + isc_info_db_impl_last_value // Leave this LAST! };