Bug 905863

Summary: mingw-qt5-qtbase fails to build on non-x86 arches
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: mingw-qt5-qtbaseAssignee: Erik van Pienbroek <erik-fedora>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: erik-fedora
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-17 03:34:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 467765    

Description Dan Horák 2013-01-30 10:48:08 UTC
mingw-qt5-qtbase fails to build on non-x86 arches with

....
g++ -c -pipe -ffunction-sections -O2 -std=c++0x -Wall -W -D_REENTRANT -fPIC -fno-exceptions -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_XCB -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NO_TRANSLATION -DQT_QMAKE_LOCATION=\"/builddir/build/BUILD/build_release_static_win32/bin/qmake\" -DQT_NO_CAST_FROM_ASCII -DQT_BUILD_BOOTSTRAP_LIB -DQT_BUILDING_QT -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -I/builddir/build/BUILD/qtbase-opensource-src-5.0.0/mkspecs/linux-g++ -I/builddir/build/BUILD/qtbase-opensource-src-5.0.0/src/tools/bootstrap -I../../../include -I../../../include/QtCore -I../../../include/QtCore/5.0.0 -I../../../include/QtCore/5.0.0/QtCore -I../../../include/QtXml -I/builddir/build/BUILD/build_release_static_win32/include/QtXml/5.0.0 -I/builddir/build/BUILD/build_release_static_win32/include/QtXml/5.0.0/QtXml -I../../corelib/global -I/builddir/build/BUILD/qtbase-opensource-src-5.0.0/src/3rdparty/zlib -I. -o .obj/release-static/qstring.o /builddir/build/BUILD/qtbase-opensource-src-5.0.0/src/corelib/tools/qstring.cpp
In file included from /builddir/build/BUILD/qtbase-opensource-src-5.0.0/src/corelib/tools/qstring.cpp:50:0:
/builddir/build/BUILD/qtbase-opensource-src-5.0.0/src/corelib/tools/qsimd_p.h:146:23: fatal error: x86intrin.h: No such file or directory
compilation terminated.
make[3]: *** [.obj/release-static/qstring.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/builddir/build/BUILD/build_release_static_win32/src/tools/bootstrap'
make[2]: *** [sub-tools-bootstrap-make_first] Error 2

Because qt5-qtbase builds the qstring.cpp file correctly (checked on s390x) I guess the cross-build system wrongly expects it runs on x86. The problem exists at least on s390x and ppc.

see http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=922520 or http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=885843 for all logs

Version-Release number of selected component (if applicable):
mingw-qt5-qtbase-5.0.0-3.fc18

Comment 1 Erik van Pienbroek 2013-01-30 13:44:58 UTC
This piece of output looks suspicious:
CFG_ARCH="i386"
Determining architecture... ()
g++ -c -pipe -g -Wall -W -fPIE  -I/builddir/build/BUILD/qtbase-opensource-src-5.0.0/mkspecs/linux-g++ -I/builddir/build/BUILD/qtbase-opensource-src-5.0.0/config.tests/arch -I. -o arch.o /builddir/build/BUILD/qtbase-opensource-src-5.0.0/config.tests/arch/arch.cpp
g++  -o arch arch.o    
{ test -n "" && DESTDIR="" || DESTDIR=.; } && test $(gdb --version | sed -e 's,[^0-9]\+\([0-9]\)\.\([0-9]\).*,\1\2,;q') -gt 72 && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $DESTDIR" -ex quit 'arch' && test -f arch.gdb-index && objcopy --add-section '.gdb_index=arch.gdb-index' --set-section-flags '.gdb_index=readonly' 'arch' 'arch' && rm -f arch.gdb-index || true
    Found architecture in binary
CFG_HOST_ARCH="unknown"

Now investigating why the configure script can't determine the host architecture for s390x..

Comment 2 Erik van Pienbroek 2013-01-30 13:52:10 UTC
Do you happen to have shell access to a s390x environment which I could temporary use for debugging?

Comment 3 Dan Horák 2013-01-30 14:00:23 UTC
(In reply to comment #2)
> Do you happen to have shell access to a s390x environment which I could
> temporary use for debugging?

all machines I have are internal in RH, but the PPC people have public machines available, please ping them on #fedora-ppc on FreeNode

Comment 4 Erik van Pienbroek 2013-01-30 14:33:26 UTC
I'm not sure if the problem also exists on PPC..but then perhaps you could help me with the debugging.

Could you try to build the package locally (using fedpkg local/rpmbuild) and once it fails, please perform the following commands:

$ cd build_release_static_win32
$ g++ -pipe -g -Wall -W -fPIE  -I../qtbase-opensource-src-5.0.0/mkspecs/linux-g++ -I../qtbase-opensource-src-5.0.0/config.tests/arch -I. -o arch.o ../qtbase-opensource-src-5.0.0/config.tests/arch/arch.cpp -o arch
$ strings ./arch

The Qt5 configure script tries to locate the following text in the output of the 'strings' command:
==Qt=magic=Qt== Architecture
==Qt=magic=Qt== Sub-architecture

During the mock build which you tried earlier these two texts couldn't be located in the output of the 'strings' command.

What output does the 'strings' command give you?

Comment 5 Erik van Pienbroek 2013-01-31 15:51:48 UTC
Were you already able to do the test I described in comment 4 ?
Right now I'm prepping an update to Qt 5.0.1 and I would like to fix this bug at the same time as well

Comment 6 Dan Horák 2013-01-31 16:08:58 UTC
got distracted by other work, but it's on my list, will try to check it later today

Comment 7 Erik van Pienbroek 2013-01-31 17:20:50 UTC
I think I've found the root cause of this issue, but I'm not sure how to fix it. I just filed at bug upstream: https://bugreports.qt-project.org/browse/QTBUG-29426

Comment 8 Dan Horák 2013-01-31 17:25:19 UTC
Thanks, that corresponds to my understanding what was happening during the non-x86 builds.

Comment 9 Fedora Update System 2013-02-07 23:56:55 UTC
mingw-qt5-qtbase-5.0.1-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/mingw-qt5-qtbase-5.0.1-2.fc18

Comment 10 Fedora Update System 2013-02-08 17:00:34 UTC
Package mingw-qt5-qtbase-5.0.1-2.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mingw-qt5-qtbase-5.0.1-2.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-2146/mingw-qt5-qtbase-5.0.1-2.fc18
then log in and leave karma (feedback).

Comment 11 Erik van Pienbroek 2013-02-08 17:19:19 UTC
I just pushed an updated package to rawhide and f18 which contains a fix which should allow cross-compilation on non-x86 hosts. I did a scratch build of it for the ppc target and it built fine without issues

Comment 12 Dan Horák 2013-02-12 14:42:31 UTC
for the record - build on s390/s390x was also successful

Comment 13 Fedora Update System 2013-02-17 03:34:57 UTC
mingw-qt5-qtbase-5.0.1-2.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.