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 72705 cbb285709139e8a9144d755a4130ece9e313d491
parent 72704 2fda596a9a3f48df6f31c65ab3c7f4e7674edb96
child 72706 08a813a4770991aa3b1062797c010533219c19a5
push id159
push usereakhgari@mozilla.com
push dateTue, 16 Aug 2011 17:53:11 +0000
treeherdermozilla-beta@8786e3e49240 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt
bugs643779
milestone7.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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