Bug#565801: firebird2.5: FTBFS on kfreebsd-amd64 with -O1, builds fine with -O0

2010-03-29 Thread Damyan Ivanov
tags 565801 pending
thanks

-=| Modestas Vainius, Sat, Mar 27, 2010 at 02:26:31AM +0200 |=-
 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:

Great!

An update package is to be uploaded in a couple of hours.

I can't find a g++ bugreport about this, do you mind filing one? Note 
that the actual C++ source that is (mis)compiled by g++ is a result of 
pre-processing of src/dsql/parse.y by an yacc preprocessor (built 
locally).

Since the parser module is used everywhere, I'll try to disable the 
optimization only on freebsd-amd64 for the next upload.

Many thanks for your help, Petr and Modestas!


signature.asc
Description: Digital signature


Bug#565801: [pkg-firebird-general] Bug#565801: firebird2.5: FTBFS on kfreebsd-amd64 with -O1, builds fine with -O0

2010-03-29 Thread Damyan Ivanov
-=| Damyan Ivanov, Mon, Mar 29, 2010 at 02:09:04PM +0300 |=-
 Since the parser module is used everywhere, I'll try to disable the 
 optimization only on freebsd-amd64 for the next upload.

This is already the case, sorry for the noise.


signature.asc
Description: Digital signature


Bug#565801: firebird2.5: FTBFS on kfreebsd-amd64 with -O1, builds fine with -O0

2010-03-26 Thread Modestas Vainius
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 mo...@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 modes...@vainius.eu
diff -Nru firebird2.5-2.5.0.25920~ReleaseCandidate2.ds2/debian/changelog firebird2.5-2.5.0.25920~ReleaseCandidate2.ds2/debian/changelog
--- firebird2.5-2.5.0.25920~ReleaseCandidate2.ds2/debian/changelog	2010-03-27 00:27:52.0 +
+++ firebird2.5-2.5.0.25920~ReleaseCandidate2.ds2/debian/changelog	2010-03-27 00:27:55.0 +
@@ -1,3 +1,15 @@
+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.
+
+ -- Modestas Vainius mo...@asdfasdf.debian.net  Sat, 27 Mar 2010 00:58:35 +0100
+
 firebird2.5 (2.5.0.25920~ReleaseCandidate2.ds2-3) unstable; urgency=high
 
   * *.postrm: protect db_input calls with || true as we don't want to fail when
diff -Nru firebird2.5-2.5.0.25920~ReleaseCandidate2.ds2/debian/patches/fix_kfreebsd_amd64_miscompile.patch firebird2.5-2.5.0.25920~ReleaseCandidate2.ds2/debian/patches/fix_kfreebsd_amd64_miscompile.patch
--- firebird2.5-2.5.0.25920~ReleaseCandidate2.ds2/debian/patches/fix_kfreebsd_amd64_miscompile.patch	1970-01-01 00:00:00.0 +
+++ firebird2.5-2.5.0.25920~ReleaseCandidate2.ds2/debian/patches/fix_kfreebsd_amd64_miscompile.patch	2010-03-27 

Bug#565801: firebird2.5: FTBFS on kfreebsd-amd64 with -O1, builds fine with -O0

2010-03-21 Thread Petr Salinger
retitle 565801 firebird2.5: FTBFS on kfreebsd-amd64 with -O1, builds with -O0
--

Hi,

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.


Petr







-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#565801: firebird2.5: FTBFS on kfreebsd-amd64 with -O1, builds fine with -O0

2010-03-21 Thread Petr Salinger
Hi again. 
 
 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.

No idea why it affects kfreebsd-amd64 but not (linux-)amd64.
Used gcc version 4.4.3 (Debian 4.4.3-2)

Petr




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org