mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Support using llvm-libunwind
This commit adds support for using llvm-libunwind for kernels built using llvm and clang. The two differences are that the largest register index is given by _LIBUNWIND_HIGHEST_DWARF_REGISTER, we need to check whether the register is a floating point register and the prototype for unw_regname takes the unwind cursor as the first argument. Reviewed-by: Rob Norris <robn@despairlabs.com> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Sebastian Pauka <me@spauka.se> Closes #17230
This commit is contained in:
@@ -34,6 +34,22 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_LIBUNWIND], [
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
dnl LLVM includes it's own libunwind library, which
|
||||
dnl defines the highest numbered register in a different
|
||||
dnl way, and has an incompatible unw_resname function.
|
||||
AC_MSG_CHECKING([whether libunwind is llvm libunwind])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#include <libunwind.h>
|
||||
#if !defined(_LIBUNWIND_HIGHEST_DWARF_REGISTER)
|
||||
#error "_LIBUNWIND_HIGHEST_DWARF_REGISTER is not defined"
|
||||
#endif
|
||||
], [])], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(IS_LIBUNWIND_LLVM, 1, [libunwind is llvm libunwind])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
AX_RESTORE_FLAGS
|
||||
], [
|
||||
AS_IF([test "x$with_libunwind" = "xyes"], [
|
||||
|
||||
Reference in New Issue
Block a user