fix build, use better -config no_sse2 approach

This commit is contained in:
Rex Dieter 2013-12-12 12:19:42 -06:00
parent e0be313347
commit 82f00b71e8
3 changed files with 49 additions and 45 deletions

View File

@ -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}

View File

@ -1,29 +0,0 @@
diff -up qtdeclarative-opensource-src-5.2.0-rc1/src/qml/jsruntime/jsruntime.pri.fedora_i686_flags qtdeclarative-opensource-src-5.2.0-rc1/src/qml/jsruntime/jsruntime.pri
--- qtdeclarative-opensource-src-5.2.0-rc1/src/qml/jsruntime/jsruntime.pri.fedora_i686_flags 2013-11-26 19:02:16.000000000 -0600
+++ qtdeclarative-opensource-src-5.2.0-rc1/src/qml/jsruntime/jsruntime.pri 2013-12-10 10:27:16.082852640 -0600
@@ -92,9 +92,12 @@ 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) {
+CONFIG(NO_I386_JIT) {
+ DEFINES += NO_I386_JIT
+} else {
QMAKE_CFLAGS += -march=pentium4 -msse2 -mfpmath=sse
QMAKE_CXXFLAGS += -march=pentium4 -msse2 -mfpmath=sse
-}
+}}
valgrind {
DEFINES += V4_USE_VALGRIND
diff -up qtdeclarative-opensource-src-5.2.0-rc1/src/qml/jsruntime/qv4global_p.h.fedora_i686_flags qtdeclarative-opensource-src-5.2.0-rc1/src/qml/jsruntime/qv4global_p.h
--- qtdeclarative-opensource-src-5.2.0-rc1/src/qml/jsruntime/qv4global_p.h.fedora_i686_flags 2013-11-26 19:02:16.000000000 -0600
+++ qtdeclarative-opensource-src-5.2.0-rc1/src/qml/jsruntime/qv4global_p.h 2013-12-10 10:02:14.360839311 -0600
@@ -84,7 +84,7 @@ inline double trunc(double d) { return d
// Black list some platforms
#if defined(V4_ENABLE_JIT)
-#if defined(Q_OS_IOS) || defined(Q_OS_WIN64) || defined(Q_OS_WINRT)
+#if defined(Q_OS_IOS) || defined(Q_OS_WIN64) || defined(Q_OS_WINRT) || defined(NO_I386_JIT)
# undef V4_ENABLE_JIT
#endif
#endif

View File

@ -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