Skip to content

Haiku: Apply .NET-specific llvm-libunwind patches#126785

Merged
jkotas merged 2 commits intodotnet:mainfrom
trungnt2910:dev/trungnt2910/haiku-libunwind
Apr 18, 2026
Merged

Haiku: Apply .NET-specific llvm-libunwind patches#126785
jkotas merged 2 commits intodotnet:mainfrom
trungnt2910:dev/trungnt2910/haiku-libunwind

Conversation

@trungnt2910
Copy link
Copy Markdown
Contributor

.NET uses setRegister with 3 arguments, the last being a "location" for the register.

For calls without a known location, 0 is passed.

This updates the recent Haiku-specific call sites to setRegister to match what .NET uses.

Part of #55803.

.NET uses `setRegister` with 3 arguments, the last being a "location"
for the register.

For calls without a known location, `0` is passed.
Updated to include the patch at be5f98f
for Haiku-specific `llvm-libunwind` code.
Copilot AI review requested due to automatic review settings April 11, 2026 12:50
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Apr 11, 2026
@trungnt2910
Copy link
Copy Markdown
Contributor Author

trungnt2910 commented Apr 11, 2026

As mentioned here: #55803 (comment)

If this PR is approved, could you please merge instead of squashing/rebasing to retain the hash of the reference?

Thanks!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the vendored llvm-libunwind Haiku x86_64 sigreturn unwinding path to use the 3-argument setRegister(reg, value, location) form that .NET expects (passing 0 when no register location is tracked), and records the additional upstream patch reference.

Changes:

  • Update Haiku x86_64 stepThroughSigReturn() to pass an explicit location argument (0) to all _registers.setRegister(...) calls.
  • Add the corresponding dotnet/runtime patch reference to llvm-libunwind-version.txt.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/native/external/llvm-libunwind/src/UnwindCursor.hpp Fix Haiku sigreturn register restoration call sites to match the 3-arg setRegister API usage (with location = 0).
src/native/external/llvm-libunwind-version.txt Document the additional applied .NET patch commit for the vendored libunwind.

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Apr 18, 2026

/ba-g unrelated failures that have been fixed in main already

@jkotas jkotas merged commit 4f0a034 into dotnet:main Apr 18, 2026
163 of 181 checks passed
@jkotas
Copy link
Copy Markdown
Member

jkotas commented Apr 18, 2026

Ah I am sorry - I forgot to merge without squashing.

@trungnt2910
Copy link
Copy Markdown
Contributor Author

Yeah, was gonna mention - should I open another PR referencing the official commit hash?

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Apr 18, 2026

The commit with the patch is still going to be there, it just won't show up in the history. I do not think you need to do anything. It will be cleaned up during next llvm-unwind update where we merge the patches together.

@trungnt2910
Copy link
Copy Markdown
Contributor Author

The commit with the patch is still going to be there

I wonder though, will it be tied to dotnet/runtime, or will it disappear if, say, I delete my fork?

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Apr 18, 2026

or will it disappear if, say, I delete my fork?

It won't disappear. For example check dotnet/coreclr#10167 - very old PR, both the account and fork are deleted, but you can still see the individual commits.

@am11
Copy link
Copy Markdown
Member

am11 commented Apr 18, 2026

Yes, it's not a problem. It's just a little bit of extra work to find commit->PR. These become orphaned commits, but thanks to git blame, we can pinpoint to PR with two clicks. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-PAL-coreclr community-contribution Indicates that the PR has been added by a community member NO-SQUASH The PR should not be squashed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants