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

Alex Rønne Petersen via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 18 04:16:33 PST 2024


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

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`.

Note: I don't have commit access.

>From 279b29320b45b88ca110534f08ba627fe28016c2 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