summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/arch/qatomic_armv6.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/arch/qatomic_armv6.h b/src/corelib/arch/qatomic_armv6.h
index b14ab3d636..b2ea85ada2 100644
--- a/src/corelib/arch/qatomic_armv6.h
+++ b/src/corelib/arch/qatomic_armv6.h
@@ -90,7 +90,10 @@ private:
template <typename T> struct QAtomicOps : QBasicAtomicOps<sizeof(T)>
{
- typedef T Type;
+ // this is GCC or GCC-like, so we can use extensions:
+ // force the alignment to be the size of the type, as on some ABIs the alignment
+ // of 64-bit types is 32-bit. We need proper alignment for LDREX / STREX.
+ typedef __attribute__((__aligned__(sizeof(T)))) T Type;
};
#ifndef Q_CC_RVCT