(Context: this is a reply to a thread from November 2013 about porting 
Firebird to 64-bit ARM)

-=| Alex Peshkoff, 29.11.2013 15:34:02 +0400 |=-
> I will apply a patch commented in opder to avoid conflicts with 
> class IDs.

Alex, thanks for adding this to the B2_5_Release branch. It seems it 
missed the actual prefix.linux_arm64 file. Please find it attached.

I also tried to add arm64 support to trunk so that the new 
implementation ID is recognised. The result is in the attached patch. 
It also adds implementation IDs for Alpha and HPPA which were missing 
in the public header file.

I hope you find this useful.


-- dam
# 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 -DNDEBUG -DLINUX -pipe -MMD -fPIC
#DEV_FLAGS=-ggdb -DLINUX -DDEBUG_GDS_ALLOC -pipe -MMD -p -fPIC -Wall -Wno-switch

PROD_FLAGS=-O3 -DNDEBUG -DLINUX -DARM64 -pipe -MMD -fPIC -fsigned-char 
-fmessage-length=0
DEV_FLAGS=-ggdb -DLINUX -DARM64 -pipe -MMD -fPIC -Wall -fsigned-char 
-fmessage-length=0

OS_ServerFiles=inet_server.cpp

EMBED_UTIL_TARGETS=gstat gds_relay gsec nbackup fb_lock_print fbguard fbsvcmgr 
fbtracemgr
CLIENT_UTIL_TARGETS=gstat gds_relay gsec nbackup fb_lock_print fbguard 
fbmgr_bin fbsvcmgr fbtracemgr

Physical_IO_Module=unix.cpp
>From d511e4a849712259925096a266228d4527bbc90a Mon Sep 17 00:00:00 2001
From: Damyan Ivanov <d...@debian.org>
Date: Mon, 28 Apr 2014 13:33:46 +0000
Subject: [PATCH] ARM4 support for trunk

---
 builds/posix/prefix.linux_arm64         | 27 +++++++++++++++++++++++++++
 configure.ac                            | 11 +++++++++++
 src/common/classes/DbImplementation.cpp | 28 +++++++++++++++-------------
 src/common/common.h                     |  4 ++++
 src/jrd/inf_pub.h                       |  3 +++
 5 files changed, 60 insertions(+), 13 deletions(-)
 create mode 100644 builds/posix/prefix.linux_arm64

diff --git a/builds/posix/prefix.linux_arm64 b/builds/posix/prefix.linux_arm64
new file mode 100644
index 0000000..a5a8755
--- /dev/null
+++ b/builds/posix/prefix.linux_arm64
@@ -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 -Wall -Wno-switch
+
+PROD_FLAGS=-O3 -DLINUX -DARM64 -pipe -p -MMD -fPIC -fsigned-char -fmessage-length=0
+DEV_FLAGS=-ggdb -DLINUX -DARM64 -pipe -p -MMD -fPIC -Wall -fsigned-char -fmessage-length=0 -Wno-non-virtual-dtor
diff --git a/configure.ac b/configure.ac
index 931c82f..4c9cd5f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -239,6 +239,17 @@ dnl CPU_TYPE=ppc64
     STD_EDITLINE=true
     ;;
 
+  aarch64*-*-linux*)                           // port was not tested
+    MAKEFILE_PREFIX=linux_arm64
+    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
+    ;;
+
   sparc*-*-linux* | sparc*-*-gnu* | sparc*-*-k*bsd*-gnu)
     MAKEFILE_PREFIX=linux_sparc32
     INSTALL_PREFIX=linux
diff --git a/src/common/classes/DbImplementation.cpp b/src/common/classes/DbImplementation.cpp
index d554ab2..6152649 100644
--- a/src/common/classes/DbImplementation.cpp
+++ b/src/common/classes/DbImplementation.cpp
@@ -46,6 +46,7 @@ static const UCHAR CpuSh = 11;
 static const UCHAR CpuSheb = 12;
 static const UCHAR CpuHppa = 13;
 static const UCHAR CpuAlpha = 14;
+static const UCHAR CpuArm64 = 15;
 
 static const UCHAR OsWindows = 0;
 static const UCHAR OsLinux = 1;
@@ -83,7 +84,8 @@ const char* hardware[] = {
 	"SH",
 	"SHEB",
 	"HPPA",
-	"Alpha"
+	"Alpha",
+	"ARM64"
 };
 
 const char* operatingSystem[] = {
@@ -110,22 +112,22 @@ const char* compiler[] = {
 // This table lists pre-fb3 imlementation 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
-/* Windows */	50,		68,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
-/* Linux */		60,		66,		65,		69,		0,		71,		72,		75, 	76,		79, 	78,		80,		81,		82,		83,
-/* Darwin */	70,		73,		0,		63,		77,		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,
-/* HPUX */		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		31,		0,
-/* AIX */		0,		0,		0,		35,		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,
-/* FreeBSD */	61,		67,		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
+//				Intel	AMD		Sparc	PPC		PPC64	MIPSEL	MIPS	ARM		IA64	s390	s390x	SH		SHEB	HPPA	Alpha	ARM64
+/* Windows */	50,		68,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
+/* Linux */		60,		66,		65,		69,		0,		71,		72,		75, 	76,		79, 	78,		80,		81,		82,		83,		84,
+/* Darwin */	70,		73,		0,		63,		77,		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,
+/* HPUX */		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		31,		0,		0,
+/* AIX */		0,		0,		0,		35,		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,
+/* FreeBSD */	61,		67,		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
 };
 
 const UCHAR backEndianess[FB_NELEM(hardware)] =
 {
-//	Intel	AMD		Sparc	PPC		PPC64	MIPSEL	MIPS	ARM		IA64	s390	s390x	SH		SHEB	HPPA	Alpha
-	0,		0,		1,		1,		1,		0,		1,		0,		0,		1,		1,		0,		1,		1,		0
+//	Intel	AMD		Sparc	PPC		PPC64	MIPSEL	MIPS	ARM		IA64	s390	s390x	SH		SHEB	HPPA	Alpha	ARM64
+	0,		0,		1,		1,		1,		0,		1,		0,		0,		1,		1,		0,		1,		1,		0,		0
 };
 
 } // anonymous namespace
diff --git a/src/common/common.h b/src/common/common.h
index 463f48b..f545bfe 100644
--- a/src/common/common.h
+++ b/src/common/common.h
@@ -134,6 +134,10 @@
 #define FB_CPU CpuArm
 #endif /* ARM */
 
+#ifdef ARM64
+#define FB_CPU CpuArm64
+#endif /* ARM64 */
+
 #ifdef sparc
 #define FB_CPU CpuUltraSparc
 #define RISC_ALIGNMENT
diff --git a/src/jrd/inf_pub.h b/src/jrd/inf_pub.h
index 56f6853..7c52b33 100644
--- a/src/jrd/inf_pub.h
+++ b/src/jrd/inf_pub.h
@@ -215,6 +215,9 @@ enum  info_db_implementations
 
 	isc_info_db_impl_linux_sh = 80,
 	isc_info_db_impl_linux_sheb = 81,
+	isc_info_db_impl_linux_hppa = 82,
+	isc_info_db_impl_linux_alpha = 83,
+	isc_info_db_impl_linux_arm64 = 84,
 
 	isc_info_db_impl_last_value   // Leave this LAST!
 };
-- 
2.0.0.rc0

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to