Skip to content

Track upstreaming llvm-libunwind patches #72655

@am11

Description

@am11

We have made several llvm libunwind patches for NativeAOT, since its initial bring up: dotnet/corert#2293. The collective patches are in the following two commits on top of upstream's latest version (as of this moment) 14.0.6 release:

Apply https://github.com/dotnet/runtime/commit/e57194552327bccaf2b45a9190f0e6e1289472e4
Apply https://github.com/dotnet/runtime/commit/db7ed089a9e20a391a53e0b547f95dc8bf916765

It would be great (on multiple fronts) if we upstream those patches via LLVM code review platform of choice; Phabricator (https://llvm.org/docs/Phabricator.html). It will require some additional work for other architectures which llvm-libunwind supports (such as s390x and RISCV), to make them ready to upstream. At the moment, it is relatively easier to upstream patches since we are on the latest release.


unw_get_save_loc API

One of the key additions in our local patches is the implementation of unw_get_save_loc, which was scoped to memory locations, but does not cover register locations. The original commit was dotnet/corert@c6571c6 and v14.0.6 state can be extracted from e571945.

Moreover, unw_get_save_loc is the API which we test in coreclr PAL introspection code (src/coreclr/pal/src/configure.cmake), and based on which we decide whether to use the pinning fallback in GC. If the memory-location-only patch gets upstreamed (without first implementing register locations support), we would probably need to improve our introspection to detect the exact capability we need out of this API for GC; currently HP libunwind (the recommended variant for coreclr PAL) has support for both memory and registers location, which eventually gives us granular control over object lifetime in the GC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions