Accepting request 251482 from KDE:Qt5

- Add sse2_nojit.patch: enable JIT and sse2 only on sse2 case
- Build QtQML module twice on ix86, without and with sse2 (sse2 library is placed to %_libdir/sse2/ (bnc#897758)


depends on sr#251413

OBS-URL: https://build.opensuse.org/request/show/251482
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtdeclarative?expand=0&rev=20
This commit is contained in:
Stephan Kulow 2014-09-25 07:33:21 +00:00 committed by Git OBS Bridge
parent 8f13e749d4
commit fca35fc28e
3 changed files with 64 additions and 3 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Sep 22 18:11:03 UTC 2014 - hrvoje.senjan@gmail.com
- Add sse2_nojit.patch: enable JIT and sse2 only on sse2 case
- Build QtQML module twice on ix86, without and with sse2 (sse2
library is placed to %_libdir/sse2/ (bnc#897758)
-------------------------------------------------------------------
Tue Sep 16 11:27:49 UTC 2014 - hrvoje.senjan@gmail.com

View File

@ -40,6 +40,8 @@ Patch2: 0003-Fix-crashes-when-calling-Array.sort-with-imperfect-s.patch
Patch3: 0004-QML-parse-.js-files-as-JavaScript-not-QML.patch
Patch4: 0005-Fix-crash-with-foreach-on-arguments-object.patch
Patch5: 0006-Move-syncTimer-measurment-to-the-correct-place.patch
# PATCH-FIX-OPENSUSE sse2_nojit.patch -- enable JIT and sse2 only on sse2 case
Patch100: sse2_nojit.patch
BuildRequires: fdupes
BuildRequires: libQt5Core-private-headers-devel >= %{version}
BuildRequires: libQt5Gui-private-headers-devel >= %{version}
@ -75,6 +77,7 @@ handling.
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch100 -p1
%package -n %libname
Summary: Qt 5 Declarative Library
@ -142,11 +145,33 @@ Examples for libqt5-qtdeclarative (quick/qml) modules.
#force the configure script to generate the forwarding headers (it checks whether .git directory exists)
mkdir .git
%endif
%qmake5
%make_jobs
mkdir -p %{_target_platform}
pushd %{_target_platform}
%qmake5 ..
popd
%make_jobs -C %{_target_platform}
%ifarch %ix86
# build libQt5Qml with no_sse2
mkdir -p %{_target_platform}-no_sse2
pushd %{_target_platform}-no_sse2
%qmake5 -config no_sse2 ..
make sub-src-clean
%make_jobs -C src/qml
popd
%endif
%install
%qmake5_install
%qmake5_install -C %{_target_platform}
%ifarch %ix86
mkdir -p %{buildroot}%{_libqt5_libdir}//sse2
mv %{buildroot}%{_libqt5_libdir}/libQt5Qml.so.5* %{buildroot}%{_libqt5_libdir}/sse2/
%qmake5_install -C %{_target_platform}-no_sse2/src/qml
%endif
find %{buildroot}/%{_libdir} -type f -name '*la' -print -exec perl -pi -e 's, -L%{_builddir}/\S+,,g' {} \;
find %{buildroot}/%{_libdir}/pkgconfig -type f -name '*pc' -print -exec perl -pi -e 's, -L%{_builddir}/\S+,,g' {} \;
# kill .la files
@ -177,6 +202,9 @@ popd
%defattr(-,root,root,755)
%doc LGPL_EXCEPTION.txt LICENSE.FDL LICENSE.GPL LICENSE.LGPL
%{_libqt5_libdir}/libQt5Q*.so.*
%ifarch %ix86
%{_libqt5_libdir}/sse2/libQt5Q*.so.*
%endif
%{_libqt5_archdatadir}/qml/QtQuick
%{_libqt5_archdatadir}/qml/QtQuick.2
%{_libqt5_archdatadir}/qml/QtQml/Models.2

26
sse2_nojit.patch Normal file
View File

@ -0,0 +1,26 @@
diff --git a/src/qml/jsruntime/jsruntime.pri b/src/qml/jsruntime/jsruntime.pri
index 72010d3..2bd5acb 100644
--- a/src/qml/jsruntime/jsruntime.pri
+++ b/src/qml/jsruntime/jsruntime.pri
@@ -107,7 +107,7 @@ SOURCES += \
# 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 --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h
index a00231c..2a8f5d3 100644
--- a/src/qml/jsruntime/qv4global_p.h
+++ b/src/qml/jsruntime/qv4global_p.h
@@ -75,7 +75,7 @@ inline double trunc(double d) { return d > 0 ? floor(d) : ceil(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