summaryrefslogtreecommitdiffstats
path: root/libunwind/test
diff options
context:
space:
mode:
authorSergej Jaskiewicz <jaskiewiczs@icloud.com>2019-12-06 17:26:35 +0300
committerSergej Jaskiewicz <jaskiewiczs@icloud.com>2019-12-11 04:27:04 +0300
commit57fc8ecdbaa7fbb1a13907ca3f7a3cb9f9459d27 (patch)
treef0ad5032122e8d49f9254af4b6210039ca8b4e4c /libunwind/test
parentbc24014b9765a454cb5214f4871451a41ffb7d29 (diff)
downloadbcm5719-llvm-57fc8ecdbaa7fbb1a13907ca3f7a3cb9f9459d27.tar.gz
bcm5719-llvm-57fc8ecdbaa7fbb1a13907ca3f7a3cb9f9459d27.zip
Reland "Enable `-funwind-tables` flag when building libunwind"
Summary: Relands https://reviews.llvm.org/D70815. The original commit set `CMAKE_TRY_COMPILE_TARGET_TYPE` to `STATIC_LIBRARY` globally in libunwind/CMakeLists.txt, which effectively disabled the linking step in CMake checks. This broke some builds (see 938c70b86c7d2165f8c28d5700e9c1ac1263307e). Here we set CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY only when checking for presence of the `-funwind-tables` flag, and then set it back to the original value so it doesn't affect other checks. Reviewers: mstorsjo, jfb Subscribers: mgorny, christof, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D71117
Diffstat (limited to 'libunwind/test')
-rw-r--r--libunwind/test/CMakeLists.txt1
-rw-r--r--libunwind/test/libunwind/test/config.py10
-rw-r--r--libunwind/test/lit.site.cfg.in1
-rw-r--r--libunwind/test/signal_frame.pass.cpp4
4 files changed, 14 insertions, 2 deletions
diff --git a/libunwind/test/CMakeLists.txt b/libunwind/test/CMakeLists.txt
index d902e3e8294..40d4acd4e8c 100644
--- a/libunwind/test/CMakeLists.txt
+++ b/libunwind/test/CMakeLists.txt
@@ -16,6 +16,7 @@ pythonize_bool(LIBCXX_ENABLE_SHARED)
pythonize_bool(LIBUNWIND_ENABLE_SHARED)
pythonize_bool(LIBUNWIND_ENABLE_THREADS)
pythonize_bool(LIBUNWIND_ENABLE_EXCEPTIONS)
+pythonize_bool(LIBUNWIND_USES_ARM_EHABI)
pythonize_bool(LIBUNWIND_USE_COMPILER_RT)
pythonize_bool(LIBUNWIND_BUILD_EXTERNAL_THREAD_LIBRARY)
set(LIBUNWIND_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
diff --git a/libunwind/test/libunwind/test/config.py b/libunwind/test/libunwind/test/config.py
index 05e3f3cc21f..41ca3f9b4a4 100644
--- a/libunwind/test/libunwind/test/config.py
+++ b/libunwind/test/libunwind/test/config.py
@@ -37,6 +37,8 @@ class Configuration(LibcxxConfiguration):
super(Configuration, self).configure_features()
if not self.get_lit_bool('enable_exceptions', True):
self.config.available_features.add('libcxxabi-no-exceptions')
+ if self.get_lit_bool('arm_ehabi', False):
+ self.config.available_features.add('libunwind-arm-ehabi')
def configure_compile_flags(self):
self.cxx.compile_flags += ['-DLIBUNWIND_NO_TIMER']
@@ -66,3 +68,11 @@ class Configuration(LibcxxConfiguration):
def configure_compile_flags_rtti(self):
pass
+
+ def configure_link_flags_cxx_library(self):
+ # libunwind tests should not link with libc++
+ pass
+
+ def configure_link_flags_abi_library(self):
+ # libunwind tests should not link with libc++abi
+ pass
diff --git a/libunwind/test/lit.site.cfg.in b/libunwind/test/lit.site.cfg.in
index 34da72ac106..37f90a90efd 100644
--- a/libunwind/test/lit.site.cfg.in
+++ b/libunwind/test/lit.site.cfg.in
@@ -19,6 +19,7 @@ config.executor = "@LIBUNWIND_EXECUTOR@"
config.libunwind_shared = @LIBUNWIND_ENABLE_SHARED@
config.enable_shared = @LIBCXX_ENABLE_SHARED@
config.enable_exceptions = @LIBUNWIND_ENABLE_EXCEPTIONS@
+config.arm_ehabi = @LIBUNWIND_USES_ARM_EHABI@
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.use_target = bool("@LIBUNWIND_TARGET_TRIPLE@")
diff --git a/libunwind/test/signal_frame.pass.cpp b/libunwind/test/signal_frame.pass.cpp
index a6f3f483bea..a899461fafb 100644
--- a/libunwind/test/signal_frame.pass.cpp
+++ b/libunwind/test/signal_frame.pass.cpp
@@ -9,6 +9,8 @@
// Ensure that functions marked as signal frames are reported as such.
+// UNSUPPORTED: libunwind-arm-ehabi
+
#include <assert.h>
#include <stdlib.h>
#include <libunwind.h>
@@ -20,9 +22,7 @@ void test() {
unw_getcontext(&uc);
unw_init_local(&cursor, &uc);
assert(unw_step(&cursor) > 0);
-#if !defined(_LIBUNWIND_ARM_EHABI)
assert(unw_is_signal_frame(&cursor));
-#endif
}
int main() {
OpenPOWER on IntegriCloud