Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.0.0
-
None
-
Linux
Description
In qtbase, add the following lines to the top of src/v8/v8.pri:
message("QT_ARCH: $$QT_ARCH") message("QMAKE_HOST.arch: $$QMAKE_HOST.arch")
Then run "qmake -r" under src. I get the following output:
Project MESSAGE: QT_ARCH: Project MESSAGE: QMAKE_HOST.arch: i686 Reading /home/khansen/dev/qtbase/src/tools/bootstrap/bootstrap.pro Reading /home/khansen/dev/qtbase/src/tools/moc/moc.pro Reading /home/khansen/dev/qtbase/src/tools/rcc/rcc.pro Reading /home/khansen/dev/qtbase/src/tools/uic/uic.pro Reading /home/khansen/dev/qtbase/src/corelib/corelib.pro Reading /home/khansen/dev/qtbase/src/network/network.pro Reading /home/khansen/dev/qtbase/src/sql/sql.pro Reading /home/khansen/dev/qtbase/src/testlib/testlib.pro Reading /home/khansen/dev/qtbase/src/xml/xml.pro Reading /home/khansen/dev/qtbase/src/uitools/uitools.pro Reading /home/khansen/dev/qtbase/src/dbus/dbus.pro Reading /home/khansen/dev/qtbase/src/gui/gui.pro Reading /home/khansen/dev/qtbase/src/v8/v8.pro Project MESSAGE: QT_ARCH: i386 Project MESSAGE: QMAKE_HOST.arch: i686 Project MESSAGE: because of a bug in gcc / v8 we need to add -fno-strict-aliasing Reading /home/khansen/dev/qtbase/src/opengl/opengl.pro
Note that v8/v8.pro gets evaluated twice, and the first time, QT_ARCH isn't set. It also seems that other parts of the environment are "missing", which is supposedly why the "because of a bug in gcc / v8 we need to add -fno-strict-aliasing" message doesn't appear the first time (it's guarded by -g++).
It's unfortunate that QT_ARCH isn't set, since v8.pri uses it to detect which architecture to build for (e.g. which arch-specific source files to add). Currently it "falls back" to checking QT_HOST.arch if QT_ARCH isn't set, but QT_HOST.arch is more specific. We already have checks like "equals(QMAKE_HOST.arch, i686)" and "equals(QMAKE_HOST.arch, armv5tel)".
The following part of src.pro is doing the extra evaluation:
# This gives us a top level debug/release
for(subname, SRC_SUBDIRS) {
...
SUB_TEMPLATE = $$list($$fromfile($$subpro, TEMPLATE))
...
It seems that fromfile() is not passed the same configuration/environment as when v8.pro is evaluated by qmake proper, and this is causing some .prf/.pri files to not be included – in particular, qconfig.pri, which sets QT_ARCH.