[libunwind] [libunwind] Add initial ARM64EC support (PR #138583)

Jacek Caban via cfe-commits cfe-commits at lists.llvm.org
Mon May 5 13:48:34 PDT 2025


cjacek wrote:

This is enough to pass most tests, except for forced unwind. I suspect that test requires a similar change to #137949. ARM64EC modules can contain SEH in both x86_64 format (for x86_64 code, accessible through PE headers, this should already work) and ARM format (for ARM64 code, accessible through CHPE metadata, which is not yet implemented). I haven’t looked into that part in detail yet.

`__libunwind_Registers_x86_64_jumpto` can be skipped, as the SEH cursor already uses `RtlRestoreContext`. If we were to implement it, it would be more complex than on other targets, when jumping to x86 code, we’d need to hand off execution to the emulator. The simplest way to handle this would be to implement the entire function
in C and delegate to `RtlRestoreContext`.

Due to the additional requirements for symbol mangling and unmangled aliases on ARM64EC, the `WEAK_ALIAS` macro isn't suitable in its current form. While it could be extended to support this, keeping `WEAK_ALIAS` simple and containing the complexity within the ARM64EC-specific code seemed like the cleaner approach.


https://github.com/llvm/llvm-project/pull/138583


More information about the cfe-commits mailing list