Bug 178652 - x11-libs/qt-4.3.2 compilation error - amd64 and gcc 3.4
Bug#: 178652 Product:  Gentoo Linux Version: unspecified Platform: AMD64
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: qt@gentoo.org Reported By: philip@lightbox.org
Component: Ebuilds
URL: 
Summary: x11-libs/qt-4.3.2 compilation error - amd64 and gcc 3.4
Keywords:  
Status Whiteboard: 
Opened: 2007-05-15 14:43 0000
Description:   Opened: 2007-05-15 14:43 0000
This is the error:

!!! ERROR: x11-libs/qt-4.3.0_rc1 failed.
Call stack:
  ebuild.sh, line 1615:   Called dyn_compile
  ebuild.sh, line 972:   Called qa_call 'src_compile'
  ebuild.sh, line 44:   Called src_compile
  qt-4.3.0_rc1.ebuild, line 211:   Called die

!!! (no error message)
!!! If you need support, post the topmost build error, and the call stack if
relevant.
!!! A complete build log is located at
'/var/log/portage/x11-libs:qt-4.3.0_rc1:20070515-135506.log'.

I'll attach the log.

emerge --info
Portage 2.1.2.7 (default-linux/amd64/2006.0, gcc-3.4.6, glibc-2.5-r2,
2.6.21-gentoo x86_64)
=================================================================
System uname: 2.6.21-gentoo x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor
3800+
Gentoo Base System release 1.12.10
Timestamp of tree: Tue, 15 May 2007 13:00:06 +0000
dev-java/java-config: 1.3.7, 2.0.32
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config
/usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf
/etc/php/apache1-php5/ext-active/ /etc/php/apache2-php5/ext-active/
/etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild
/etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
--force --whole-file --delete --delete-after --stats --timeout=180
--exclude=/distfiles --exclude=/local --exclude=/packages
--filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa amd64 arts berkdb bitmap-fonts bzip2 cli cracklib crypt cups dri
eds emboss encode foomaticdb fortran gd gif gnome gpm gstreamer gtk gtk2 iconv
imlib ipv6 isdnlog java jpeg kde lzw lzw-tiff midi mp3 mpeg mysql ncurses nls
nptl ogg opengl pam pcre pdf perl php png pppd python qt3 qt4 quicktime
readline reflection sdl session speex spell spl ssl tcpd theora tiff truetype
truetype-fonts type1-fonts usb vorbis xml xorg xpm xscreensaver xv zip zlib"
ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x
ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3
trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw
asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa
lfloat linear meter mulaw multi null plug rate route share shm softvol"
ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad
cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU"
VIDEO_CARDS="nv"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS,
LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS,
PORTDIR_OVERLAY

I'm sorry if this is vague or not a bug but I don't even know where to start
because there is no error message.

------- Comment #1 From Philip Graham 2007-05-15 14:46:20 0000 -------
Created an attachment (id=119374) [details]
Log File

------- Comment #2 From Caleb Tennis 2007-05-15 15:00:51 0000 -------
This is the bug:

