Bug 643779 - Allow to build nsDebugImpl.cpp on ARMv4T. r=dougt
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 01 Jul 2011 10:42:47 +0200
changeset 72190 cbb285709139e8a9144d755a4130ece9e313d491
parent 72189 2fda596a9a3f48df6f31c65ab3c7f4e7674edb96
child 72191 08a813a4770991aa3b1062797c010533219c19a5
push idunknown
push userunknown
push dateunknown
reviewersdougt
bugs643779
milestone7.0a1
Bug 643779 - Allow to build nsDebugImpl.cpp on ARMv4T. r=dougt
xpcom/base/nsDebugImpl.cpp
--- a/xpcom/base/nsDebugImpl.cpp
+++ b/xpcom/base/nsDebugImpl.cpp
@@ -395,17 +395,26 @@ RealBreak()
   ::DebugBreak();
 #elif defined(XP_OS2)
    asm("int $3");
 #elif defined(XP_MACOSX)
    raise(SIGTRAP);
 #elif defined(__GNUC__) && (defined(__i386__) || defined(__i386) || defined(__x86_64__))
    asm("int $3");
 #elif defined(__arm__)
-   asm("BKPT #0");
+   asm(
+#ifdef __ARM_ARCH_4T__
+/* ARMv4T doesn't support the BKPT instruction, so if the compiler target
+ * is ARMv4T, we want to ensure the assembler will understand that ARMv5T
+ * instruction, while keeping the resulting object tagged as ARMv4T.
+ */
+       ".arch armv5t\n"
+       ".object_arch armv4t\n"
+#endif
+       "BKPT #0");
 #elif defined(SOLARIS)
 #if defined(__i386__) || defined(__i386) || defined(__x86_64__)
    asm("int $3");
 #else
    raise(SIGTRAP);
 #endif
 #else
 #warning do not know how to break on this platform