[PATCH] Proper arm defines.

Riku Voipio riku.voipio at iki.fi
Mon Aug 27 15:28:51 UTC 2007


Forced packing is only needed on oldabi arm
Set middle-endian floats only for little-endian oldabi arm
set big-endian define for future bigendian arm porters.
Update comments to reflect the change

---
 JavaScriptCore/kjs/ustring.h        |    4 ++--
 JavaScriptCore/wtf/Platform.h       |    7 +++++++
 WebCore/platform/DeprecatedString.h |    4 ++--
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/JavaScriptCore/kjs/ustring.h b/JavaScriptCore/kjs/ustring.h
index fbfd638..f8311e7 100644
--- a/JavaScriptCore/kjs/ustring.h
+++ b/JavaScriptCore/kjs/ustring.h
@@ -32,9 +32,9 @@
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 
-/* On ARM some versions of GCC don't pack structures by default so sizeof(UChar)
+/* On some ARM platforms GCC won't pack structures by default so sizeof(UChar)
    will end up being != 2 which causes crashes since the code depends on that. */
-#if COMPILER(GCC) && PLATFORM(ARM)
+#if COMPILER(GCC) && PLATFORM(FORCE_PACK)
 #define PACK_STRUCT __attribute__((packed))
 #else
 #define PACK_STRUCT
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index 533230e..dca8351 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -130,8 +130,15 @@
 #if   defined(arm) \
    || defined(__arm__)
 #define WTF_PLATFORM_ARM 1
+#if defined(__ARMEB__)
+#define WTF_PLATFORM_BIG_ENDIAN 1
+#elif !defined(__ARM_EABI__) && !defined(__ARMEB__)
 #define WTF_PLATFORM_MIDDLE_ENDIAN 1
 #endif
+#if !defined(__ARM_EABI__)
+#define WTF_PLATFORM_FORCE_PACK 1
+#endif
+#endif
 
 /* PLATFORM(X86) */
 #if   defined(__i386__) \
diff --git a/WebCore/platform/DeprecatedString.h b/WebCore/platform/DeprecatedString.h
index c9ee76c..01366f2 100644
--- a/WebCore/platform/DeprecatedString.h
+++ b/WebCore/platform/DeprecatedString.h
@@ -32,9 +32,9 @@
 
 #include <ctype.h>
 
-/* On ARM some versions of GCC don't pack structures by default so sizeof(DeprecatedChar)
+/* On some ARM platforms GCC won't pack structures by default so sizeof(DeprecatedChar)
    will end up being != 2 which causes crashes since the code depends on that. */
-#if COMPILER(GCC) && PLATFORM(ARM)
+#if COMPILER(GCC) && PLATFORM(FORCE_PACK)
 #define PACK_STRUCT __attribute__((packed))
 #else
 #define PACK_STRUCT
-- 
1.5.2.3


-- 
"rm -rf" only sounds scary if you don't have backups



More information about the Pkg-webkit-maintainers mailing list