g++ -c -include .pch/release-shared/QtGui -O2 -pipe -I/usr/include/mysql -O2
-pipe -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_GUI_LIB
-DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT
-DQT_RASTER_IMAGEENGINE -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_SSE2
-DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSVISTA -DQT_NO_STYLE_WINDOWSXP
-DQ_INTERNAL_QAPP_SRC -DQT_NO_DEBUG -DQT_CORE_LIB -D_LARGEFILE64_SOURCE
-D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore
-I../../include/QtCore -I../../include -I../../include/QtGui
-I/usr/include/freetype2 -I../3rdparty/harfbuzz/src -Idialogs
-I.moc/release-shared -I/usr/include -I.uic/release-shared -o
.obj/release-shared/qcleanlooksstyle.o styles/qcleanlooksstyle.cpp
../../include/QtCore/../../src/corelib/arch/qatomic_x86_64.h: In member
function `virtual QRect QStyleSheetStyle::subElementRect(QStyle::SubElement,
const QStyleOption*, const QWidget*) const':
../../include/QtCore/../../src/corelib/arch/qatomic_x86_64.h:105: error:
inconsistent operand constraints in an `asm'
../../include/QtCore/../../src/corelib/arch/qatomic_x86_64.h:105: error:
inconsistent operand constraints in an `asm'

Maybe the amd64 team can help here.

------- Comment #3 From Caleb Tennis 2007-05-15 16:11:25 0000 -------
The Qt task tracker has this bug in it:

http://www.trolltech.com/developer/task-tracker/index_html?method=entry&id=161994

The solution is to either compile without -O2, use the -fno-gcse, or use a more
current compiler (gcc 4.1, for example).

------- Comment #4 From Philip Graham 2007-05-15 17:20:07 0000 -------
Ok, cool thank you.

Apparently I had gcc 4+ installed but it wasn't being used so I used gcc-config
to change  my profile.  That fixed the problem.

Next time I'll be sure to check the bug reports of the app I'm having a problem
with before filing.

Thanks again for your help and patience.

------- Comment #5 From Caleb Tennis 2007-05-15 17:32:38 0000 -------
no problem.  It isn't exactly an easy one to diagnose.

------- Comment #6 From Jakub Moc (RETIRED) 2007-06-03 21:36:11 0000 -------
*** Bug 180792 has been marked as a duplicate of this bug. ***

------- Comment #7 From Jakub Moc (RETIRED) 2007-08-15 16:40:36 0000 -------
*** Bug 189020 has been marked as a duplicate of this bug. ***

------- Comment #8 From Jakub Moc (RETIRED) 2007-08-19 16:49:47 0000 -------
*** Bug 189493 has been marked as a duplicate of this bug. ***

------- Comment #9 From Jakub Moc (RETIRED) 2007-09-03 17:44:40 0000 -------
*** Bug 191161 has been marked as a duplicate of this bug. ***

------- Comment #10 From Jakub Moc (RETIRED) 2007-09-08 13:18:35 0000 -------
*** Bug 191690 has been marked as a duplicate of this bug. ***

------- Comment #11 From Jakub Moc (RETIRED) 2007-09-16 13:11:15 0000 -------
*** Bug 192685 has been marked as a duplicate of this bug. ***

------- Comment #12 From Milan Holzäpfel 2007-09-16 20:47:47 0000 -------
Created an attachment (id=131078) [details]
Make qt-4.3.1-r1.ebuild compile with gcc-3.4

Please see bug #192685 for details. (Basically, hardened/amd64 has only gcc-3.4
available right now, so imo, we should add a workaround to the ebuild.)
The patch now references bug #178652. (this one)
Apologies for my misuse of Bugzilla in bug #192685. 

------- Comment #13 From Milan Holzäpfel 2007-09-16 20:50:11 0000 -------
Created an attachment (id=131080) [details]
Make qt-4.3.1-r1.ebuild compile with gcc-3.4

Uploaded the wrong file. The prior one referenced bug #189493, which does not
make much sense anyway. 
This one references this bug, bug #178652.

------- Comment #14 From Jakub Moc (RETIRED) 2007-10-30 07:23:04 0000 -------
*** Bug 197453 has been marked as a duplicate of this bug. ***

------- Comment #15 From Jakub Moc (RETIRED) 2007-11-04 18:09:07 0000 -------
*** Bug 198066 has been marked as a duplicate of this bug. ***

------- Comment #16 From Jakub Moc (RETIRED) 2007-12-02 16:51:26 0000 -------
*** Bug 201009 has been marked as a duplicate of this bug. ***

------- Comment #17 From Thomas Sachau 2007-12-02 18:38:45 0000 -------
Please patch qt-4.3.2.ebuild with the patch too else qt-4.3.2 does not compile
on amd64 with gcc-3.4.6 (bug 201009).

With added patch qt-4.3.2 does compile for me.

------- Comment #18 From Milan Holzäpfel 2007-12-03 20:10:43 0000 -------
Same here, build fails with the ebuild as it is in CVS on systems using gcc-3.4
(e.g. hardened amd64).

My patch from 2007-09-16 fixes it. 

The patch applies against x11-libs/qt-4.3.2 (offset 1 line) and I have tested
it successfully on hardened amd64. 

Therefore I ask for the patch being applied against x11-libs/qt-4.3.2 from CVS.
Any objections? 

Regards,
Milan

------- Comment #19 From Grant 2007-12-04 17:41:02 0000 -------
I'm having the same problem and I'd love to have that patch in the tree.

Also, emerging skype fails like this for me:

The specific snippet of code:
 *      [[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package"
 *  The die message:
 *   Unable to resolve >=x11-libs/qt-4.0 to an installed package

I'm trying to emerge qt manually, but shouldn't it be pulled in as a
dependency?

------- Comment #20 From Thomas Sachau 2007-12-07 16:23:46 0000 -------
this problem still exists with qt-4.3.2, qt-4.3.2-r1 and qt-4.3.3, so i request
a reopening of this bug. The diff should be add to the newer versions too.

------- Comment #21 From Caleb Tennis 2007-12-07 16:54:44 0000 -------
reopening

------- Comment #22 From Daniel Tourde - Caelae.se 2008-01-12 12:40:35 0000 -------
Same problem here with qt-4.3.2-r1.
Can the solution be made mainstream?

Daniel (amd64, gcc-3.4.6)

------- Comment #23 From Samuli Suominen 2008-01-26 07:04:35 0000 -------
Nothing for amd64 here, up to qt maintainers to apply or not apply the patch
for obsolete GCC3. Why would anyone use it, is beyond me..

------- Comment #24 From Jakub Moc (RETIRED) 2008-01-26 18:07:27 0000 -------
To quote Comment #3 once again:

> The solution is to either compile without -O2, use the -fno-gcse, or use a more
> current compiler (gcc 4.1, for example).

hardened should grow itself a decent toolchain, and noone else should use gcc3.
The patch is nasty, if anything the ebuild should just check for sucky gcc
version and use append-flags accordingly.

------- Comment #25 From Oleg Titov 2008-02-12 02:26:11 0000 -------
i have same problem compiling qt on intel pentium pro with gcc v.4.1.2

so it is not just amd64 and gcc v.3.x.x problem

------- Comment #26 From Thomas Sachau 2008-02-27 18:28:15 0000 -------
Created an attachment (id=144762) [details]
amd64-hardened.patch

simple patch, working with qt-4.3.4 for me

------- Comment #27 From Ingmar Vanhassel (RETIRED) 2008-03-07 13:35:37 0000 -------
*** Bug 212579 has been marked as a duplicate of this bug. ***

------- Comment #28 From Ingmar Vanhassel (RETIRED) 2008-03-11 14:10:13 0000 -------
*** Bug 213038 has been marked as a duplicate of this bug. ***

------- Comment #29 From Ingmar Vanhassel (RETIRED) 2008-03-11 17:33:46 0000 -------
Fixed in qt-{4.3.2-r1,4.3.4,4.4.0_beta1}, by appending -fno-gcse, for amd64
with GCC 3.

------- Comment #30 From Peter Alfredsen 2008-04-30 19:14:02 0000 -------
*** Bug 219869 has been marked as a duplicate of this bug. ***

------- Comment #31 From Peter Alfredsen 2008-11-11 22:06:44 0000 -------
*** Bug 246426 has been marked as a duplicate of this bug. ***