Re: Bug#828141: firebird2.5: Please add platform support for m68k
Hello!
Attaching an updated patch which includes an additional alignment fix for m68k
by Michael Karcher. He discovered that "sem_t" was incorrectly aligned to 16 bits
which resulted in "create_db" crashing with [1]:
sh -x -c "lockfile -1 ../gen/firebird/bin/build-db.lock && ../gen/firebird/bin/create_db empty.fdb; res=\$?; rm -f ../gen/firebird/bin/build-db.lock; exit \$res"
+ lockfile -1 ../gen/firebird/bin/build-db.lock
+ ../gen/firebird/bin/create_db empty.fdb
The futex facility returned an unexpected error code.Aborted
+ res=134
+ rm -f ../gen/firebird/bin/build-db.lock
+ exit 134
../gen/Makefile.refDatabases:66: recipe for target 'empty.fdb' failed
This updated patch fixes this issue. However, firebird2.5 continues to FTBFS on m68k [2]:
+ ../gen/firebird/bin/isql_static -i ../src/msgs/msg.sql msg.fdb
can't format message 17:0 -- message file /usr/lib/m68k-linux-gnu/firebird/2.5/firebird.msg not found
Dynamic SQL Error
-SQL error code = -104
-Unexpected end of command - line 1, column 18
can't format message 17:120 -- message file /usr/lib/m68k-linux-gnu/firebird/2.5/firebird.msg not found
can't format message 17:0 -- message file /usr/lib/m68k-linux-gnu/firebird/2.5/firebird.msg not found
Adrian
> [1] https://buildd.debian.org/status/fetch.php?pkg=firebird2.5&arch=m68k&ver=2.5.5.26952.ds4-5&stamp=1467009792
> [2] https://people.debian.org/~glaubitz/firebird2.5_2.5.5.26952.ds4-5_m68k.build
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz@debian.org
`. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Description: Add basic platform support for m68k
m68k is a big-endian architecture.
.
Index: firebird2.5-2.5.5.26952.ds4/configure.in
===================================================================
--- firebird2.5-2.5.5.26952.ds4.orig/configure.in
+++ firebird2.5-2.5.5.26952.ds4/configure.in
@@ -359,6 +359,17 @@ dnl CPU_TYPE=ppc64
SHRLIB_EXT=so
;;
+ m68k*-*-linux*)
+ MAKEFILE_PREFIX=linux_generic
+ INSTALL_PREFIX=linux
+ PLATFORM=LINUX
+ AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
+ AC_DEFINE(M68K, 1, [Define this if CPU is M68k])
+ LOCK_MANAGER_FLG=Y
+ EDITLINE_FLG=Y
+ SHRLIB_EXT=so
+ ;;
+
*-*-linux* | *-*-gnu*)
MAKEFILE_PREFIX=linux_generic
INSTALL_PREFIX=linux
@@ -964,10 +975,11 @@ AC_CHECK_MEMBER([struct dirent.d_type],
dnl EKU: try to determine the alignment of long and double
dnl replaces FB_ALIGNMENT and FB_DOUBLE_ALIGN in src/jrd/common.h
AC_MSG_CHECKING(alignment of long)
-AC_TRY_RUN([main () {
+AC_TRY_RUN([#include <semaphore.h>
+main () {
struct s {
char a;
- long long b;
+ union { long long x; sem_t y; } b;
};
exit((int)&((struct s*)0)->b);
}], ac_cv_c_alignment=$ac_status, ac_cv_c_alignment=$ac_status)
Index: firebird2.5-2.5.5.26952.ds4/src/jrd/common.h
===================================================================
--- firebird2.5-2.5.5.26952.ds4.orig/src/jrd/common.h
+++ firebird2.5-2.5.5.26952.ds4/src/jrd/common.h
@@ -200,7 +200,9 @@
#define IMPLEMENTATION isc_info_db_impl_linux_ppc64el /* 85 */
#endif /* PPC64EL */
-
+#ifdef M68K
+#define IMPLEMENTATION isc_info_db_impl_linux_m68k /* 86 */
+#endif /* M68K */
#endif /* LINUX */
Index: firebird2.5-2.5.5.26952.ds4/src/jrd/inf_pub.h
===================================================================
--- firebird2.5-2.5.5.26952.ds4.orig/src/jrd/inf_pub.h
+++ firebird2.5-2.5.5.26952.ds4/src/jrd/inf_pub.h
@@ -217,6 +217,7 @@ enum info_db_implementations
isc_info_db_impl_linux_alpha = 83,
isc_info_db_impl_linux_arm64 = 84,
isc_info_db_impl_linux_ppc64el = 85,
+ isc_info_db_impl_linux_m68k = 86,
isc_info_db_impl_last_value // Leave this LAST!
};
Index: firebird2.5-2.5.5.26952.ds4/src/jrd/pag.cpp
===================================================================
--- firebird2.5-2.5.5.26952.ds4.orig/src/jrd/pag.cpp
+++ firebird2.5-2.5.5.26952.ds4/src/jrd/pag.cpp
@@ -165,10 +165,10 @@ static const int CLASS_LINUX_HPPA = 40;
static const int CLASS_LINUX_ALPHA = 41; // LINUX/ALPHA
static const int CLASS_LINUX_ARM64 = 42; // LINUX/ARM64
static const int CLASS_LINUX_PPC64EL = 43; // LINUX/PowerPc64EL
-
+static const int CLASS_LINUX_M68K = 44; // LINUX/M68K
static const int CLASS_MAX10 = CLASS_LINUX_AMD64; // This should not be changed, no new ports with ODS10
-static const int CLASS_MAX = CLASS_LINUX_PPC64EL;
+static const int CLASS_MAX = CLASS_LINUX_M68K;
// ARCHITECTURE COMPATIBILITY CLASSES
@@ -269,8 +269,8 @@ static const ArchitectureType archMatrix
archBigEndian, // CLASS_LINUX_HPPA
archLittleEndian, // CLASS_LINUX_ALPHA
archLittleEndian, // CLASS_LINUX_ARM64
- archLittleEndian // CLASS_LINUX_PPC64EL
-
+ archLittleEndian, // CLASS_LINUX_PPC64EL
+ archBigEndian // CLASS_LINUX_M68K
};
#ifdef __sun
@@ -338,6 +338,8 @@ const SSHORT CLASS = CLASS_LINUX_ALPHA;
const SSHORT CLASS = CLASS_LINUX_ARM64;
#elif defined(PPC64EL)
const SSHORT CLASS = CLASS_LINUX_PPC64EL;
+#elif defined(M68K)
+const SSHORT CLASS = CLASS_LINUX_M68K;
#else
#error no support on other hardware for Linux
#endif
Index: firebird2.5-2.5.5.26952.ds4/src/jrd/utl.cpp
===================================================================
--- firebird2.5-2.5.5.26952.ds4.orig/src/jrd/utl.cpp
+++ firebird2.5-2.5.5.26952.ds4/src/jrd/utl.cpp
@@ -229,8 +229,8 @@ static const TEXT* const impl_implementa
"Firebird/linux HPPA", // 82
"Firebird/linux ALPHA", // 83
"Firebird/linux ARM64", // 84
- "Firebird/linux PPC64EL" // 85
-
+ "Firebird/linux PPC64EL", // 85
+ "Firebird/linux M68K" // 86
};
Reply to: