Repository navigation
[linker] Restrict globalization symbol alias to MonoVM. Fixes #26876 - #26903
Conversation
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 <[email protected]> Copilot-Session: cc0ff47f-10d6-4cea-8aa8-cb33dc13ea7b
There was a problem hiding this comment.
🔵 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
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
✅ Applied expected app size files from gist. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Restricting the globalization symbol alias to MonoVM leaves CoreCLR apps without native API usage with no symbols to export. The Windows build creates an empty mtouch-symbols.list, but LinkNativeCode deliberately skips copying empty files to the Mac, causing the native linker to fail when opening that list. Use the existing /dev/null export-list fallback when there are no processed native symbols. Keep real symbol lists unchanged, cover both cases with the minimal TrimmerMetadata project, and assert the empty-list behavior in the existing remote Windows regression. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cc0ff47f-10d6-4cea-8aa8-cb33dc13ea7b
…variant-globalization-a44
| properties ["TestReferenceNativeSymbol"] = "xamarin_release_managed_ref"; | ||
|
|
||
| var result = DotNet.AssertBuild (project_path, properties); | ||
| Assert.That (BinLog.TryFindPropertyValue (result.BinLogPath, "_ExportedSymbolsFile", out var exportedSymbolsFile), Is.True, "Exported symbols file property"); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
✅ Applied expected app size files from gist. |
| @@ -315,6 +315,8 @@ public void TrimmerKeepsParameterNamesWithRemoteMac (ApplePlatform platform, str | |||
|
|
|||
| var result = DotNet.AssertBuild (projectPath, properties, timeout: TimeSpan.FromMinutes (15)); | |||
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🚀 [CI Build #03d5ff4] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 217 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
…noVM. Fixes #26876 (#27029) 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 --------- Co-authored-by: Copilot App <[email protected]> Backport of #26903. --------- Co-authored-by: Rolf Bjarne Kvinge <[email protected]> Co-authored-by: Copilot App <[email protected]>
…balization test Add the tests/dotnet/TrimmerMetadata test fixture (including the TestReferenceNativeSymbol ReferenceNativeSymbol item) required by DotNetProjectTest.ExportedSymbolsFile, and include RuntimeConfigurationTest.NativeAotInvariantGlobalization from PR #26903. Co-authored-by: Copilot App <[email protected]>
…noVM. Fixes #26876 (#27103) 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 --------- Co-authored-by: Copilot App <[email protected]> Backport of #26903. --------- Co-authored-by: Rolf Bjarne Kvinge <[email protected]> Co-authored-by: Alex Soto <[email protected]>

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