kumquat-buildroot/package/qt/0007-Prevent-unaligned-access-on-ARC.patch
Alexey Brodkin 474d39991b qt: fix execution on ARC
Even though Qt4 could be built for ARC cores during execution
of Qt4 applications on target issues will happen.

Most notable is will be segfaults due to unaligned access to data,
especially in WebKit applications.

Both patches were submitted upstream and if they ever get accepted
they should be removed from Buildroot.

https://codereview.qt-project.org/#/c/112667
https://codereview.qt-project.org/#/c/112668

[Thomas: renumber patches.]

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Anton Kolesov <akolesov@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-11 00:47:54 +02:00

93 lines
4.0 KiB
Diff

From 9392d29bf0ad0390c6895933fdec0f690d2bdedf Mon Sep 17 00:00:00 2001
From: Alexey Brodkin <abrodkin@synopsys.com>
Date: Wed, 20 May 2015 10:53:59 +0300
Subject: [PATCH 2/2] Prevent unaligned access on ARC
As many other architectures ARC cores by default don't support
unaligned word access to data.
Even though it's possible to enable unaligned access to data in
ARC HS38 core (we're talking about configuration of core design)
to make sure Qt could be executed on any flavour of ARC fall-back
to byte-accesses is used.
Change-Id: I96068d40b449f11ba987ed1e5d5e44f493d1eb5f
This patch was submited in upstream Qt4 and if it ever gets accepted,
it should be removed from Buildroot.
https://codereview.qt-project.org/#/c/112668
---
src/3rdparty/webkit/Source/JavaScriptCore/runtime/UString.h | 2 +-
src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h | 13 ++++++++++++-
.../webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp | 2 +-
.../webkit/Source/JavaScriptCore/wtf/text/StringHash.h | 2 +-
4 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/runtime/UString.h b/src/3rdparty/webkit/Source/JavaScriptCore/runtime/UString.h
index 2d76809..ee9b7f0 100644
--- a/src/3rdparty/webkit/Source/JavaScriptCore/runtime/UString.h
+++ b/src/3rdparty/webkit/Source/JavaScriptCore/runtime/UString.h
@@ -202,7 +202,7 @@ struct UStringHash {
// FIXME: perhaps we should have a more abstract macro that indicates when
// going 4 bytes at a time is unsafe
-#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC)
+#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC) || CPU(ARC)
const UChar* aChars = a->characters();
const UChar* bChars = b->characters();
for (unsigned i = 0; i != aLength; ++i) {
diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h
index e8b03be..cd17e9c 100644
--- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h
+++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h
@@ -369,7 +369,18 @@
#endif /* ARM */
-#if CPU(ARM) || CPU(MIPS) || CPU(SH4)
+/* CPU(ARC) - ARC, any version*/
+#if defined(arc) \
+ || defined(__arc__) \
+ || defined(ARC) \
+ || defined(_ARC_)
+#define WTF_CPU_ARC 1
+#if defined(__BIG_ENDIAN__)
+#define WTF_CPU_BIG_ENDIAN 1
+#endif
+#endif
+
+#if CPU(ARM) || CPU(MIPS) || CPU(SH4) || CPU(ARC)
#define WTF_CPU_NEEDS_ALIGNED_ACCESS 1
#endif
diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp
index 9dd655e..bd3ab95 100644
--- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp
+++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp
@@ -142,7 +142,7 @@ static inline bool equal(StringImpl* string, const UChar* characters, unsigned l
// FIXME: perhaps we should have a more abstract macro that indicates when
// going 4 bytes at a time is unsafe
-#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC)
+#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC) || CPU(ARC)
const UChar* stringCharacters = string->characters();
for (unsigned i = 0; i != length; ++i) {
if (*stringCharacters++ != *characters++)
diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/StringHash.h b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/StringHash.h
index 4637c3d..91cef81 100644
--- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/StringHash.h
+++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/StringHash.h
@@ -55,7 +55,7 @@ namespace WTF {
// FIXME: perhaps we should have a more abstract macro that indicates when
// going 4 bytes at a time is unsafe
-#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC)
+#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC) || CPU(ARC)
const UChar* aChars = a->characters();
const UChar* bChars = b->characters();
for (unsigned i = 0; i != aLength; ++i) {
--
2.1.0