[pkg-firebird-general] Bug#565801: firebird2.5: FTBFS on kfreebsd-amd64 with -O1, builds fine with -O0
Modestas Vainius
modestas at vainius.eu
Sat Mar 27 00:26:31 UTC 2010
tags 565801 patch
thanks
Hello,
On sekmadienis 21 Kovas 2010 13:34:43 Petr Salinger wrote:
> > I found that changing -O level is sufficient to build this package.
> > The next step should be find somehow, which ".o" file built with -O1
> > causes the trouble.
>
> dpkg-buildpackage -b -uc
> wait for segfault (or hang) during
> ../gen/firebird/bin/gbak_static -MODE read_only -R
> ../builds/misc/help.gbak ../gen/firebird/help/help.f$ make clean
> make -C gen -f ../gen/Makefile.boot.gpre gpre_boot
> make -C gen -f ../gen/Makefile.libfbstatic libfbstatic
>
> alter gen/make.platform to "-O0"
> rm gen/firebird/lib/libfbstatic.a
> rm temp/boot/dsql/*
> make -C gen -f ../gen/Makefile.libfbstatic libfbstatic
> alter gen/make.platform to "-O1" or "-O2"
>
> make
>
> The problem seems be in (compilation of)
> some file from the rebuilt ones.
>
> As this bug is going to block transitions,
> it might be usefull to use
>
> CFLAGS=-O0 CXXFLAGS=-O0 ./configure $(confflags) --enable-superserver
>
> when DEB_HOST_ARCH is kfreebsd-amd64 to workaround it in mean time.
Thanks to very helpful hints from Petr, I was able to track down what atomic
g++ flag and which object file is the problem. It appears that current
(4.4.3-2) g++ miscompiles src/dsql/parse.cpp when -fipa-reference optimization
flag (implied by -O1 or higher) is enabled. Therefore, my solution is to avoid
the problem by building src/dsql/parse.cpp ( $(OBJ)/dsql/parse.o ) with -fno-
ipa-reference:
$ cat debian/patches/fix_kfreebsd_amd64_miscompile.patch
Author: Modestas Vainius <modax at debian.org>
Description: workaround FBTFS on kfreebsd-amd64
The FTBFS is due to g++ (confirmed on version 4.4.3-2) miscompilation of the
src/dsql/parse.cpp file when -fipa-reference optimization is enabled (-O1 or
higher enables it). The patch workarounds the issue by disabling ipa-
reference
for temp/boot/dsql/parse.o on kfreebsd-amd64.
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=565801
Forwarded: not-needed
Last-Update: 2010-03-27
--- a/builds/posix/prefix.freebsd_amd64
+++ b/builds/posix/prefix.freebsd_amd64
@@ -28,3 +28,6 @@ CLIENT_UTIL_TARGETS=gstat gsec fbguard f
Physical_IO_Module=os/posix/unix.cpp
# This is needed due to broken port of gcc
STATIC_CXXSUPPORT_LIB = -lstdc++ -lgcc_s
+
+# Workaround g++ miscompilation bug with -fipa-reference (-O1 or higher)
+$(OBJ)/dsql/parse.o: WCXXFLAGS += -fno-ipa-reference
In addition, a couple other changes are needed in order to successfully build
firebird2.5 on kfreebsd-amd64. My debian/changelog is below:
firebird2.5 (2.5.0.25920~ReleaseCandidate2.ds2-3.1) unstable; urgency=low
.
* Non-maintainer upload.
* Workaround gcc miscompilation of src/dsql/parse.cpp on kfreebsd-amd64.
Fixes FTBFS (Closes: #565801).
* Mirror file builds/posix/prefix.freebsd changes in the patches
"no-rpath.patch" and "freebsd_targets.patch" to the
builds/posix/prefix.freebsd_amd64 file. This enables firebird to build
successfully on kfreebsd-amd64.
firebird2.5 is a dependency of Qt 4 on kfreebsd-amd64. Since Qt 4.6.2
transition is very likely to start sometime next week, it is very important to
get fixed firebird2.5 to archive before Qt 4.6.2 is ready to migrate to
testing. A full diff with all my changes is attached. If maintainer upload is
not made in time, I will NMU firebird2.5 with these changes. I will send
another ping to this bug a couple of days before NMUing.
--
Modestas Vainius <modestas at vainius.eu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: firebird2.5_2.5.0.25920~ReleaseCandidate2.ds2-3_to_3.1_nmu.diff
Type: text/x-patch
Size: 5195 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-firebird-general/attachments/20100327/f7e73098/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-firebird-general/attachments/20100327/f7e73098/attachment.pgp>
More information about the pkg-firebird-general
mailing list