Skip to content

Revert "Guard unused llvm-libunwind symbols to avoid duplicates on Android"#128883

Merged
MichalStrehovsky merged 1 commit into
mainfrom
revert-128667-libunwind-ifdef
Jun 2, 2026
Merged

Revert "Guard unused llvm-libunwind symbols to avoid duplicates on Android"#128883
MichalStrehovsky merged 1 commit into
mainfrom
revert-128667-libunwind-ifdef

Conversation

@MichalStrehovsky
Copy link
Copy Markdown
Member

@MichalStrehovsky MichalStrehovsky commented Jun 2, 2026

Resolves #128866.

Reverts #128667

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

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

This PR reverts #128667, which had guarded unused llvm-libunwind symbols with a new _LIBUNWIND_NATIVEAOT define to avoid duplicate symbol conflicts on Android (NDK r29). The revert restores the prior approach of using _LIBUNWIND_DISABLE_ZERO_COST_APIS=1 to disable the _Unwind_XXX style APIs.

Changes:

  • Revert the _LIBUNWIND_NATIVEAOT guards in the vendored llvm-libunwind sources (libunwind.cpp, Unwind-EHABI.cpp) and drop the corresponding patch entry from llvm-libunwind-version.txt.
  • Restore -D_LIBUNWIND_DISABLE_ZERO_COST_APIS=1 (in place of -D_LIBUNWIND_NATIVEAOT=1) in src/coreclr/nativeaot/Runtime/CMakeLists.txt.
  • Remove the UnwindHelpers::FindUnwindSections wrapper and call libunwind::LocalAddressSpace::sThisAddressSpace.findUnwindSections directly from UnixNativeCodeManager.

Reviewed changes

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

Show a summary per file
File Description
src/native/external/llvm-libunwind/src/Unwind-EHABI.cpp Remove _LIBUNWIND_NATIVEAOT guard around EHABI C++ exception dispatch functions.
src/native/external/llvm-libunwind/src/libunwind.cpp Remove _LIBUNWIND_NATIVEAOT guard around the public unw_* API block.
src/native/external/llvm-libunwind-version.txt Drop the reverted commit reference from the applied-patches list.
src/coreclr/nativeaot/Runtime/unix/UnwindHelpers.h Remove now-unused FindUnwindSections declaration.
src/coreclr/nativeaot/Runtime/unix/UnwindHelpers.cpp Remove FindUnwindSections wrapper implementation.
src/coreclr/nativeaot/Runtime/unix/UnixNativeCodeManager.cpp Restore direct call into LocalAddressSpace::sThisAddressSpace.findUnwindSections.
src/coreclr/nativeaot/Runtime/CMakeLists.txt Replace _LIBUNWIND_NATIVEAOT define with _LIBUNWIND_DISABLE_ZERO_COST_APIS.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Note

This review was generated by Copilot.

🤖 Copilot Code Review — PR #128883

Holistic Assessment

Motivation: Justified. PR #128667 introduced _LIBUNWIND_NATIVEAOT guards that broke HardwareIntrinsics_General tests on Linux ARM NativeAOT (#128866). A revert is the correct response to a regression in outerloop CI.

Approach: Clean revert restoring the previous _LIBUNWIND_DISABLE_ZERO_COST_APIS approach. The change also correctly reverts the UnwindHelpers::FindUnwindSections wrapper back to direct LocalAddressSpace::sThisAddressSpace.findUnwindSections() usage, and removes the patch reference from llvm-libunwind-version.txt.

Summary: ✅ LGTM. This is a straightforward, complete revert of a commit that caused a regression. All 7 changed files correspond exactly to the inverse of PR #128667. The original Android NDK r29 symbol conflict issue will need to be re-addressed in a follow-up with a different approach that doesn't break ARM unwinding.


Detailed Findings

✅ Correctness — Revert is complete and accurate

All changes in PR #128667 are fully reverted:

  • CMakeLists.txt: _LIBUNWIND_NATIVEAOT_LIBUNWIND_DISABLE_ZERO_COST_APIS (the original define)
  • UnixNativeCodeManager.cpp: Restores direct LocalAddressSpace::sThisAddressSpace.findUnwindSections() call
  • UnwindHelpers.cpp/h: Removes the FindUnwindSections wrapper added in Guard unused llvm-libunwind symbols to avoid duplicates on Android #128667
  • libunwind.cpp and Unwind-EHABI.cpp: Removes _LIBUNWIND_NATIVEAOT guards
  • llvm-libunwind-version.txt: Removes the patch reference

No partial revert or leftover artifacts detected.

✅ Risk Assessment — Low risk

Reverting to a known-good state that was stable before #128667. The only risk is re-exposing the Android NDK r29 symbol conflict, which is a pre-existing issue that needs a different fix approach.

Generated by Code Review for issue #128883 · ● 1.6M ·

@MichalStrehovsky MichalStrehovsky enabled auto-merge (squash) June 2, 2026 09:10
@MichalStrehovsky MichalStrehovsky merged commit c7d8935 into main Jun 2, 2026
176 checks passed
@MichalStrehovsky MichalStrehovsky deleted the revert-128667-libunwind-ifdef branch June 2, 2026 09:47
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HardwareIntrinsics_General tests failing on Linux arm NAOT

3 participants