summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/qt5-qtdeclarative/APKBUILD7
-rw-r--r--user/qt5-qtdeclarative/pmmx.patch122
2 files changed, 125 insertions, 4 deletions
diff --git a/user/qt5-qtdeclarative/APKBUILD b/user/qt5-qtdeclarative/APKBUILD
index 3b9b56a89..38d6e1bb1 100644
--- a/user/qt5-qtdeclarative/APKBUILD
+++ b/user/qt5-qtdeclarative/APKBUILD
@@ -2,7 +2,7 @@
pkgname=qt5-qtdeclarative
_pkgname=${pkgname#qt5-}-opensource-src
pkgver=5.9.7
-pkgrel=0
+pkgrel=1
pkgdesc="Qt 5 - Qt Declarative and Qt Quick 2"
url="https://www.qt.io/"
arch="all"
@@ -11,6 +11,7 @@ makedepends="qt5-qtbase-dev libexecinfo-dev python3"
subpackages="$pkgname-dev"
source="https://download.qt.io/official_releases/qt/${pkgver%.*}/$pkgver/submodules/$_pkgname-$pkgver.tar.xz
add-execinfo.patch
+ pmmx.patch
python3.patch
"
@@ -18,17 +19,14 @@ _qt5_prefix=/usr/lib/qt5
builddir="$srcdir"/$_pkgname-$pkgver
build() {
- cd "$builddir"
qmake && make
}
check() {
- cd "$builddir"
make check
}
package() {
- cd "$builddir"
make install INSTALL_ROOT="$pkgdir"
mkdir -p "$pkgdir"/usr/bin/
@@ -39,4 +37,5 @@ package() {
sha512sums="bccddeca26c317083fcebc182dd3221dcbe9af665c502bfb636907f2c17a6edd8874a964910423c9eaa6e5c68bf5a13520193ba77f915be08ba1982348d2a9ee qtdeclarative-opensource-src-5.9.7.tar.xz
065ab2440fd0a81e76fe8873b0991929fad3d4189c8938e0205e94478a6cdce81ef710e3bad19cd5ca0b5ea0f8b3cd1b366969ddede51070496d1d02ace59220 add-execinfo.patch
+07bad5742bf00acadc6f2d5e1b8756b9545b95ad93d2b16646c0031abec881bfab6e1c39ca2f1b0a4e43d716518bd4380fd45995a9597d9ce1b51f88f9379176 pmmx.patch
c434ec3b3eaa8859cc3a3ce48d0299533428d94c998876e5735c210b25f89bc8509980cee0d96f2e68331540f95b5f1ec5e9745949d26367bde1d15bc7ac9081 python3.patch"
diff --git a/user/qt5-qtdeclarative/pmmx.patch b/user/qt5-qtdeclarative/pmmx.patch
new file mode 100644
index 000000000..a4ce84650
--- /dev/null
+++ b/user/qt5-qtdeclarative/pmmx.patch
@@ -0,0 +1,122 @@
+From 4950c366b12265f1ea390a6feb8dbbd0d850d206 Mon Sep 17 00:00:00 2001
+From: Guillem Jover <guillem@hadrons.org>
+Date: Mon, 12 Oct 2015 01:45:37 +0200
+Subject: [PATCH v2] Do not make lack of SSE2 support on x86-32 fatal
+
+When an x86-32 CPU does not have SSE2 support (which is the case for
+all AMD CPUs, and older Intel CPUs), fallback to use the interpreter,
+otherwise use the JIT engine.
+
+Even then, make the lack of SSE2 support on x86-32 fatal when trying
+to instantiate a JIT engine, which does require it.
+
+Refactor the required CPU support check into a new pair of privately
+exported functions to avoid duplicating the logic, and do so in
+functions instead of class members to avoid changing the class
+signatures.
+
+Version: 5.7.x
+Bug-Debian: https://bugs.debian.org/792594
+---
+ src/qml/jit/qv4isel_masm.cpp | 2 ++
+ src/qml/jit/qv4isel_masm_p.h | 18 ++++++++++++++++++
+ src/qml/jsruntime/qv4engine.cpp | 1 +
+ src/qml/qml/v8/qv8engine.cpp | 7 -------
+ tools/qmljs/qmljs.cpp | 7 +++----
+ 5 files changed, 24 insertions(+), 11 deletions(-)
+
+--- a/src/qml/jit/qv4isel_masm.cpp
++++ b/src/qml/jit/qv4isel_masm.cpp
+@@ -72,6 +72,8 @@ InstructionSelection<JITAssembler>::Inst
+ , compilationUnit(new CompilationUnit)
+ , qmlEngine(qmlEngine)
+ {
++ checkRequiredCpuSupport();
++
+ compilationUnit->codeRefs.resize(module->functions.size());
+ module->unitFlags |= QV4::CompiledData::Unit::ContainsMachineCode;
+ }
+--- a/src/qml/jit/qv4isel_masm_p.h
++++ b/src/qml/jit/qv4isel_masm_p.h
+@@ -60,6 +60,7 @@
+
+ #include <QtCore/QHash>
+ #include <QtCore/QStack>
++#include <private/qsimd_p.h>
+ #include <config.h>
+ #include <wtf/Vector.h>
+
+@@ -72,6 +73,23 @@ QT_BEGIN_NAMESPACE
+ namespace QV4 {
+ namespace JIT {
+
++Q_QML_PRIVATE_EXPORT inline bool hasRequiredCpuSupport()
++{
++#ifdef Q_PROCESSOR_X86_32
++ return qCpuHasFeature(SSE2);
++#else
++ return true;
++#endif
++}
++
++Q_QML_PRIVATE_EXPORT inline void checkRequiredCpuSupport()
++{
++#ifdef Q_PROCESSOR_X86_32
++ if (!qCpuHasFeature(SSE2))
++ qFatal("This program requires an X86 processor that supports SSE2 extension, at least a Pentium 4 or newer");
++#endif
++}
++
+ template <typename JITAssembler = Assembler<DefaultAssemblerTargetConfiguration>>
+ class Q_QML_EXPORT InstructionSelection:
+ protected IR::IRDecoder,
+--- a/src/qml/jsruntime/qv4engine.cpp
++++ b/src/qml/jsruntime/qv4engine.cpp
+@@ -159,6 +159,7 @@
+
+ #ifdef V4_ENABLE_JIT
+ static const bool forceMoth = !qEnvironmentVariableIsEmpty("QV4_FORCE_INTERPRETER") ||
++ !JIT::hasRequiredCpuSupport() ||
+ !OSAllocator::canAllocateExecutableMemory();
+ if (forceMoth) {
+ factory = new Moth::ISelFactory;
+--- a/src/qml/qml/v8/qv8engine.cpp
++++ b/src/qml/qml/v8/qv8engine.cpp
+@@ -64,7 +64,6 @@
+ #include <QtCore/qjsonvalue.h>
+ #include <QtCore/qdatetime.h>
+ #include <QtCore/qdatastream.h>
+-#include <private/qsimd_p.h>
+
+ #include <private/qv4value_p.h>
+ #include <private/qv4dateobject_p.h>
+@@ -129,12 +128,6 @@ QV8Engine::QV8Engine(QJSEngine* qq)
+ , m_xmlHttpRequestData(0)
+ , m_listModelData(0)
+ {
+-#ifdef Q_PROCESSOR_X86_32
+- if (!qCpuHasFeature(SSE2)) {
+- qFatal("This program requires an X86 processor that supports SSE2 extension, at least a Pentium 4 or newer");
+- }
+-#endif
+-
+ QML_MEMORY_SCOPE_STRING("QV8Engine::QV8Engine");
+ qMetaTypeId<QJSValue>();
+ qMetaTypeId<QList<int> >();
+--- a/tools/qmljs/qmljs.cpp
++++ b/tools/qmljs/qmljs.cpp
+@@ -92,11 +92,10 @@ int main(int argc, char *argv[])
+ enum {
+ use_masm,
+ use_moth
+- } mode;
++ } mode = use_moth;
+ #ifdef V4_ENABLE_JIT
+- mode = use_masm;
+-#else
+- mode = use_moth;
++ if (QV4::JIT::hasRequiredCpuSupport())
++ mode = use_masm;
+ #endif
+
+ bool runAsQml = false;