Skip to contentSkip to conversation

qt: add patch fixing build failure on ARMv8 in 32-bit mode

PATCH New Thomas Petazzoni 2 participants 4 messages Sep 8, 2017 – Oct 16, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qt: add patch fixing build failure on ARMv8 in 32-bit mode

The Qt package currently fails to build on ARMv8 cores in 32-bit mode (for example, if you select ARM and then Cortex-A53), because the ARM atomic operation implementation in Qt checks if we're on ARMv7, then on ARMv6, and otherwise falls back to an ARMv5 implementation. The latter uses the swp instruction, which doesn't exist on ARMv8, causing a build failure.

To solve this, we simply add a patch that uses the ARMv7 atomic operations for ARMv8-A.

There is no autobuilder reference because we don't have any ARMv8 32-bit configuration in the autobuilders.

---
Peter: this should go to 2017.02.x, the problem was reported on IRC by ivychend who is using 2017.02.5.

---
 ...-arch-qatomic_arm.h-fix-build-on-ARMv8-32.patch | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 package/qt/0013-src-corelib-arch-qatomic_arm.h-fix-build-on-ARMv8-32.patch
package/qt/0013-src-corelib-arch-qatomic_arm.h-fix-build-on-ARMv8-32.patch new file +37 -0
new file mode 100644
index 0000000000..645041acfe
@@ -0,0 +1,37 @@
+From 2281fa50f6e13278d3fd4f028377b8249b7b3cdb Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Fri, 8 Sep 2017 09:06:54 +0200
+Subject: [PATCH] src/corelib/arch/qatomic_arm.h: fix build on ARMv8 32-bit
+
+The Qt build fails on ARMv8 32-bit because it falls back to using the
+ARMv5 code that uses the swp instruction, which no longer exists:
+
+/tmp/ccSxVIzw.s: Assembler messages:
+/tmp/ccSxVIzw.s:127: Error: swp{b} use is obsoleted for ARMv8 and later
+/tmp/ccSxVIzw.s:190: Error: swp{b} use is obsoleted for ARMv8 and later
+
+So, this commit adjusts the ARM atomic code to assume ARMv8 is similar
+to ARMv7.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ src/corelib/arch/qatomic_arm.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/corelib/arch/qatomic_arm.h b/src/corelib/arch/qatomic_arm.h
+index 77cd66f272..e011929d3e 100644
+--- a/src/corelib/arch/qatomic_arm.h
++++ b/src/corelib/arch/qatomic_arm.h
+@@ -47,7 +47,8 @@ QT_BEGIN_HEADER
+ #if defined(__ARM_ARCH_7__) \
+     || defined(__ARM_ARCH_7A__) \
+     || defined(__ARM_ARCH_7R__) \
+-    || defined(__ARM_ARCH_7M__)
++    || defined(__ARM_ARCH_7M__) \
++    || defined(__ARM_ARCH_8A__)
+ # define QT_ARCH_ARMV7
+ QT_BEGIN_INCLUDE_HEADER
+ # include "QtCore/qatomic_armv7.h"
+-- 
+2.13.5
+
Signature · 1 line
2.13.5
#1 lore raw

PATCH 1/1 qt: add patch fixing build failure on ARMv8 in 32-bit mode

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

The Qt package currently fails to build on ARMv8 cores in 32-bit mode (for example, if you select ARM and then Cortex-A53), because the ARM atomic operation implementation in Qt checks if we're on ARMv7, then on ARMv6, and otherwise falls back to an ARMv5 implementation. The latter uses the swp instruction, which doesn't exist on ARMv8, causing a build failure.

Quoted 8 lines

To solve this, we simply add a patch that uses the ARMv7 atomic operations for ARMv8-A.

There is no autobuilder reference because we don't have any ARMv8 32-bit configuration in the autobuilders.

Committed, thanks.

Quoted 3 lines

---
Peter: this should go to 2017.02.x, the problem was reported on IRC by ivychend who is using 2017.02.5.

I'll cherry pick it to 2017.02.x as well this weekend, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 qt: add patch fixing build failure on ARMv8 in 32-bit mode

In reply to Thomas Petazzoni
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

The Qt package currently fails to build on ARMv8 cores in 32-bit mode (for example, if you select ARM and then Cortex-A53), because the ARM atomic operation implementation in Qt checks if we're on ARMv7, then on ARMv6, and otherwise falls back to an ARMv5 implementation. The latter uses the swp instruction, which doesn't exist on ARMv8, causing a build failure.

To solve this, we simply add a patch that uses the ARMv7 atomic operations for ARMv8-A.

Quoted 8 lines

There is no autobuilder reference because we don't have any ARMv8 32-bit configuration in the autobuilders.

---
Peter: this should go to 2017.02.x, the problem was reported on IRC by ivychend who is using 2017.02.5.

Committed to 2017.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 qt: add patch fixing build failure on ARMv8 in 32-bit mode

In reply to Thomas Petazzoni
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

The Qt package currently fails to build on ARMv8 cores in 32-bit mode (for example, if you select ARM and then Cortex-A53), because the ARM atomic operation implementation in Qt checks if we're on ARMv7, then on ARMv6, and otherwise falls back to an ARMv5 implementation. The latter uses the swp instruction, which doesn't exist on ARMv8, causing a build failure.

To solve this, we simply add a patch that uses the ARMv7 atomic operations for ARMv8-A.

Quoted 8 lines

There is no autobuilder reference because we don't have any ARMv8 32-bit configuration in the autobuilders.

---
Peter: this should go to 2017.02.x, the problem was reported on IRC by ivychend who is using 2017.02.5.

Committed to 2017.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard