Skip to content

[linker] Restrict globalization symbol alias to MonoVM. Fixes #26876 - #26903

Open
rolfbjarne wants to merge 2 commits into
mainfrom
dev/rolf/nativeaot-invariant-globalization-a44
Open

rolfbjarne wants to merge 2 commits into
mainfrom
dev/rolf/nativeaot-invariant-globalization-a44

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

ListExportedSymbols treats System.Globalization.Native as an alias for symbols provided by libmonosgen-2.0. Applying that exception to NativeAOT forces references to globalization functions even when invariant globalization omits their native library, causing undefined-symbol errors during native linking.

Limit the alias to MonoVM so NativeAOT relies on the direct references emitted by its compiler. Add invariant-globalization regression cases for all four Apple platforms with assembly preparation enabled and disabled, and document the runtime-specific symbol handling.

Fixes #26876

🤖 Pull request created by Copilot

ListExportedSymbols treats System.Globalization.Native as an alias for symbols provided by libmonosgen-2.0. Applying that exception to NativeAOT forces references to globalization functions even when invariant globalization omits their native library, causing undefined-symbol errors during native linking.

Limit the alias to MonoVM so NativeAOT relies on the direct references emitted by its compiler. Add invariant-globalization regression cases for all four Apple platforms with assembly preparation enabled and disabled, and document the runtime-specific symbol handling.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cc0ff47f-10d6-4cea-8aa8-cb33dc13ea7b
@rolfbjarne
rolfbjarne requested a review from dalexsoto as a code owner October 16, 2026 17:59
Copilot AI balanced review requested due to automatic review settings October 16, 2026 17:59
@rolfbjarne rolfbjarne added copilot backport-to-net11.0 Add this to issues or pull requests that should be backported to .NET 11 labels Oct 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

No verified defects were identified, but Apple-platform native-link regression validation remains unconfirmed.

0 open findings

What changed in this PR

Addresses #26876 by restricting the globalization symbol alias to MonoVM, avoiding unwanted NativeAOT linker references.

Changes:

  • Applies the alias only when using MonoVM.
  • Adds invariant-globalization regression cases for all four Apple platforms, with assembly preparation enabled and disabled.
  • Documents runtime-specific symbol handling.
File Description
tools/​linker/​MonoTouch.Tuner/​ListExportedSymbols.cs Restricts the globalization alias to MonoVM.
tests/​dotnet/​UnitTests/​RuntimeConfigurationTest.cs Adds NativeAOT invariant-globalization regression coverage.
docs/​code/​native-symbols.md Explains runtime-specific globalization references.

🧠 Review effort: Balanced

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

⚠️ AppSizeTest expected files changed ⚠️

The AppSizeTest detected changes in the expected app size files.

To update the expected files, add a comment with the following command:

/apply-gist https://gist.github.com/vs-mobiletools-engineering-service2/4c9c6ead4b720d674a81d7d2dae19442
Updated files
  • TVOS-NativeAOT-size.txt

Pipeline on Agent
Hash: 5f7314ad9d2def573c0027ddd7b2cf1b3de74ac2 [PR build]

@rolfbjarne

Copy link
Copy Markdown
Member Author

/apply-gist https://gist.github.com/vs-mobiletools-engineering-service2/4c9c6ead4b720d674a81d7d2dae19442

@github-actions

Copy link
Copy Markdown
Contributor

✅ Applied expected app size files from gist.

Copilot AI balanced review requested due to automatic review settings October 19, 2026 06:47
@rolfbjarne rolfbjarne added the backport-to-net10.0 Add this to issues or pull requests that should be backported to .NET 10 label Oct 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Cross-platform native-linking behavior and the revised size baseline still need CI confirmation.

No open issues 🎉

Review effort: Balanced

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 202b48b43f244a6b3154b7dacd075d742b4fc41c [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build #202b48b] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

1 tests crashed, 1 tests failed, 217 tests passed.

Failures

❌ monotouch tests (iOS)

1 tests failed, 19 tests passed.

Failed tests

  • monotouch-test/iOS - simulator/Release (trimmable static registrar, NativeAOT): TimedOut

Html Report (VSDrops) Download

❌ windows tests

🔥 Failed catastrophically on VSTS: test results - windows (no summary found).

Html Report (VSDrops) Download

Successes

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 21 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 20 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Golden Gate (27): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

✅ Linux build succeeded

Pipeline on Agent
Hash: 202b48b43f244a6b3154b7dacd075d742b4fc41c [PR build]

This branch has not been deployed

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

Labels

backport-to-net10.0 Add this to issues or pull requests that should be backported to .NET 10 backport-to-net11.0 Add this to issues or pull requests that should be backported to .NET 11 copilot ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS NativeAOT fails to compile when GlobalizationInvariant is set to True

3 participants