https://github.com/libunwind/libunwind/commit/6382d6f5c9d4d149989e47b20446f794365137c1

From 0f3f41a86842f2b19aa07af5242cb775ef9b20d3 Mon Sep 17 00:00:00 2001
From: "Jory A. Pratt" <anarchy@gentoo.org>
Date: Sat, 30 Jun 2018 22:44:22 -0500
Subject: [PATCH] Only include execinfo.h where avaliable

Signed-off-by: Jory A. Pratt <anarchy@gentoo.org>
---
 tests/test-coredump-unwind.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c
index 5254708..33f92b0 100644
--- a/tests/test-coredump-unwind.c
+++ b/tests/test-coredump-unwind.c
@@ -57,7 +57,9 @@
 #include <grp.h>
 
 /* For SIGSEGV handler code */
+#if HAVE_EXECINFO_H
 #include <execinfo.h>
+#endif
 #include <sys/ucontext.h>
 
 #include <libunwind-coredump.h>
@@ -202,7 +204,7 @@ void die_out_of_memory(void)
 /* End of utility logging functions */
 
 
-
+#if HAVE_EXECINFO_H
 static
 void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
 {
@@ -249,12 +251,14 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
 
   _exit(1);
 }
-
+#endif
 static void install_sigsegv_handler(void)
 {
   struct sigaction sa;
   memset(&sa, 0, sizeof(sa));
+#if HAVE_EXECINFO_H
   sa.sa_sigaction = handle_sigsegv;
+#endif
   sa.sa_flags = SA_SIGINFO;
   sigaction(SIGSEGV, &sa, NULL);
   sigaction(SIGILL, &sa, NULL);
-- 
2.18.0
