summaryrefslogtreecommitdiffstats
path: root/package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch
diff options
context:
space:
mode:
authorVicente Olivert Riera <Vincent.Riera@imgtec.com>2017-03-09 17:03:15 +0000
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-03-09 21:31:08 +0100
commit80fbef58533ad6b3ea7e24dbd1a7f165e9177e9d (patch)
tree44c644b7875ae105789317a37c542019a8065dfb /package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch
parentd9fee6b286798d27f45dd6ca6e4b5aabf0cc658d (diff)
downloadbuildroot-80fbef58533ad6b3ea7e24dbd1a7f165e9177e9d.tar.gz
buildroot-80fbef58533ad6b3ea7e24dbd1a7f165e9177e9d.zip
qt5base: fix compilation error with gcc-4.8
Add a patch to fix a compilation error when using gcc-4.8. Bug report: https://bugreports.qt.io/browse/QTBUG-59399 Patch sent upstream: https://codereview.qt-project.org/#/c/187980/ Fixes: http://autobuild.buildroot.net/results/2ac/2ac16335d16cd53cceeabda8f963c9b288a9a1c8/ Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch')
-rw-r--r--package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch b/package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch
new file mode 100644
index 0000000000..3a43584eeb
--- /dev/null
+++ b/package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch
@@ -0,0 +1,65 @@
+From c5d7425f8ad391112758db161e3e08f18dc9d299 Mon Sep 17 00:00:00 2001
+From: Marc Mutz <marc.mutz@kdab.com>
+Date: Thu, 26 May 2016 08:30:26 +0200
+Subject: [PATCH] QAtomic: pass explicit failure mode to
+ std::atomic::compare_exchange_strong
+
+... in an attempt to avoid GCC 4.8 errors such as
+
+ bits/atomic_base.h:577:70: error: failure memory model cannot be stronger than success memory model for '__atomic_compare_exchange'
+ return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
+ ^
+
+as seen on Android.
+
+Change-Id: If046e735888cf331d2d6506d8d5ca9aa7402f9ad
+[Bug report: https://bugreports.qt.io/browse/QTBUG-59399
+ Patch sent upstream: https://codereview.qt-project.org/#/c/187980/]
+Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.org>
+---
+ src/corelib/arch/qatomic_cxx11.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/corelib/arch/qatomic_cxx11.h b/src/corelib/arch/qatomic_cxx11.h
+index bb49aae..d6731ec 100644
+--- a/src/corelib/arch/qatomic_cxx11.h
++++ b/src/corelib/arch/qatomic_cxx11.h
+@@ -153,7 +153,7 @@ template <typename X> struct QAtomicOps
+ template <typename T>
+ static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
+ {
+- bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed);
++ bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed, std::memory_order_relaxed);
+ if (currentValue)
+ *currentValue = expectedValue;
+ return tmp;
+@@ -162,7 +162,7 @@ template <typename X> struct QAtomicOps
+ template <typename T>
+ static bool testAndSetAcquire(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
+ {
+- bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acquire);
++ bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acquire, std::memory_order_acquire);
+ if (currentValue)
+ *currentValue = expectedValue;
+ return tmp;
+@@ -171,7 +171,7 @@ template <typename X> struct QAtomicOps
+ template <typename T>
+ static bool testAndSetRelease(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
+ {
+- bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_release);
++ bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_release, std::memory_order_relaxed);
+ if (currentValue)
+ *currentValue = expectedValue;
+ return tmp;
+@@ -180,7 +180,7 @@ template <typename X> struct QAtomicOps
+ template <typename T>
+ static bool testAndSetOrdered(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
+ {
+- bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acq_rel);
++ bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acq_rel, std::memory_order_acquire);
+ if (currentValue)
+ *currentValue = expectedValue;
+ return tmp;
+--
+1.7.10.4
+
OpenPOWER on IntegriCloud