summaryrefslogtreecommitdiffstats
path: root/lib/libunwind/src
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2019-02-04 16:54:30 +0000
committerpatrick <patrick@openbsd.org>2019-02-04 16:54:30 +0000
commit7eed64eca19d93cd26421fb274e8122f37fa801c (patch)
treea6569517048137f1570c831cd23974d56e362c29 /lib/libunwind/src
parentMake gl_pathc, gl_matchc and gl_offs size_t in glob_t to match POSIX. (diff)
downloadwireguard-openbsd-7eed64eca19d93cd26421fb274e8122f37fa801c.tar.xz
wireguard-openbsd-7eed64eca19d93cd26421fb274e8122f37fa801c.zip
Import libunwind 7.0.1
Diffstat (limited to 'lib/libunwind/src')
-rw-r--r--lib/libunwind/src/CMakeLists.txt23
-rw-r--r--lib/libunwind/src/UnwindLevel1-gcc-ext.c14
-rw-r--r--lib/libunwind/src/UnwindLevel1.c2
-rw-r--r--lib/libunwind/src/assembly.h11
-rw-r--r--lib/libunwind/src/config.h6
5 files changed, 40 insertions, 16 deletions
diff --git a/lib/libunwind/src/CMakeLists.txt b/lib/libunwind/src/CMakeLists.txt
index 2d2ec130dfe..937159e2cb8 100644
--- a/lib/libunwind/src/CMakeLists.txt
+++ b/lib/libunwind/src/CMakeLists.txt
@@ -91,9 +91,9 @@ string(REPLACE ";" " " LIBUNWIND_C_FLAGS "${LIBUNWIND_C_FLAGS}")
string(REPLACE ";" " " LIBUNWIND_LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}")
set_property(SOURCE ${LIBUNWIND_CXX_SOURCES}
- APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_CXX_FLAGS} ${LIBUNWIND_CXX_FLAGS}")
+ APPEND_STRING PROPERTY COMPILE_FLAGS " ${LIBUNWIND_CXX_FLAGS}")
set_property(SOURCE ${LIBUNWIND_C_SOURCES}
- APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_C_FLAGS} ${LIBUNWIND_C_FLAGS}")
+ APPEND_STRING PROPERTY COMPILE_FLAGS " ${LIBUNWIND_C_FLAGS}")
# Add a object library that contains the compiled source files.
add_library(unwind_objects OBJECT ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
@@ -103,11 +103,12 @@ set_target_properties(unwind_objects
COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}"
POSITION_INDEPENDENT_CODE ON)
-set(LIBUNWIND_TARGETS)
-
# Build the shared library.
if (LIBUNWIND_ENABLE_SHARED)
add_library(unwind_shared SHARED $<TARGET_OBJECTS:unwind_objects>)
+ if(COMMAND llvm_setup_rpath)
+ llvm_setup_rpath(unwind_shared)
+ endif()
target_link_libraries(unwind_shared ${libraries})
set_target_properties(unwind_shared
PROPERTIES
@@ -115,7 +116,10 @@ if (LIBUNWIND_ENABLE_SHARED)
OUTPUT_NAME "unwind"
VERSION "1.0"
SOVERSION "1")
- list(APPEND LIBUNWIND_TARGETS "unwind_shared")
+ list(APPEND LIBUNWIND_BUILD_TARGETS "unwind_shared")
+ if (LIBUNWIND_INSTALL_SHARED_LIBRARY)
+ list(APPEND LIBUNWIND_INSTALL_TARGETS "unwind_shared")
+ endif()
endif()
# Build the static library.
@@ -126,14 +130,17 @@ if (LIBUNWIND_ENABLE_STATIC)
PROPERTIES
LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}"
OUTPUT_NAME "unwind")
- list(APPEND LIBUNWIND_TARGETS "unwind_static")
+ list(APPEND LIBUNWIND_BUILD_TARGETS "unwind_static")
+ if (LIBUNWIND_INSTALL_STATIC_LIBRARY)
+ list(APPEND LIBUNWIND_INSTALL_TARGETS "unwind_static")
+ endif()
endif()
# Add a meta-target for both libraries.
-add_custom_target(unwind DEPENDS ${LIBUNWIND_TARGETS})
+add_custom_target(unwind DEPENDS ${LIBUNWIND_BUILD_TARGETS})
if (LIBUNWIND_INSTALL_LIBRARY)
- install(TARGETS ${LIBUNWIND_TARGETS}
+ install(TARGETS ${LIBUNWIND_INSTALL_TARGETS}
LIBRARY DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind
ARCHIVE DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind)
endif()
diff --git a/lib/libunwind/src/UnwindLevel1-gcc-ext.c b/lib/libunwind/src/UnwindLevel1-gcc-ext.c
index 10619ba431d..38f141e381d 100644
--- a/lib/libunwind/src/UnwindLevel1-gcc-ext.c
+++ b/lib/libunwind/src/UnwindLevel1-gcc-ext.c
@@ -33,9 +33,9 @@ _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object) {
(void *)exception_object,
(long)exception_object->unwinder_cache.reserved1);
#else
- _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld",
+ _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%" PRIdPTR,
(void *)exception_object,
- (long)exception_object->private_1);
+ (intptr_t)exception_object->private_1);
#endif
#if defined(_LIBUNWIND_ARM_EHABI)
@@ -92,9 +92,9 @@ _LIBUNWIND_EXPORT void *_Unwind_FindEnclosingFunction(void *pc) {
unw_proc_info_t info;
unw_getcontext(&uc);
unw_init_local(&cursor, &uc);
- unw_set_reg(&cursor, UNW_REG_IP, (unw_word_t)(long) pc);
+ unw_set_reg(&cursor, UNW_REG_IP, (unw_word_t)(intptr_t) pc);
if (unw_get_proc_info(&cursor, &info) == UNW_ESUCCESS)
- return (void *)(long) info.start_ip;
+ return (void *)(intptr_t) info.start_ip;
else
return NULL;
}
@@ -190,14 +190,14 @@ _LIBUNWIND_EXPORT const void *_Unwind_Find_FDE(const void *pc,
unw_proc_info_t info;
unw_getcontext(&uc);
unw_init_local(&cursor, &uc);
- unw_set_reg(&cursor, UNW_REG_IP, (unw_word_t)(long) pc);
+ unw_set_reg(&cursor, UNW_REG_IP, (unw_word_t)(intptr_t) pc);
unw_get_proc_info(&cursor, &info);
bases->tbase = (uintptr_t)info.extra;
bases->dbase = 0; // dbase not used on Mac OS X
bases->func = (uintptr_t)info.start_ip;
_LIBUNWIND_TRACE_API("_Unwind_Find_FDE(pc=%p) => %p", pc,
- (void *)(long) info.unwind_info);
- return (void *)(long) info.unwind_info;
+ (void *)(intptr_t) info.unwind_info);
+ return (void *)(intptr_t) info.unwind_info;
}
/// Returns the CFA (call frame area, or stack pointer at start of function)
diff --git a/lib/libunwind/src/UnwindLevel1.c b/lib/libunwind/src/UnwindLevel1.c
index 518577b1d50..04d62b8950f 100644
--- a/lib/libunwind/src/UnwindLevel1.c
+++ b/lib/libunwind/src/UnwindLevel1.c
@@ -287,7 +287,7 @@ unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor,
// If there is a personality routine, tell it we are unwinding.
if (frameInfo.handler != 0) {
__personality_routine p =
- (__personality_routine)(long)(frameInfo.handler);
+ (__personality_routine)(intptr_t)(frameInfo.handler);
_LIBUNWIND_TRACE_UNWINDING(
"unwind_phase2_forced(ex_ojb=%p): calling personality function %p",
(void *)exception_object, (void *)(uintptr_t)p);
diff --git a/lib/libunwind/src/assembly.h b/lib/libunwind/src/assembly.h
index ba099cbe809..07b08f94bd8 100644
--- a/lib/libunwind/src/assembly.h
+++ b/lib/libunwind/src/assembly.h
@@ -18,6 +18,17 @@
#if defined(__powerpc64__)
#define SEPARATOR ;
+#define PPC64_OFFS_SRR0 0
+#define PPC64_OFFS_CR 272
+#define PPC64_OFFS_XER 280
+#define PPC64_OFFS_LR 288
+#define PPC64_OFFS_CTR 296
+#define PPC64_OFFS_VRSAVE 304
+#define PPC64_OFFS_FP 312
+#define PPC64_OFFS_V 824
+#ifdef _ARCH_PWR8
+#define PPC64_HAS_VMX
+#endif
#elif defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__)
#define SEPARATOR @
#elif defined(__arm64__)
diff --git a/lib/libunwind/src/config.h b/lib/libunwind/src/config.h
index 2a2b5cf9265..1a7a30665dd 100644
--- a/lib/libunwind/src/config.h
+++ b/lib/libunwind/src/config.h
@@ -72,8 +72,14 @@
(!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
+#endif
#if defined(NDEBUG) && defined(_LIBUNWIND_IS_BAREMETAL)
#define _LIBUNWIND_ABORT(msg) \