Check for libunwind in configure, and setup seh-unwind to have possible other future...
authorGeoff Norton <grompf@gmail.com>
Fri, 20 Feb 2015 16:32:03 +0000 (08:32 -0800)
committerGeoff Norton <grompf@gmail.com>
Fri, 20 Feb 2015 16:32:03 +0000 (08:32 -0800)
src/pal/src/config.h.in
src/pal/src/configure.cmake
src/pal/src/exception/seh-unwind.cpp

index 6a32a57..03f31a0 100644 (file)
@@ -13,6 +13,7 @@
 #cmakedefine01 HAVE_SYS_TIME_H
 #cmakedefine01 HAVE_PTHREAD_NP_H
 #cmakedefine01 HAVE_SYS_LWP_H
+#cmakedefine01 HAVE_LIBUNWIND_H
 
 #cmakedefine01 HAVE_KQUEUE
 #cmakedefine01 HAVE_GETPWUID_R
index 0da2498..9bfaa62 100644 (file)
@@ -16,6 +16,7 @@ check_include_files(crt_externs.h HAVE_CRT_EXTERNS_H)
 check_include_files(sys/time.h HAVE_SYS_TIME_H)
 check_include_files(pthread_np.h HAVE_PTHREAD_NP_H)
 check_include_files(sys/lwp.h HAVE_SYS_LWP_H)
+check_include_files(libunwind.h HAVE_LIBUNWIND_H)
 
 check_function_exists(kqueue HAVE_KQUEUE)
 check_function_exists(getpwuid_r HAVE_GETPWUID_R)
index b3b5d18..da4bed6 100644 (file)
@@ -28,8 +28,10 @@ Abstract:
 #include "pal/context.h"
 #include <dlfcn.h>
 #include <exception>
+#if HAVE_LIBUNWIND_H
 #define UNW_LOCAL_ONLY
 #include <libunwind.h>
+#endif
 
 //----------------------------------------------------------------------
 // Exception Handling ABI Level I: Base ABI
@@ -74,6 +76,7 @@ struct __cxa_exception
 // Virtual Unwinding
 //----------------------------------------------------------------------
 
+#if HAVE_LIBUNWIND_H
 #if UNWIND_CONTEXT_IS_UCONTEXT_T
 static void WinContextToUnwindContext(CONTEXT *winContext, unw_context_t *unwContext)
 {
@@ -195,6 +198,9 @@ BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextP
 
     return TRUE;
 }
+#else
+#error don't know how to unwind on this platform
+#endif
 
 #if _DEBUG
 //----------------------------------------------------------------------