Bug 1113930 - Move __libc_stack_end related code block from StackWalk.cpp in a non-OSX section. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 22 Dec 2015 16:58:21 +0900
changeset 317676 500961db039b155507d69ab2b56a7e084ae4804c
parent 317675 fedf404c32d9759b27e8493dc03413ed37bd1224
child 317677 acdd7908ca0ff345c509dd9e2c0395bb00277289
push id8746
push userananuti@gmail.com
push dateSun, 27 Dec 2015 23:03:33 +0000
reviewersfroydnj
bugs1113930, 989499
milestone46.0a1
Bug 1113930 - Move __libc_stack_end related code block from StackWalk.cpp in a non-OSX section. r=froydnj Bug 989499 unfortunately moved it to a OSX-only section, which broke using __libc_stack_end, which is Linux-specific (glibc, really).
mozglue/misc/StackWalk.cpp
--- a/mozglue/misc/StackWalk.cpp
+++ b/mozglue/misc/StackWalk.cpp
@@ -42,33 +42,33 @@ static CriticalAddress gCriticalAddress;
   (defined(XP_DARWIN) && \
    (defined(__i386) || defined(__ppc__) || defined(HAVE__UNWIND_BACKTRACE)))
 
 #define MOZ_STACKWALK_SUPPORTS_LINUX \
   (defined(linux) && \
    ((defined(__GNUC__) && (defined(__i386) || defined(PPC))) || \
     defined(HAVE__UNWIND_BACKTRACE)))
 
-#if MOZ_STACKWALK_SUPPORTS_MACOSX
-#include <pthread.h>
-#include <sys/errno.h>
-#ifdef MOZ_WIDGET_COCOA
-#include <CoreServices/CoreServices.h>
-#endif
-
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
 #define HAVE___LIBC_STACK_END 1
 #else
 #define HAVE___LIBC_STACK_END 0
 #endif
 
 #if HAVE___LIBC_STACK_END
 extern MOZ_EXPORT void* __libc_stack_end; // from ld-linux.so
 #endif
 
+#if MOZ_STACKWALK_SUPPORTS_MACOSX
+#include <pthread.h>
+#include <sys/errno.h>
+#ifdef MOZ_WIDGET_COCOA
+#include <CoreServices/CoreServices.h>
+#endif
+
 typedef void
 malloc_logger_t(uint32_t aType,
                 uintptr_t aArg1, uintptr_t aArg2, uintptr_t aArg3,
                 uintptr_t aResult, uint32_t aNumHotFramesToSkip);
 extern malloc_logger_t* malloc_logger;
 
 static void
 stack_callback(uint32_t aFrameNumber, void* aPc, void* aSp, void* aClosure)