Bug#840666: firebird3.0: FTBFS on powerpc, segfaults during build

2016-10-13 Thread John Paul Adrian Glaubitz
On 10/13/2016 09:38 PM, John Paul Adrian Glaubitz wrote:
> On 10/13/2016 09:36 PM, Damyan Ivanov wrote:
>>> PS: If you agree, I can NMU the fixed package using the patch I just 
>>> posted right away to fix the bug :).
>>
>> I'll upload soon (hours) anyway because of a fix for kfreebsd.
> 
> Alright, thanks.

Oh, and could I ask you for an additional favor? Could please add the attached
patch to add platform support for Linux/m68k? I would highly appreciate that!

Thanks,
Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Description: Add platform support for Linux/m68k
Author: John Paul Adrian Glaubitz 

--- firebird3.0-3.0.1.32609.ds4.orig/configure.ac
+++ firebird3.0-3.0.1.32609.ds4/configure.ac
@@ -361,6 +361,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
@@ -997,10 +1008,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_RUN_IFELSE([AC_LANG_SOURCE([[main () {
+AC_RUN_IFELSE([AC_LANG_SOURCE([[#include 
+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],[])
--- firebird3.0-3.0.1.32609.ds4.orig/src/common/classes/DbImplementation.cpp
+++ firebird3.0-3.0.1.32609.ds4/src/common/classes/DbImplementation.cpp
@@ -48,6 +48,7 @@ static const UCHAR CpuHppa = 13;
 static const UCHAR CpuAlpha = 14;
 static const UCHAR CpuArm64 = 15;
 static const UCHAR CpuPowerPc64el = 16;
+static const UCHAR CpuM68k = 17;
 
 static const UCHAR OsWindows = 0;
 static const UCHAR OsLinux = 1;
@@ -87,7 +88,8 @@ const char* hardware[] = {
 	"HPPA",
 	"Alpha",
 	"ARM64",
-	"PowerPC64el"
+	"PowerPC64el",
+	"M68k"
 };
 
 const char* operatingSystem[] = {
@@ -128,8 +130,8 @@ const UCHAR backwardTable[FB_NELEM(hardw
 
 const UCHAR backEndianess[FB_NELEM(hardware)] =
 {
-//	Intel	AMD		Sparc	PPC		PPC64	MIPSEL	MIPS	ARM		IA64	s390	s390x	SH		SHEB	HPPA	Alpha	ARM64	PowerPC64el
-	0,		0,		1,		1,		1,		0,		1,		0,		0,		1,		1,		0,		1,		1,		0,		0,		0
+//	Intel	AMD		Sparc	PPC		PPC64	MIPSEL	MIPS	ARM		IA64	s390	s390x	SH		SHEB	HPPA	Alpha	ARM64	PowerPC64el	M68k
+   0,		0,		1,		1,		1,		0,		1,		0,		0,		1,		1,		0,		1,		1,		0,		0,		0,		1
 };
 
 } // anonymous namespace
--- firebird3.0-3.0.1.32609.ds4.orig/src/common/common.h
+++ firebird3.0-3.0.1.32609.ds4/src/common/common.h
@@ -195,6 +195,10 @@
 #define FB_CPU CpuPowerPc64
 #endif /* PPC64 */
 
+#ifdef M68K
+#define FB_CPU CpuM68k
+#endif /* M68K */
+
 #endif /* LINUX */
 
 
--- firebird3.0-3.0.1.32609.ds4.orig/src/jrd/inf_pub.h
+++ firebird3.0-3.0.1.32609.ds4/src/jrd/inf_pub.h
@@ -241,6 +241,7 @@ enum  info_db_implementations
 	isc_info_db_impl_linux_arm64 = 84,
 	isc_info_db_impl_linux_ppc64el = 85,
 	isc_info_db_impl_linux_ppc64 = 86,
+	isc_info_db_impl_linux_m68k = 87,
 
 
 	isc_info_db_impl_last_value   // Leave this LAST!


signature.asc
Description: OpenPGP digital signature


Bug#840666: firebird3.0: FTBFS on powerpc, segfaults during build

2016-10-13 Thread Damyan Ivanov
-=| John Paul Adrian Glaubitz, 13.10.2016 21:30:14 +0200 |=-
> On 10/13/2016 09:29 PM, John Paul Adrian Glaubitz wrote:
> > It has to be added to the script template in build/posix/vers.sh.in. I'm
> > attaching a complete debdiff which fixes the issue for me in powerpc. I
> > have also opened two PRs upstream, these also include patches for m68k
> > and an additional patch.

Great. Thanks!

> PS: If you agree, I can NMU the fixed package using the patch I just 
> posted right away to fix the bug :).

I'll upload soon (hours) anyway because of a fix for kfreebsd.

-- Damyan


signature.asc
Description: Digital signature


Bug#840666: firebird3.0: FTBFS on powerpc, segfaults during build

2016-10-13 Thread John Paul Adrian Glaubitz
On 10/13/2016 09:36 PM, Damyan Ivanov wrote:
>> PS: If you agree, I can NMU the fixed package using the patch I just 
>> posted right away to fix the bug :).
> 
> I'll upload soon (hours) anyway because of a fix for kfreebsd.

Alright, thanks.

Btw, my patch might actually fix mips64el as well, see [1].

Adrian

> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=816059

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



signature.asc
Description: OpenPGP digital signature


Bug#840666: firebird3.0: FTBFS on powerpc, segfaults during build

2016-10-13 Thread John Paul Adrian Glaubitz
On 10/13/2016 09:29 PM, John Paul Adrian Glaubitz wrote:
> It has to be added to the script template in build/posix/vers.sh.in. I'm
> attaching a complete debdiff which fixes the issue for me in powerpc. I
> have also opened two PRs upstream, these also include patches for m68k
> and an additional patch.

PS: If you agree, I can NMU the fixed package using the patch I just posted
right away to fix the bug :).

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



signature.asc
Description: OpenPGP digital signature


Bug#840666: firebird3.0: FTBFS on powerpc, segfaults during build

2016-10-13 Thread John Paul Adrian Glaubitz
Hi Damyan!

On 10/13/2016 09:09 PM, Damyan Ivanov wrote:
> -=| John Paul Adrian Glaubitz, 13.10.2016 18:35:31 +0200 |=-
>> Source: firebird3.0
>> Version: 3.0.1.32609.ds4-6
>> Severity: serious
> 
> Shouldn't this be important instead? According to 
> https://release.debian.org/stretch/arch_qualify.html powerpc is not 
> a release candidate.

Well, currently, powerpc is still a release architecture, so I set the severity
accordingly. Also, I'm quite confident that mips64el is failing because of the
same problem.

> Of course, I am eager to find solution to the crash regardless, just 
> arguing about it affecting the potential migration of firebird3.0 to 
> testing.

I found the issue :), see below.

> Where did you add that _IO_stdin_used entry? There are several *.vers 
> files in the source. I'll try with all of them and also 
> _IO_std{err,out}_used.

It has to be added to the script template in build/posix/vers.sh.in. I'm
attaching a complete debdiff which fixes the issue for me in powerpc. I
have also opened two PRs upstream, these also include patches for m68k
and an additional patch.

Cheers,
Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
diff -Nru firebird3.0-3.0.1.32609.ds4/debian/changelog firebird3.0-3.0.1.32609.ds4/debian/changelog
--- firebird3.0-3.0.1.32609.ds4/debian/changelog	2016-10-12 10:57:51.0 +0200
+++ firebird3.0-3.0.1.32609.ds4/debian/changelog	2016-10-13 21:04:46.0 +0200
@@ -1,3 +1,11 @@
+firebird3.0 (3.0.1.32609.ds4-6.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Add fix-version-script.patch to patch linker version script
+to export the _IO_stdin_used symbol (Closes: #840666)
+
+ -- John Paul Adrian Glaubitz   Thu, 13 Oct 2016 21:04:46 +0200
+
 firebird3.0 (3.0.1.32609.ds4-6) unstable; urgency=medium
 
   * add RuntimeDirectory= to server's service files
diff -Nru firebird3.0-3.0.1.32609.ds4/debian/patches/fix-version-script.patch firebird3.0-3.0.1.32609.ds4/debian/patches/fix-version-script.patch
--- firebird3.0-3.0.1.32609.ds4/debian/patches/fix-version-script.patch	1970-01-01 01:00:00.0 +0100
+++ firebird3.0-3.0.1.32609.ds4/debian/patches/fix-version-script.patch	2016-10-13 21:04:42.0 +0200
@@ -0,0 +1,13 @@
+Description: Fix version script to export the _IO_stdin_used symbol
+Author: John Paul Adrian Glaubitz 
+
+--- firebird3.0-3.0.1.32609.ds4.orig/builds/posix/vers.sh.in
 firebird3.0-3.0.1.32609.ds4/builds/posix/vers.sh.in
+@@ -57,6 +57,7 @@ platform_linux() {
+ 		echo "${TAB}$i;"
+ 	done
+ 
++	echo "${TAB}_IO_stdin_used;"
+ 	echo 'local:'
+ 	echo "${TAB}*;"
+ 	echo '};'
diff -Nru firebird3.0-3.0.1.32609.ds4/debian/patches/series firebird3.0-3.0.1.32609.ds4/debian/patches/series
--- firebird3.0-3.0.1.32609.ds4/debian/patches/series	2016-10-05 12:59:43.0 +0200
+++ firebird3.0-3.0.1.32609.ds4/debian/patches/series	2016-10-13 21:03:39.0 +0200
@@ -10,3 +10,4 @@
 packaged-boost.patch
 deb/no-suse.init.patch
 deb/gen-ids.patch
+fix-version-script.patch


signature.asc
Description: OpenPGP digital signature


Bug#840666: firebird3.0: FTBFS on powerpc, segfaults during build

2016-10-13 Thread Damyan Ivanov
-=| John Paul Adrian Glaubitz, 13.10.2016 18:35:31 +0200 |=-
> Source: firebird3.0
> Version: 3.0.1.32609.ds4-6
> Severity: serious

Shouldn't this be important instead? According to 
https://release.debian.org/stretch/arch_qualify.html powerpc is not 
a release candidate.

Of course, I am eager to find solution to the crash regardless, just 
arguing about it affecting the potential migration of firebird3.0 to 
testing.

> Tags: upstream
> Justification: fails to build from source
> User: debian-powe...@lists.debian.org
> Usertags: powerpc
> 
> firebird3.0 currently fails to build from source since the gpre
> command segfaults during build:
> 
> sh -x -c "lockfile -1 /«PKGBUILDDIR»/gen/Release/firebird/bin/build-db.lock 
> && /«PKGBUILDDIR»/gen/Release/firebird/bin/gpre_current -m -z -n 
> /«PKGBUILDDIR»/src/yvalve/blob.epp 
> /«PKGBUILDDIR»/temp/Release/yvalve/blob.cpp; res=\$?; rm -f 
> /«PKGBUILDDIR»/gen/Release/firebird/bin/build-db.lock; exit \$res"
> + lockfile -1 /«PKGBUILDDIR»/gen/Release/firebird/bin/build-db.lock
> + /«PKGBUILDDIR»/gen/Release/firebird/bin/gpre_current -m -z -n 
> /«PKGBUILDDIR»/src/yvalve/blob.epp /«PKGBUILDDIR»/temp/Release/yvalve/blob.cpp
> gpre version LI-V3.0.1.32609 Firebird 3.0
> Segmentation fault
> + res=139
> + rm -f /«PKGBUILDDIR»/gen/Release/firebird/bin/build-db.lock
> + exit 139

Hmm. I have seen this on amd64 when gcc switched to version 6. Getting 
it built required adding -std=gnu++98 -fno-lifetime-dse 
-fno-delete-null-pointer-checks -fno-strict-aliasing to the compiler 
flags. Probably unrelated.

> I have done some debugging and from the backtrace it's obvious that
> the crash occurs in glibc:
> 
> (sid_powerpc-dchroot)glaubitz@partch:~/firebird3.0-3.0.1.32609.ds4$ gdb 
> /home/glaubitz/firebird3.0-3.0.1.32609.ds4/gen/Release/firebird/bin/gpre_boot
> GNU gdb (Debian 7.11.1-2) 7.11.1
> Copyright (C) 2016 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "powerpc-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> .
> Find the GDB manual and other documentation resources online at:
> .
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from 
> /home/glaubitz/firebird3.0-3.0.1.32609.ds4/gen/Release/firebird/bin/gpre_boot...done.
> (gdb) run
> Starting program: 
> /home/glaubitz/firebird3.0-3.0.1.32609.ds4/gen/Release/firebird/bin/gpre_boot
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library 
> "/lib/powerpc-linux-gnu/libthread_db.so.1".
> gpre:  no source file named.
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x0fa79960 in _IO_wsetb () from /lib/powerpc-linux-gnu/libc.so.6
> (gdb) bt
> #0  0x0fa79960 in _IO_wsetb () from /lib/powerpc-linux-gnu/libc.so.6
> #1  0x0fa88dac in ?? () from /lib/powerpc-linux-gnu/libc.so.6
> #2  0x0fa3cd58 in ?? () from /lib/powerpc-linux-gnu/libc.so.6
> #3  0x0fa3ce30 in exit () from /lib/powerpc-linux-gnu/libc.so.6
> #4  0x10027f28 in CPR_exit (stat=263831632) at ./src/gpre/gpre.cpp:978
> Backtrace stopped: previous frame inner to this frame (corrupt stack?)
> (gdb)
> 
> This looks similar to the FTBFS of lua5.3 on powerpc [1] which is
> triggered by the use of a version script for the linker and, in
> fact, firebird3.0 is using such scripts. Now, this actually reminded
> me of another similar problem we had on sparc back then [2] which
> is the missing _IO_stdin_used symbol in the version script. lua5.2
> was affected by that problem as well and Aurelien Jarno fixed that
> by adding that symbol to the version script [3].

This is interesting. I was trying to debug a similar issue today on 
the mips64el porterbox. One of the command-line utilities of firebird 
produces garbage upon exit breaking a database verification at the end 
of the build process. (Build log: 
https://buildd.debian.org/status/fetch.php?pkg=firebird3.0=mips64el=3.0.1.32609.ds4-6=1476281685)
There is random garbage emitted by the firebird source preprocessor 
(gpre) which is visible earlier in the build log.
Alpha is also affected.

> I tried the fix from [3] in firebird3.0, but unfortunately it
> doesn't help. Currently, I'm out of ideas but it would be great
> to see this fixed as this also affects m68k for which I have
> added platform support to firebird upstream [4,5].

Where did you add that _IO_stdin_used entry? There are several *.vers 
files in the source. I'll try with all of them and also 
_IO_std{err,out}_used.

(15 minutes later) Oh, it helps! The invocations of gpre no longer 
dump sources. Let's see how far this goes.

-- Damyan

> > 

Bug#840666: firebird3.0: FTBFS on powerpc, segfaults during build

2016-10-13 Thread John Paul Adrian Glaubitz
On 10/13/2016 08:17 PM, John Paul Adrian Glaubitz wrote:
> Ok, the following patch fixes the crash above:
> 
> glaubitz@partch:~/firebird$ git diff builds/posix/vers.sh.in
> diff --git a/builds/posix/vers.sh.in b/builds/posix/vers.sh.in
> index 69bd656..15d86a7 100644
> --- a/builds/posix/vers.sh.in
> +++ b/builds/posix/vers.sh.in
> @@ -57,6 +57,7 @@ platform_linux() {
> echo "${TAB}$i;"
> done
> 
> +   echo "${TAB}_IO_stdin_used;"
> echo 'local:'
> echo "${TAB}*;"
> echo '};'
> glaubitz@partch:~/firebird$
> 
> However, it crashes still when running isql during build:

Ok, turns out the second crash affects Firebird from git/master only. The patch
above really fixes the problem for the firebird3.0 package in Debian :).

Will prepare a patch shortly and follow up. This *might* also fix the
testsuite failure on mips64el as it apparently also has problems when
_IO_stdin_used is missing.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#840666: firebird3.0: FTBFS on powerpc, segfaults during build

2016-10-13 Thread John Paul Adrian Glaubitz
On 10/13/2016 06:35 PM, John Paul Adrian Glaubitz wrote:
> I tried the fix from [3] in firebird3.0, but unfortunately it
> doesn't help. Currently, I'm out of ideas but it would be great
> to see this fixed as this also affects m68k for which I have
> added platform support to firebird upstream [4,5].

Ok, the following patch fixes the crash above:

glaubitz@partch:~/firebird$ git diff builds/posix/vers.sh.in
diff --git a/builds/posix/vers.sh.in b/builds/posix/vers.sh.in
index 69bd656..15d86a7 100644
--- a/builds/posix/vers.sh.in
+++ b/builds/posix/vers.sh.in
@@ -57,6 +57,7 @@ platform_linux() {
echo "${TAB}$i;"
done

+   echo "${TAB}_IO_stdin_used;"
echo 'local:'
echo "${TAB}*;"
echo '};'
glaubitz@partch:~/firebird$

However, it crashes still when running isql during build:

make gpre
make[3]: Entering directory '/home/glaubitz/firebird/gen'
rm -f metadata.fdb
/home/glaubitz/firebird/gen/Release/firebird/bin/isql -q -i 
/home/glaubitz/firebird/src/dbs/metadata.sql
Makefile:339: recipe for target 'metadata.fdb' failed
make[3]: *** [metadata.fdb] Segmentation fault
make[3]: *** Deleting file 'metadata.fdb'
make[3]: Leaving directory '/home/glaubitz/firebird/gen'
Makefile:180: recipe for target 'master_process' failed
make[2]: *** [master_process] Error 2
make[2]: Leaving directory '/home/glaubitz/firebird/gen'
Makefile:74: recipe for target 'firebird' failed
make[1]: *** [firebird] Error 2
make[1]: Leaving directory '/home/glaubitz/firebird/gen'
Makefile:6: recipe for target 'firebird' failed
make: *** [firebird] Error 2

But calling the isql command line directly doesn't trigger a crash:

(sid_powerpc-dchroot)glaubitz@partch:~/firebird$ export 
LD_LIBRARY_PATH=/home/glaubitz/firebird/gen/Release/firebird/lib
(sid_powerpc-dchroot)glaubitz@partch:~/firebird$ 
/home/glaubitz/firebird/gen/Release/firebird/bin/isql -q -i 
/home/glaubitz/firebird/src/dbs/metadata.sql
can't format message 17:0 -- message file /usr/local/firebird/firebird.msg not 
found
Unable to complete network request to host "localhost".
-Failed to establish a connection.
can't format message 17:120 -- message file /usr/local/firebird/firebird.msg 
not found
(sid_powerpc-dchroot)glaubitz@partch:~/firebird$

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#840666: firebird3.0: FTBFS on powerpc, segfaults during build

2016-10-13 Thread John Paul Adrian Glaubitz
Source: firebird3.0
Version: 3.0.1.32609.ds4-6
Severity: serious
Tags: upstream
Justification: fails to build from source
User: debian-powe...@lists.debian.org
Usertags: powerpc

Hello!

firebird3.0 currently fails to build from source since the gpre
command segfaults during build:

sh -x -c "lockfile -1 /«PKGBUILDDIR»/gen/Release/firebird/bin/build-db.lock && 
/«PKGBUILDDIR»/gen/Release/firebird/bin/gpre_current -m -z -n 
/«PKGBUILDDIR»/src/yvalve/blob.epp /«PKGBUILDDIR»/temp/Release/yvalve/blob.cpp; 
res=\$?; rm -f /«PKGBUILDDIR»/gen/Release/firebird/bin/build-db.lock; exit 
\$res"
+ lockfile -1 /«PKGBUILDDIR»/gen/Release/firebird/bin/build-db.lock
+ /«PKGBUILDDIR»/gen/Release/firebird/bin/gpre_current -m -z -n 
/«PKGBUILDDIR»/src/yvalve/blob.epp /«PKGBUILDDIR»/temp/Release/yvalve/blob.cpp
gpre version LI-V3.0.1.32609 Firebird 3.0
Segmentation fault
+ res=139
+ rm -f /«PKGBUILDDIR»/gen/Release/firebird/bin/build-db.lock
+ exit 139

I have done some debugging and from the backtrace it's obvious that
the crash occurs in glibc:

(sid_powerpc-dchroot)glaubitz@partch:~/firebird3.0-3.0.1.32609.ds4$ gdb 
/home/glaubitz/firebird3.0-3.0.1.32609.ds4/gen/Release/firebird/bin/gpre_boot
GNU gdb (Debian 7.11.1-2) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from 
/home/glaubitz/firebird3.0-3.0.1.32609.ds4/gen/Release/firebird/bin/gpre_boot...done.
(gdb) run
Starting program: 
/home/glaubitz/firebird3.0-3.0.1.32609.ds4/gen/Release/firebird/bin/gpre_boot
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/powerpc-linux-gnu/libthread_db.so.1".
gpre:  no source file named.

Program received signal SIGSEGV, Segmentation fault.
0x0fa79960 in _IO_wsetb () from /lib/powerpc-linux-gnu/libc.so.6
(gdb) bt
#0  0x0fa79960 in _IO_wsetb () from /lib/powerpc-linux-gnu/libc.so.6
#1  0x0fa88dac in ?? () from /lib/powerpc-linux-gnu/libc.so.6
#2  0x0fa3cd58 in ?? () from /lib/powerpc-linux-gnu/libc.so.6
#3  0x0fa3ce30 in exit () from /lib/powerpc-linux-gnu/libc.so.6
#4  0x10027f28 in CPR_exit (stat=263831632) at ./src/gpre/gpre.cpp:978
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

This looks similar to the FTBFS of lua5.3 on powerpc [1] which is
triggered by the use of a version script for the linker and, in
fact, firebird3.0 is using such scripts. Now, this actually reminded
me of another similar problem we had on sparc back then [2] which
is the missing _IO_stdin_used symbol in the version script. lua5.2
was affected by that problem as well and Aurelien Jarno fixed that
by adding that symbol to the version script [3].

I tried the fix from [3] in firebird3.0, but unfortunately it
doesn't help. Currently, I'm out of ideas but it would be great
to see this fixed as this also affects m68k for which I have
added platform support to firebird upstream [4,5].

Thanks,

Adrian

> [1] https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1570055
> [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634261
> [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=816059
> [4] https://github.com/FirebirdSQL/firebird/pull/51
> [5] https://github.com/FirebirdSQL/firebird/pull/52

--
 .''`.  John Paul Adrian Glaubitz
 : :' :  Debian Developer - glaub...@debian.org
 `. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
   `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913