[qt5-qtdeclarative] fix build, use better -config no_sse2 approach

Rex Dieter rdieter at fedoraproject.org
Thu Dec 12 18:19:58 UTC 2013


commit 82f00b71e8394502d03db1a95cca01a6ac99ce39
Author: Rex Dieter <rdieter at math.unl.edu>
Date:   Thu Dec 12 12:19:42 2013 -0600

    fix build, use better -config no_sse2 approach

 qt5-qtdeclarative.spec                             |   32 +++++++++---------
 ...larative-opensource-src-5.2.0-NO_I386_JIT.patch |   29 -----------------
 qtdeclarative-opensource-src-5.2.0-no_sse2.patch   |   33 ++++++++++++++++++++
 3 files changed, 49 insertions(+), 45 deletions(-)
---
diff --git a/qt5-qtdeclarative.spec b/qt5-qtdeclarative.spec
index 3caa152..945cda7 100644
--- a/qt5-qtdeclarative.spec
+++ b/qt5-qtdeclarative.spec
@@ -11,7 +11,7 @@
 Summary: Qt5 - QtDeclarative component
 Name:    qt5-%{qt_module}
 Version: 5.2.0
-Release: 1%{pre}%{?dist}
+Release: 1%{?dist}
 
 # See LICENSE.GPL LICENSE.LGPL LGPL_EXCEPTION.txt, for details
 License: LGPLv2 with exceptions or GPLv3 with exceptions
@@ -22,8 +22,9 @@ Source0: http://download.qt-project.org/development_releases/qt/5.2/%{version}-%
 Source0: http://download.qt-project.org/official_releases/qt/5.2/%{version}/submodules/%{qt_module}-opensource-src-%{version}.tar.xz
 %endif
 
-# support NO_I386_JIT CONFIG (fedora i686 builds cannot assume -march=pentium4 -msse2 -mfpmath=sse flags, or the JIT that needs them)
-Patch1: qtdeclarative-opensource-src-5.2.0-NO_I386_JIT.patch
+# support no_sse2 CONFIG (fedora i686 builds cannot assume -march=pentium4 -msse2 -mfpmath=sse flags, or the JIT that needs them)
+# https://codereview.qt-project.org/#change,73710
+Patch1: qtdeclarative-opensource-src-5.2.0-no_sse2.patch
 
 Obsoletes: qt5-qtjsbackend < 5.2.0
 
@@ -64,7 +65,7 @@ BuildArch: noarch
 %prep
 %setup -q -n %{qt_module}-opensource-src-%{version}%{?pre:-%{pre}}
 
-%patch1 -p1 -b .NO_I386_JIT
+%patch1 -p1 -b .no_sse2
 
 
 %build
@@ -75,19 +76,18 @@ popd
 
 make %{?_smp_mflags} -C %{_target_platform}
 
-%ifarch %{ix86}
-# build libQt5Qml with NO_I386_JIT
-mkdir -p %{_target_platform}-nojit
-pushd    %{_target_platform}-nojit
-%{_qt5_qmake} CONFIG+=NO_I386_JIT ..
-popd
-
-make sub-src-clean   -C %{_target_platform}-nojit/
-make %{?_smp_mflags} -C %{_target_platform}-nojit/src/qml
+%if 0%{?docs}
+make %{?_smp_mflags} docs %{_target_platform}
 %endif
 
-%if 0%{?docs}
-make %{?_smp_mflags} docs -C %{_target_platform}
+%ifarch %{ix86}
+# build libQt5Qml with no_sse2
+mkdir -p %{_target_platform}-no_sse2
+pushd    %{_target_platform}-no_sse2
+%{_qt5_qmake} -config no_sse2 ..
+make sub-src-clean
+make %{?_smp_mflags} -C src/qml
+popd
 %endif
 
 
@@ -97,7 +97,7 @@ make install INSTALL_ROOT=%{buildroot} -C %{_target_platform}
 %ifarch %{ix86}
 mkdir -p %{buildroot}%{_qt5_libdir}/sse2
 mv %{buildroot}%{_qt5_libdir}/libQt5Qml.so.5* %{buildroot}%{_qt5_libdir}/sse2/
-make install INSTALL_ROOT=%{buildroot} -C %{_target_platform}-nojit/src/qml
+make install INSTALL_ROOT=%{buildroot} -C %{_target_platform}-no_sse2/src/qml
 %endif
 
 %if 0%{?docs}
diff --git a/qtdeclarative-opensource-src-5.2.0-no_sse2.patch b/qtdeclarative-opensource-src-5.2.0-no_sse2.patch
new file mode 100644
index 0000000..d1120d8
--- /dev/null
+++ b/qtdeclarative-opensource-src-5.2.0-no_sse2.patch
@@ -0,0 +1,33 @@
+diff -up qtdeclarative-opensource-src-5.2.0/src/qml/jsruntime/jsruntime.pri.no_sse2 qtdeclarative-opensource-src-5.2.0/src/qml/jsruntime/jsruntime.pri
+--- qtdeclarative-opensource-src-5.2.0/src/qml/jsruntime/jsruntime.pri.no_sse2	2013-12-08 11:10:19.000000000 -0600
++++ qtdeclarative-opensource-src-5.2.0/src/qml/jsruntime/jsruntime.pri	2013-12-12 11:30:36.763009499 -0600
+@@ -91,7 +91,7 @@ HEADERS += \
+ 
+ # Use SSE2 floating point math on 32 bit instead of the default
+ # 387 to make test results pass on 32 and on 64 bit builds.
+-linux-g++*:isEqual(QT_ARCH,i386) {
++linux-g++*:isEqual(QT_ARCH,i386):!no_sse2 {
+     QMAKE_CFLAGS += -march=pentium4 -msse2 -mfpmath=sse
+     QMAKE_CXXFLAGS += -march=pentium4 -msse2 -mfpmath=sse
+ }
+diff -up qtdeclarative-opensource-src-5.2.0/src/qml/jsruntime/qv4global_p.h.no_sse2 qtdeclarative-opensource-src-5.2.0/src/qml/jsruntime/qv4global_p.h
+--- qtdeclarative-opensource-src-5.2.0/src/qml/jsruntime/qv4global_p.h.no_sse2	2013-12-08 11:10:19.000000000 -0600
++++ qtdeclarative-opensource-src-5.2.0/src/qml/jsruntime/qv4global_p.h	2013-12-12 11:32:21.555865718 -0600
+@@ -45,6 +45,8 @@
+ #include <QtCore/qglobal.h>
+ #include <QString>
+ #include <qtqmlglobal.h>
++// To get __SSE2__ defined when building with MSVC
++#include <private/qsimd_p.h>
+ 
+ #if defined(Q_CC_MSVC)
+ #include <float.h>
+@@ -70,7 +72,7 @@ inline double trunc(double d) { return d
+ 
+ // White list architectures
+ 
+-#if defined(Q_PROCESSOR_X86)
++#if defined(Q_PROCESSOR_X86) && defined(__SSE2__)
+ #define V4_ENABLE_JIT
+ #elif defined(Q_PROCESSOR_X86_64)
+ #define V4_ENABLE_JIT


More information about the scm-commits mailing list