1 From 9392d29bf0ad0390c6895933fdec0f690d2bdedf Mon Sep 17 00:00:00 2001
2 From: Alexey Brodkin <abrodkin@synopsys.com>
3 Date: Wed, 20 May 2015 10:53:59 +0300
4 Subject: [PATCH 2/2] Prevent unaligned access on ARC
6 As many other architectures ARC cores by default don't support
7 unaligned word access to data.
9 Even though it's possible to enable unaligned access to data in
10 ARC HS38 core (we're talking about configuration of core design)
11 to make sure Qt could be executed on any flavour of ARC fall-back
12 to byte-accesses is used.
14 Change-Id: I96068d40b449f11ba987ed1e5d5e44f493d1eb5f
16 This patch was submited in upstream Qt4 and if it ever gets accepted,
17 it should be removed from Buildroot.
19 https://codereview.qt-project.org/#/c/112668
21 src/3rdparty/webkit/Source/JavaScriptCore/runtime/UString.h | 2 +-
22 src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h | 13 ++++++++++++-
23 .../webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp | 2 +-
24 .../webkit/Source/JavaScriptCore/wtf/text/StringHash.h | 2 +-
25 4 files changed, 15 insertions(+), 4 deletions(-)
27 diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/runtime/UString.h b/src/3rdparty/webkit/Source/JavaScriptCore/runtime/UString.h
28 index 2d76809..ee9b7f0 100644
29 --- a/src/3rdparty/webkit/Source/JavaScriptCore/runtime/UString.h
30 +++ b/src/3rdparty/webkit/Source/JavaScriptCore/runtime/UString.h
31 @@ -202,7 +202,7 @@ struct UStringHash {
33 // FIXME: perhaps we should have a more abstract macro that indicates when
34 // going 4 bytes at a time is unsafe
35 -#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC)
36 +#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC) || CPU(ARC)
37 const UChar* aChars = a->characters();
38 const UChar* bChars = b->characters();
39 for (unsigned i = 0; i != aLength; ++i) {
40 diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h
41 index e8b03be..cd17e9c 100644
42 --- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h
43 +++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h
48 -#if CPU(ARM) || CPU(MIPS) || CPU(SH4)
49 +/* CPU(ARC) - ARC, any version*/
51 + || defined(__arc__) \
54 +#define WTF_CPU_ARC 1
55 +#if defined(__BIG_ENDIAN__)
56 +#define WTF_CPU_BIG_ENDIAN 1
60 +#if CPU(ARM) || CPU(MIPS) || CPU(SH4) || CPU(ARC)
61 #define WTF_CPU_NEEDS_ALIGNED_ACCESS 1
64 diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp
65 index 9dd655e..bd3ab95 100644
66 --- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp
67 +++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp
68 @@ -142,7 +142,7 @@ static inline bool equal(StringImpl* string, const UChar* characters, unsigned l
70 // FIXME: perhaps we should have a more abstract macro that indicates when
71 // going 4 bytes at a time is unsafe
72 -#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC)
73 +#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC) || CPU(ARC)
74 const UChar* stringCharacters = string->characters();
75 for (unsigned i = 0; i != length; ++i) {
76 if (*stringCharacters++ != *characters++)
77 diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/StringHash.h b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/StringHash.h
78 index 4637c3d..91cef81 100644
79 --- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/StringHash.h
80 +++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/StringHash.h
81 @@ -55,7 +55,7 @@ namespace WTF {
83 // FIXME: perhaps we should have a more abstract macro that indicates when
84 // going 4 bytes at a time is unsafe
85 -#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC)
86 +#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC) || CPU(ARC)
87 const UChar* aChars = a->characters();
88 const UChar* bChars = b->characters();
89 for (unsigned i = 0; i != aLength; ++i) {