-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move libunwind directories to src/native/external #64043
Conversation
Tagging subscribers to this area: @dotnet/area-system-reflection-metadata Issue Details
|
9ce16a4
to
12aa0a2
Compare
e0c1a39
to
37b5816
Compare
cc @jkotas, @janvorli, this is a continuation of #62673. I haven't moved llvm-libunwind (https://github.com/dotnet/runtime/tree/f3e4e768d10dc502b0a7e9c417ae269dcf75dbc7/src/coreclr/nativeaot/libunwind) to |
Yes, it would be nice to unify it if possible. IIRC, macOS pushed us to use llvm libunwind. HP libunwind did not work on macOS and the macOS-provided libunwind did not work either. I do not remember the details. Does HP libunwind work on macOS? |
Ah, that's still the case. We are only using remote unwind feature of HP libunwind on macOS (and FreeBSD) in CoreCLR, for out-of-context unwinding. For the rest of functionality, we use OS provided libunwind (which Apple contributed as llvm-libunwind to LLVM project in 2013). We could use same mechanism in NativeAOT since both libunwind libraries have matching headers. I haven't looked at NativeAOT usage of libunwind in depth, but from a quick search, @janvorli implemented ps - Mono uses it's own implementation https://github.com/dotnet/runtime/blob/b85a435/src/mono/mono/utils/mono-stack-unwinding.h / https://github.com/dotnet/runtime/blob/b85a435/src/mono/mono/utils/mono-context.h. It might be possible to switch NativeAOT to Mono's implementation and get rid of llvm-libunwind dependency that way. |
That's funny, I have completely forgotten that I have added the |
These are all the llvm-libunwind patches (based on |
I’m not sure if I’m qualified to speak with authority, but LLVM libunwind for ARM a bit undeveloped. Overall code looks like it is half done. I was able only fix gross issue like this llvm/llvm-project@08a5ac3 In EHABI handling. For me this code is a bit scary |
Support status related to architectures we are supporting in .NET runtime (and the upcoming ones, like loongarch64, riscv64): Mono unwinder - all archs (except loongarch64? shouldn't be hard to implement since both MIPS and RISC-V are supported) If mono unwinder (currently supporting: xarch, armarch, s390x, mips, riscv etc.) suffice the stack unwinding requirements of coreclr and nativeaot (i.e. something equivalent to |
I have discussed this with the Mono folks in the past. Mono unwinder is incomplete - it only handles the unwind sequences that Mono emits, it is not a general purpose unwinder. |
I think then this PR is ready for review as-is. We can move llvm-libunwind tree under |
3858aa7
to
5610f6f
Compare
Resolved merge conflicts, green CI. 🌴 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just few missing licensing headers in files that are now internal to our repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
* Move libunwind directories to src/native/external * Move extra additions to single directory * Extract coreclr configs in libunwind.cmake * Reapply upstream patches * Fixups
src/coreclr/pal/src/libunwind
->src/native/external/libunwind
src/coreclr/pal/src/libunwind_mac
->src/native/external/libunwind_extras/mac
src/coreclr/pal/src/libunwind/libunwind-version.txt
->src/native/external/libunwind-version.txt
src/coreclr/pal/src/libunwind/src/oop
->src/native/external/libunwind_extras/oop
libunwind_mac
andoop
directories)src/native/external/libunwind.cmake
and reverted cmake files in vendor directory to upstream's original state (same structure is used for other external libs).