0008-Prevent-unaligned-access-on-ARC.patch 4.0 KB

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