[6.0] c3d43744a Make unwind work under macos

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Jun 21 13:43:09 UTC 2024


commit c3d43744ac4b86600003395965ddd6c0cec6de1f
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Thu Oct 31 11:07:30 2019 +0900

    Make unwind work under macos

diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 4626eaaf2..eefacba6a 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -612,7 +612,7 @@ pan_backtrace(struct vsb *vsb)
 		unw_get_reg(&cursor, UNW_REG_SP, &sp);
 		unw_get_proc_name(&cursor, fname, sizeof(fname), &offp);
 		VSB_printf(vsb, "ip=0x%lx, sp=0x%lx <%s+0x%lx>\n", (long) ip,
-		    (long) sp, fname[0] ? fname : "<unknown>", offp);
+		    (long) sp, fname[0] ? fname : "<unknown>", (long)offp);
 	}
 
 	VSB_indent(vsb, -2);
diff --git a/configure.ac b/configure.ac
index f3024becd..9cc8a213b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -341,7 +341,14 @@ AC_ARG_WITH([unwind],
               [use libunwind to print stacktraces (use libexecinfo otherwise). Recommended on alpine linux. Defaults to no.])])
 
 if test "$with_unwind" = yes; then
-    PKG_CHECK_MODULES([LIBUNWIND], [libunwind])
+    case $target in
+    *-*-darwin*)
+        # Always present but .pc is not installed
+        ;;
+    *)
+        PKG_CHECK_MODULES([LIBUNWIND], [libunwind])
+        ;;
+    esac
     AC_DEFINE([WITH_UNWIND], [1],
               [Define to 1 to use libunwind instead of libexecinfo])
 else


More information about the varnish-commit mailing list