[tor-commits] [tor-browser/tor-browser-60.0.1esr-8.0-1] Bug 1449835 - Do not compile Windows x64 Crash Test Assembly for MinGW. r=ccorcoran, r=froydnj, a=jcristau

gk at torproject.org gk at torproject.org
Thu Jun 14 12:19:10 UTC 2018


commit cffd026e94e42915cf925a0d81fe8bd6eab9e78e
Author: Tom Ritter <tom at mozilla.com>
Date:   Wed May 16 13:03:48 2018 -0500

    Bug 1449835 - Do not compile Windows x64 Crash Test Assembly for MinGW. r=ccorcoran, r=froydnj, a=jcristau
    
    The assembly file uses the wrong syntax and MinGW cannot compile it.
    
    (Also, gcc doesn't recognize it, because it ends in .asm and not .s.)
---
 toolkit/crashreporter/test/moz.build         |  7 ++++---
 toolkit/crashreporter/test/nsTestCrasher.cpp | 15 ++++++++-------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/toolkit/crashreporter/test/moz.build b/toolkit/crashreporter/test/moz.build
old mode 100644
new mode 100755
index 34900d09f09b..5b98ff9a58d5
--- a/toolkit/crashreporter/test/moz.build
+++ b/toolkit/crashreporter/test/moz.build
@@ -25,9 +25,10 @@ SOURCES += [
 ]
 
 if CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CPU_ARCH'] == 'x86_64':
-    SOURCES += [
-        'win64UnwindInfoTests.asm',
-    ]
+    if CONFIG['CC_TYPE'] != 'gcc':
+        SOURCES += [
+            'win64UnwindInfoTests.asm',
+        ]
 
 if CONFIG['CC_TYPE'] == 'clang-cl':
     SOURCES['ExceptionThrower.cpp'].flags += [
diff --git a/toolkit/crashreporter/test/nsTestCrasher.cpp b/toolkit/crashreporter/test/nsTestCrasher.cpp
old mode 100644
new mode 100755
index 3c478efa4d8a..0729382fcd10
--- a/toolkit/crashreporter/test/nsTestCrasher.cpp
+++ b/toolkit/crashreporter/test/nsTestCrasher.cpp
@@ -1,6 +1,7 @@
 #include "mozilla/Assertions.h"
 
 #include <stdio.h>
+#include <map>
 
 #include "nscore.h"
 #include "mozilla/Unused.h"
@@ -45,7 +46,7 @@ void PureVirtualCall()
 }
 
 extern "C" {
-#if XP_WIN && HAVE_64BIT_BUILD
+#if XP_WIN && HAVE_64BIT_BUILD && !defined(__MINGW32__)
   // Implementation in win64unwindInfoTests.asm
   uint64_t x64CrashCFITest_NO_MANS_LAND(uint64_t returnpfn, void*);
   uint64_t x64CrashCFITest_Launcher(uint64_t returnpfn, void* testProc);
@@ -59,7 +60,7 @@ extern "C" {
   uint64_t x64CrashCFITest_SAVE_XMM128_FAR(uint64_t returnpfn, void*);
   uint64_t x64CrashCFITest_EPILOG(uint64_t returnpfn, void*);
   uint64_t x64CrashCFITest_EOF(uint64_t returnpfn, void*);
-#endif // XP_WIN && HAVE_64BIT_BUILD
+#endif // XP_WIN && HAVE_64BIT_BUILD && !defined(__MINGW32__)
 }
 
 // Keep these in sync with CrashTestUtils.jsm!
@@ -82,7 +83,7 @@ const int16_t CRASH_X64CFI_SAVE_XMM128_FAR = 18;
 const int16_t CRASH_X64CFI_EPILOG         = 19;
 const int16_t CRASH_X64CFI_EOF            = 20;
 
-#if XP_WIN && HAVE_64BIT_BUILD
+#if XP_WIN && HAVE_64BIT_BUILD && !defined(__MINGW32__)
 
 typedef decltype(&x64CrashCFITest_UnknownOpcode) win64CFITestFnPtr_t;
 
@@ -152,7 +153,7 @@ void Crash(int16_t how)
     ThrowException();
     break;
   }
-#if XP_WIN && HAVE_64BIT_BUILD
+#if XP_WIN && HAVE_64BIT_BUILD && !defined(__MINGW32__)
   case CRASH_X64CFI_UNKNOWN_OPCODE:
   case CRASH_X64CFI_PUSH_NONVOL:
   case CRASH_X64CFI_ALLOC_SMALL:
@@ -172,7 +173,7 @@ void Crash(int16_t how)
     pfnLauncher(0, pfnTest);
     break;
   }
-#endif // XP_WIN && HAVE_64BIT_BUILD
+#endif // XP_WIN && HAVE_64BIT_BUILD && !defined(__MINGW32__)
   default:
     break;
   }
@@ -211,7 +212,7 @@ void TryOverrideExceptionHandler()
 
 extern "C" NS_EXPORT uint32_t
 GetWin64CFITestFnAddrOffset(int16_t fnid) {
-#if XP_WIN && HAVE_64BIT_BUILD
+#if XP_WIN && HAVE_64BIT_BUILD && !defined(__MINGW32__)
   // fnid uses the same constants as Crash().
   // Returns the RVA of the requested function.
   // Returns 0 on failure.
@@ -223,5 +224,5 @@ GetWin64CFITestFnAddrOffset(int16_t fnid) {
   return ((uint64_t)m[fnid]) - moduleBase;
 #else
   return 0;
-#endif // XP_WIN && HAVE_64BIT_BUILD
+#endif // XP_WIN && HAVE_64BIT_BUILD && !defined(__MINGW32__)
 }





More information about the tor-commits mailing list