Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 344915 - x11-libs/qt-core-4.7.1 wrongly detects sse4.2
Summary: x11-libs/qt-core-4.7.1 wrongly detects sse4.2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Qt Bug Alias
URL: http://bugreports.qt.nokia.com/browse...
Whiteboard: workaround in tree
Keywords:
: 345077 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-11-10 12:13 UTC by Guillaume Castagnino
Modified: 2011-09-08 19:06 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
qt-core 4.7.1 build log (build.log,205.98 KB, text/plain)
2010-11-10 12:14 UTC, Guillaume Castagnino
Details
qt4-build.eclass.patch (qt4-build.eclass.patch,494 bytes, patch)
2010-11-10 13:26 UTC, Timo Gurr (RETIRED)
Details | Diff
Mike's patch (merged upstream) (ca2e8b6dc176576f7217f4b7209994eddad1a358.patch,1.15 KB, patch)
2010-11-18 22:19 UTC, Davide Pesavento (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Castagnino 2010-11-10 12:13:26 UTC
I have a core 2 Quad Q9300, it only has sse4.1, but not sse4.2.
qt-core 4.7.1 wrongly assume it has.

Critical part :
sse4_2 auto-detection... ()
x86_64-pc-linux-gnu-g++ -c -pipe -msse4.2 -Wall -W  -I../../../mkspecs/linux-g++ -I. -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -o sse4_2.o sse4_2.cpp
x86_64-pc-linux-gnu-g++ -Wl,-O1 -Wl,-rpath,/usr/lib64/qt4 -o sse4_2 sse4_2.o     -L/usr/lib64 -lgthread-2.0 -lrt -lglib-2.0 -msse4.2
sse4_2 enabled.


It leads to this error :
x86_64-pc-linux-gnu-g++ -c -march=native -O2 -mtune=native -pipe -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared -o .obj/release-shared/qsimd.o tools/qsimd.cpp
x86_64-pc-linux-gnu-g++ -c -march=native -O2 -mtune=native -pipe -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared -o .obj/release-shared/qsize.o tools/qsize.cpp
Dans le fichier inclus à partir de tools/qsimd_p.h:93,
          à partir de tools/qsimd.cpp:42:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/nmmintrin.h:31:3: erreur: #error "SSE4.2 instruction set not enabled"
make: *** [.obj/release-shared/qsimd.o] Erreur 1
make: *** Attente des tâches non terminées....
emake failed



Complete emerge info :
# emerge --info qt-core
Portage 2.2.0_alpha4 (default/linux/amd64/10.0/desktop, gcc-4.4.5, glibc-2.12.1-r3, 2.6.36-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-2.6.36-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9300_@_2.50GHz-with-gentoo-2.0.1
Timestamp of tree: Wed, 10 Nov 2010 11:30:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r2
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.82
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
Repositories: gentoo gcpan_overlay xwing local mozilla x11
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -mtune=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -mtune=native -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests binpkg-logs buildsyspkg collision-protect distlocks fixlafiles fixpackages metadata-transfer news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ ftp://mirror.switch.ch/mirror/gentoo/     http://trumpetti.atm.tut.fi/gentoo/ http://mirror.ovh.net/gentoo-distfiles/ http://gentoo.tiscali.nl/"
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--sort-common"
LINGUAS="fr"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/gcpan-portage /usr/local/portage/portage /usr/local/portage/local-portage /var/lib/layman/mozilla /var/lib/layman/x11"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi additions alsa amd64 apng bash-completion branding bzip2 cairo cdr cli clucene consolekit cracklib crypt cups cxx dbus dri dts dvb dvd dvdnav dvdr emboss encode exif extensions extras firefox firefox3 flac fontconfig fortran fr gif gpm gtk iconv idn iproute2 ipv6 ithreads jpeg kde lcms live llvm lzma mad matroska mmx mng modules mozilla mp3 mp4 mpeg mudflap multilib ncurses network nls nptl nptlonly nsplugin ofx ogg opengl openmp pam pango pcre pdf perl pic png pppd qt3support qt4 raster rdesktop rdp readline sasl scanner semantic-desktop session spell sse sse2 ssl startup-notification svg sysfs syslog tcpd theora threads tiff truetype unicode usb v4l v4l2 vim-pager vim-syntax vnc vorbis x264 xcb xcomposite xml xorg xulrunner xv xvid xvmc zip zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi     gzip limit_req limit_zone map memcached proxy realip referer rewrite     upstream_ip_hash userid stub_status" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

x11-libs/qt-core-4.7.0 was built with the following:
USE="exceptions glib iconv (multilib) qt3support ssl (-aqua) -debug -optimized-qmake -pch -private-headers"




Follow the complete build log
Comment 1 Guillaume Castagnino 2010-11-10 12:14:32 UTC
Created attachment 253881 [details]
qt-core 4.7.1 build log
Comment 2 Guillaume Castagnino 2010-11-10 13:13:39 UTC
I confirm that the sse4_2 test program builds perfectly fine, but does not run, triggering not allowed instructions.
It seems that qt-core assumes that if it builds, it supports the instruction set.


dagobah 14:10 - 0.48 /var/tmp/portage/x11-libs/qt-core-4.7.1/work/qt-everywhere-opensource-src-4.7.1/config.tests/unix/sse4_2
# x86_64-pc-linux-gnu-g++ -c -pipe -msse4.2 -Wall -W  -I../../../mkspecs/linux-g++ -I. -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -o sse4_2.o sse4_2.cpp
dagobah 14:11 - 0.44 /var/tmp/portage/x11-libs/qt-core-4.7.1/work/qt-everywhere-opensource-src-4.7.1/config.tests/unix/sse4_2
# x86_64-pc-linux-gnu-g++ -Wl,-O1 -Wl,-rpath,/usr/lib64/qt4 -o sse4_2 sse4_2.o     -L/usr/lib64 -lgthread-2.0 -lrt -lglib-2.0 -msse4.2 
dagobah 14:11 - 0.41 /var/tmp/portage/x11-libs/qt-core-4.7.1/work/qt-everywhere-opensource-src-4.7.1/config.tests/unix/sse4_2
# ./sse4_2 
Illegal instruction
Comment 3 Timo Gurr (RETIRED) gentoo-dev 2010-11-10 13:26:53 UTC
Created attachment 253893 [details, diff]
qt4-build.eclass.patch

Workaround patch which disables both sse4.1 and sse4.2.
Comment 4 Timo Gurr (RETIRED) gentoo-dev 2010-11-10 13:29:10 UTC
Adding Qt upstream bug in URL.
Comment 5 Alex Alexander (RETIRED) gentoo-dev 2010-11-10 13:47:12 UTC
patch applied, thanks Guillaume & Timo.

I'll leave this bug open to remind us that the fix is currently a workaround.
Comment 6 Vasilis Lourdas 2010-11-10 14:44:25 UTC
(In reply to comment #5)
> patch applied, thanks Guillaume & Timo.
> 
> I'll leave this bug open to remind us that the fix is currently a workaround.

Alex, has the patch hit the tree? I just synced and it still fails here.
Comment 7 Guillaume Castagnino 2010-11-10 14:48:41 UTC
Yes patch is in tree (I just synced ans it's in)
And I can confirm it fixes the build
Comment 8 Vasilis Lourdas 2010-11-10 14:51:48 UTC
(In reply to comment #7)
> Yes patch is in tree (I just synced ans it's in)
> And I can confirm it fixes the build

Right. It seems that my copy was not synced to the server I synced from.
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2010-11-11 11:27:39 UTC
*** Bug 345077 has been marked as a duplicate of this bug. ***
Comment 10 Mike McQuaid 2010-11-18 07:55:52 UTC
This patch is perhaps a bit nicer:
http://qt.gitorious.org/~mikemcquaid/qt/mikemcquaid-qt/commit/ca2e8b6dc176576f7217f4b7209994eddad1a358

I'm from OSX land (Homebrew contributer) but should work on Linux too.
Comment 11 Davide Pesavento (RETIRED) gentoo-dev 2010-11-18 22:18:08 UTC
(In reply to comment #10)
> This patch is perhaps a bit nicer:
> http://qt.gitorious.org/~mikemcquaid/qt/mikemcquaid-qt/commit/ca2e8b6dc176576f7217f4b7209994eddad1a358
> 
> I'm from OSX land (Homebrew contributer) but should work on Linux too.
> 

Mike's patch has been merged upstream. We should apply it and remove the workaround.
Thanks Mike!
Comment 12 Davide Pesavento (RETIRED) gentoo-dev 2010-11-18 22:19:43 UTC
Created attachment 254767 [details, diff]
Mike's patch (merged upstream)
Comment 13 Mieszko Ślusarczyk 2011-01-02 17:19:59 UTC
sse 4.* is still disabled in 4.7.9999, so something is broken in the eclass I think..
Comment 14 Alec Meyers 2011-03-03 14:53:50 UTC
Since upstream fixed[1] the bug in Qt 4.7.2, could sse4.1/4.2 be re-enabled in the eclass for any versions except 4.7.1?

[1] http://bugreports.qt.nokia.com/browse/QTBUG-13623
Comment 15 Alex Alexander (RETIRED) gentoo-dev 2011-03-03 21:40:17 UTC
fixed, thanks for reminding us :)
Comment 16 David Carlos Manuelda 2011-07-29 15:54:08 UTC
It seems that it came again in 4.7.2 it assumes that I have SSE 4.2 and AVX which I currently do not have (only SSE 4.1).

I already posted an upstream bug about it, but this time compilation does not fail, just it assumes it, but I think it can lead to runtime errors it it actually tries to use previously activated SSE 4.2 and AVX extension in a CPU that does not actually supports them.

Can it be reopened?

Upstream bugreport: https://bugreports.qt.nokia.com/browse/QTBUG-20650