From dde76ae5f7f74f9173650d4b420ed44e183b1337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 27 Apr 2026 10:16:02 +0200 Subject: [PATCH] libunwind: unregress x32 and mips n32 build https://github.com/llvm/llvm-project/issues/194228 --- lib/libunwind/src/AddressSpace.hpp | 3 ++- lib/libunwind/src/DwarfParser.hpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libunwind/src/AddressSpace.hpp b/lib/libunwind/src/AddressSpace.hpp index 52477b16b355aa2c513c95ceb26ad67567be55f5..01185eb53c4ff40b81b351bf58d525f90782845c 100644 --- a/lib/libunwind/src/AddressSpace.hpp +++ b/lib/libunwind/src/AddressSpace.hpp @@ -666,7 +666,8 @@ inline bool LocalAddressSpace::findUnwindSections( return true; } #endif - dl_iterate_cb_data cb_data = {this, &info, targetAddr}; + // zig patch: https://github.com/llvm/llvm-project/issues/194228 + dl_iterate_cb_data cb_data = {this, &info, static_cast(targetAddr)}; int found = dl_iterate_phdr(findUnwindSectionsByPhdr, &cb_data); return static_cast(found); #endif diff --git a/lib/libunwind/src/DwarfParser.hpp b/lib/libunwind/src/DwarfParser.hpp index 22de49023cb4529dcd2cecde7e585b3f0b51caae..635f8369541af0b4cf9160050e8d9b85c0aca3cb 100644 --- a/lib/libunwind/src/DwarfParser.hpp +++ b/lib/libunwind/src/DwarfParser.hpp @@ -473,11 +473,12 @@ bool CFI_Parser::parseFDEInstructions( pint_t pcoffset; }; + // zig patch: https://github.com/llvm/llvm-project/issues/194228 ParseInfo parseInfoArray[] = { {cieInfo.cieInstructions, cieInfo.cieStart + cieInfo.cieLength, (pint_t)(-1)}, {fdeInfo.fdeInstructions, fdeInfo.fdeStart + fdeInfo.fdeLength, - upToPC - fdeInfo.pcStart}}; + static_cast(upToPC) - fdeInfo.pcStart}}; for (const auto &info : parseInfoArray) { pint_t p = info.instructions; -- 2.54.0