From 36015334f9ee86b997fc5c0deb4964184f87648f Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Fri, 1 Dec 2017 15:19:54 +0200 Subject: igt: Make dependency on libunwind mandatory With Android support gone there is not much reason for keeping libunwind dependency optional. This also deals (cheaply!) with ifdefs covering huge portions of code, removing a placement minefield. Cc: Tvrtko Ursulin Cc: Chris Wilson Signed-off-by: Arkadiusz Hiler Reviewed-by: Chris Wilson --- lib/igt_core.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'lib/igt_core.c') diff --git a/lib/igt_core.c b/lib/igt_core.c index de9269b0..03fa6e4e 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -71,6 +71,9 @@ #include "igt_sysfs.h" #include "igt_rc.h" +#define UNW_LOCAL_ONLY +#include + #ifdef HAVE_LIBGEN_H #include /* for basename() on Solaris */ #endif @@ -1173,10 +1176,6 @@ static void write_stderr(const char *str) __write_stderr(str, strlen(str)); } -#ifdef HAVE_LIBUNWIND -#define UNW_LOCAL_ONLY -#include - static void print_backtrace(void) { unw_cursor_t cursor; @@ -1371,7 +1370,6 @@ static void print_backtrace_sig_safe(void) } } -#endif void __igt_fail_assert(const char *domain, const char *file, const int line, const char *func, const char *assertion, @@ -1394,9 +1392,7 @@ void __igt_fail_assert(const char *domain, const char *file, const int line, va_end(args); } -#ifdef HAVE_LIBUNWIND print_backtrace(); -#endif if (run_under_gdb()) abort(); @@ -1876,9 +1872,8 @@ static void fatal_sig_handler(int sig) igt_exitcode = 128 + sig; failed_one = true; -#ifdef HAVE_LIBUNWIND print_backtrace_sig_safe(); -#endif + if (in_subtest) exit_subtest("CRASH"); } -- cgit v1.2.3