[libunwind] [libunwind] Fix compilation for the x32 ABI. (PR #116608)

Alex Rønne Petersen via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 27 11:51:52 PST 2024


https://github.com/alexrp updated https://github.com/llvm/llvm-project/pull/116608

>From a6ec7f3cff4ae825a3be289636a4cf2c2e436f95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= <alex at alexrp.com>
Date: Mon, 18 Nov 2024 13:12:30 +0100
Subject: [PATCH] [libunwind] Fix compilation for the x32 ABI.

This would previously fail the static assertions in UnwindCursor.hpp due to
UnwindCursor's size not matching unw_cursor_t's size. As is done for MIPS N32,
this just declares the appropriate size in __libunwind_config.h.
---
 libunwind/include/__libunwind_config.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libunwind/include/__libunwind_config.h b/libunwind/include/__libunwind_config.h
index 028b9e3baa8065..bb7fe4c83a3c17 100644
--- a/libunwind/include/__libunwind_config.h
+++ b/libunwind/include/__libunwind_config.h
@@ -53,6 +53,9 @@
 #    else
 #      define _LIBUNWIND_CURSOR_SIZE 66
 #    endif
+#  elif defined(__ILP32__)
+#    define _LIBUNWIND_CONTEXT_SIZE 21
+#    define _LIBUNWIND_CURSOR_SIZE 28
 #  else
 #    define _LIBUNWIND_CONTEXT_SIZE 21
 #    define _LIBUNWIND_CURSOR_SIZE 33



More information about the cfe-commits mailing list