qt5base: fix compilation error with gcc-4.8
PATCH v2 1/1 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/
---
Changes v1->v2: fix typo in commit message.
...s-explicit-failure-mode-to-std-atomic-com.patch | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch
package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch new file +71 -0
@@ -0,0 +1,71 @@ +QAtomic: pass explicit failure mode to std::atomic::compare_exchange_strong + +This patch fixes a compilation error when building qt5base with gcc-4.8. + +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 <[email protected]> + +From c5d7425f8ad391112758db161e3e08f18dc9d299 Mon Sep 17 00:00:00 2001 +From: Marc Mutz <[email protected]> +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 +--- + 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 +
Signature · 1 line
2.10.2
PATCH v2 1/1 qt5base: fix compilation error with gcc-4.8
Hello,
Quoted 9 lines · Vicente Olivert Riera
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 <[email protected]>
I've applied, but after changing the formatting of the patch, see below.
Quoted 6 lines
package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch new file +0
-0
package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch line 8
Quoted 8 lines
package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch new file +8
-0@@ -0,0 +1,71 @@ +QAtomic: pass explicit failure mode to std::atomic::compare_exchange_strong + +This patch fixes a compilation error when building qt5base with gcc-4.8. + +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 <[email protected]>
All this stuff should go...
Quoted 6 lines
package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch new file +6
-0+ +From c5d7425f8ad391112758db161e3e08f18dc9d299 Mon Sep 17 00:00:00 2001 +From: Marc Mutz <[email protected]> +Date: Thu, 26 May 2016 08:30:26 +0200 +Subject: [PATCH] QAtomic: pass explicit failure mode to + std::atomic::compare_exchange_strong
package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch line 24
Quoted 10 lines
package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch new file +10
-0+ +... 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
... here.
Otherwise, the patch can no longer be applied by Git using git am, which makes the fact of having Git formatted patches pretty useless.
Thanks a lot for chasing and fixing this issue!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH v2 1/1 qt5base: fix compilation error with gcc-4.8
Hello,
Quoted 1 line · Thomas Petazzoni
I've applied, but after changing the formatting of the patch, see below.
Peter, I forgot: this one should be applied to the LTS branch.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH v2 1/1 qt5base: fix compilation error with gcc-4.8
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Hello,
Quoted 1 line · Thomas Petazzoni
I've applied, but after changing the formatting of the patch, see below.
Peter, I forgot: this one should be applied to the LTS branch.
Committed to 2017.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 1/1 qt5base: fix compilation error with gcc-4.8
In reply to Thomas PetazzoniHi Thomas,
Quoted 51 lines · Thomas Petazzoni
Hello,
Quoted 9 lines · Vicente Olivert Riera
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 <[email protected]>I've applied, but after changing the formatting of the patch, see below.
Quoted 6 lines
package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch new file +0
-0package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch line 8
Quoted 8 lines
package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch new file +8
-0@@ -0,0 +1,71 @@ +QAtomic: pass explicit failure mode to std::atomic::compare_exchange_strong + +This patch fixes a compilation error when building qt5base with gcc-4.8. + +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 <[email protected]>All this stuff should go...
Quoted 6 lines
package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch new file +6
-0+ +From c5d7425f8ad391112758db161e3e08f18dc9d299 Mon Sep 17 00:00:00 2001 +From: Marc Mutz <[email protected]> +Date: Thu, 26 May 2016 08:30:26 +0200 +Subject: [PATCH] QAtomic: pass explicit failure mode to + std::atomic::compare_exchange_strongpackage/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch line 24
Quoted 10 lines
package/qt5/qt5base/5.8.0/0003-QAtomic-pass-explicit-failure-mode-to-std-atomic-com.patch new file +10
-0+ +... 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... here.
Quoted 2 lines
Otherwise, the patch can no longer be applied by Git using git am, which makes the fact of having Git formatted patches pretty useless.
Oh, I see. Thanks, I'll remember that for the next time :-)
Vincent
Quoted 5 lines
Thanks a lot for chasing and fixing this issue!
Thomas