summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2016-09-03 18:42:13 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2016-09-03 18:42:13 +0000
commit940ce6799daf66194503830c1315ee21d760d3a5 (patch)
tree3f1a3d5eb4e0ab7c307f6560fa5794b202dc1142 /lib
parentc374bcfcce5ec91b66810aa7deecebfcdb8b6a14 (diff)
Import libunwind 3.9.0
Diffstat (limited to 'lib')
-rw-r--r--lib/libunwind/src/config.h126
1 files changed, 43 insertions, 83 deletions
diff --git a/lib/libunwind/src/config.h b/lib/libunwind/src/config.h
index fc7fd646707..a50222f7c90 100644
--- a/lib/libunwind/src/config.h
+++ b/lib/libunwind/src/config.h
@@ -6,7 +6,7 @@
// Source Licenses. See LICENSE.TXT for details.
//
//
-// Defines macros used within libunwind project.
+// Defines macros used within libuwind project.
//
//===----------------------------------------------------------------------===//
@@ -16,7 +16,6 @@
#include <assert.h>
#include <stdio.h>
-#include <stdint.h>
#include <stdlib.h>
// Define static_assert() unless already defined by compiler.
@@ -32,65 +31,51 @@
// Platform specific configuration defines.
#ifdef __APPLE__
#if defined(FOR_DYLD)
- #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND
+ #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 1
+ #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 0
+ #define _LIBUNWIND_SUPPORT_DWARF_INDEX 0
#else
- #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND
+ #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 1
#define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
- #endif
-#elif defined(_WIN32)
- #ifdef __SEH__
- #define _LIBUNWIND_SUPPORT_SEH_UNWIND 1
- #else
- #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
+ #define _LIBUNWIND_SUPPORT_DWARF_INDEX 0
#endif
#else
#if defined(__ARM_DWARF_EH__) || !defined(__arm__)
+ #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 0
#define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
#define _LIBUNWIND_SUPPORT_DWARF_INDEX 1
- #endif
-#endif
-
-#if defined(_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS)
- #define _LIBUNWIND_EXPORT
- #define _LIBUNWIND_HIDDEN
-#else
- #if !defined(__ELF__) && !defined(__MACH__)
- #define _LIBUNWIND_EXPORT __declspec(dllexport)
- #define _LIBUNWIND_HIDDEN
#else
- #define _LIBUNWIND_EXPORT __attribute__((visibility("default")))
- #define _LIBUNWIND_HIDDEN __attribute__((visibility("hidden")))
+ #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 0
+ #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 0
+ #define _LIBUNWIND_SUPPORT_DWARF_INDEX 0
#endif
#endif
+// FIXME: these macros are not correct for COFF targets
+#define _LIBUNWIND_EXPORT __attribute__((visibility("default")))
+#define _LIBUNWIND_HIDDEN __attribute__((visibility("hidden")))
+
#if (defined(__APPLE__) && defined(__arm__)) || defined(__USING_SJLJ_EXCEPTIONS__)
-#define _LIBUNWIND_BUILD_SJLJ_APIS
+#define _LIBUNWIND_BUILD_SJLJ_APIS 1
+#else
+#define _LIBUNWIND_BUILD_SJLJ_APIS 0
#endif
-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
-#define _LIBUNWIND_SUPPORT_FRAME_APIS
+#if defined(__i386__) || defined(__x86_64__)
+#define _LIBUNWIND_SUPPORT_FRAME_APIS 1
+#else
+#define _LIBUNWIND_SUPPORT_FRAME_APIS 0
#endif
#if defined(__i386__) || defined(__x86_64__) || \
- defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) || \
(!defined(__APPLE__) && defined(__arm__)) || \
(defined(__arm64__) || defined(__aarch64__)) || \
- defined(__mips__)
-#if !defined(_LIBUNWIND_BUILD_SJLJ_APIS)
-#define _LIBUNWIND_BUILD_ZERO_COST_APIS
-#endif
-#endif
-
-#if defined(__powerpc64__) && defined(_ARCH_PWR8)
-#define PPC64_HAS_VMX
+ (defined(__APPLE__) && defined(__mips__))
+#define _LIBUNWIND_BUILD_ZERO_COST_APIS 1
+#else
+#define _LIBUNWIND_BUILD_ZERO_COST_APIS 0
#endif
-#if defined(NDEBUG) && defined(_LIBUNWIND_IS_BAREMETAL)
-#define _LIBUNWIND_ABORT(msg) \
- do { \
- abort(); \
- } while (0)
-#else
#define _LIBUNWIND_ABORT(msg) \
do { \
fprintf(stderr, "libunwind: %s %s:%d - %s\n", __func__, __FILE__, \
@@ -98,65 +83,40 @@
fflush(stderr); \
abort(); \
} while (0)
-#endif
-
-#if defined(NDEBUG) && defined(_LIBUNWIND_IS_BAREMETAL)
-#define _LIBUNWIND_LOG0(msg)
-#define _LIBUNWIND_LOG(msg, ...)
-#else
-#define _LIBUNWIND_LOG0(msg) \
- fprintf(stderr, "libunwind: " msg "\n")
-#define _LIBUNWIND_LOG(msg, ...) \
- fprintf(stderr, "libunwind: " msg "\n", __VA_ARGS__)
-#endif
-
-#if defined(NDEBUG)
- #define _LIBUNWIND_LOG_IF_FALSE(x) x
-#else
- #define _LIBUNWIND_LOG_IF_FALSE(x) \
- do { \
- bool _ret = x; \
- if (!_ret) \
- _LIBUNWIND_LOG("" #x " failed in %s", __FUNCTION__); \
- } while (0)
-#endif
+#define _LIBUNWIND_LOG(msg, ...) fprintf(stderr, "libuwind: " msg, __VA_ARGS__)
// Macros that define away in non-Debug builds
#ifdef NDEBUG
#define _LIBUNWIND_DEBUG_LOG(msg, ...)
#define _LIBUNWIND_TRACE_API(msg, ...)
- #define _LIBUNWIND_TRACING_UNWINDING (0)
- #define _LIBUNWIND_TRACING_DWARF (0)
+ #define _LIBUNWIND_TRACING_UNWINDING 0
#define _LIBUNWIND_TRACE_UNWINDING(msg, ...)
- #define _LIBUNWIND_TRACE_DWARF(...)
+ #define _LIBUNWIND_LOG_NON_ZERO(x) x
#else
#ifdef __cplusplus
extern "C" {
#endif
extern bool logAPIs();
extern bool logUnwinding();
- extern bool logDWARF();
#ifdef __cplusplus
}
#endif
#define _LIBUNWIND_DEBUG_LOG(msg, ...) _LIBUNWIND_LOG(msg, __VA_ARGS__)
- #define _LIBUNWIND_TRACE_API(msg, ...) \
- do { \
- if (logAPIs()) \
- _LIBUNWIND_LOG(msg, __VA_ARGS__); \
- } while (0)
+ #define _LIBUNWIND_LOG_NON_ZERO(x) \
+ do { \
+ int _err = x; \
+ if ( _err != 0 ) \
+ _LIBUNWIND_LOG("" #x "=%d in %s", _err, __FUNCTION__); \
+ } while (0)
+ #define _LIBUNWIND_TRACE_API(msg, ...) \
+ do { \
+ if ( logAPIs() ) _LIBUNWIND_LOG(msg, __VA_ARGS__); \
+ } while(0)
+ #define _LIBUNWIND_TRACE_UNWINDING(msg, ...) \
+ do { \
+ if ( logUnwinding() ) _LIBUNWIND_LOG(msg, __VA_ARGS__); \
+ } while(0)
#define _LIBUNWIND_TRACING_UNWINDING logUnwinding()
- #define _LIBUNWIND_TRACING_DWARF logDWARF()
- #define _LIBUNWIND_TRACE_UNWINDING(msg, ...) \
- do { \
- if (logUnwinding()) \
- _LIBUNWIND_LOG(msg, __VA_ARGS__); \
- } while (0)
- #define _LIBUNWIND_TRACE_DWARF(...) \
- do { \
- if (logDWARF()) \
- fprintf(stderr, __VA_ARGS__); \
- } while (0)
#endif
#ifdef __cplusplus
@@ -165,7 +125,7 @@
#if defined(_LIBUNWIND_IS_NATIVE_ONLY)
# define COMP_OP ==
#else
-# define COMP_OP <=
+# define COMP_OP <
#endif
template <typename _Type, typename _Mem>
struct check_fit {