Background
PR #26371 works around an incompatibility between ILLink and ILC (NativeAOT) in how they parse the substitution value for an enum-typed field in ILLink.Substitutions.xml:
| Tool |
Accepted value |
| ILLink |
the enum member's name (e.g. DEVICE / SIMULATOR) |
| ILC |
the numeric value (e.g. 0 / 1) |
There is no single value that works for both, and each reports IL2015 for the other's format. This surfaced on .NET 11 with NativeAOT, where ILLink is skipped entirely and ILC parses our substitution XML itself for the first time.
This is tracked upstream as dotnet/runtime#131601.
The workaround to undo
In PR #26371 we specified both variants of the ObjCRuntime.Runtime.Arch field substitution, in two separate <type> blocks selected by a new ObjCRuntime.IsILCompiler feature switch, and pass --feature:ObjCRuntime.IsILCompiler=true only to ILC.
Once dotnet/runtime#131601 is fixed (i.e. ILLink and ILC agree on the accepted substitution value format), we should undo the workaround:
- Remove the duplicated
<type ... feature="ObjCRuntime.IsILCompiler" ...> blocks in src/ILLink.Substitutions.iOS.xml and src/ILLink.Substitutions.tvOS.xml (and any others that gained them), keeping a single Arch field substitution with whichever value both tools accept.
- Remove the
--feature:ObjCRuntime.IsILCompiler=true IlcArg from _XamarinComputeIlcCompileInputs in dotnet/targets/Xamarin.Shared.Sdk.targets, along with the now-unused ObjCRuntime.IsILCompiler feature switch plumbing.
Validation
Ensure tests/dotnet/MySimpleApp/{iOS,tvOS} still publish cleanly both with and without -p:PublishAot=true, including the configuration where both ILLink and ILC process the XML.
References
Background
PR #26371 works around an incompatibility between ILLink and ILC (NativeAOT) in how they parse the substitution value for an enum-typed field in
ILLink.Substitutions.xml:DEVICE/SIMULATOR)0/1)There is no single value that works for both, and each reports
IL2015for the other's format. This surfaced on .NET 11 with NativeAOT, where ILLink is skipped entirely and ILC parses our substitution XML itself for the first time.This is tracked upstream as dotnet/runtime#131601.
The workaround to undo
In PR #26371 we specified both variants of the
ObjCRuntime.Runtime.Archfield substitution, in two separate<type>blocks selected by a newObjCRuntime.IsILCompilerfeature switch, and pass--feature:ObjCRuntime.IsILCompiler=trueonly to ILC.Once dotnet/runtime#131601 is fixed (i.e. ILLink and ILC agree on the accepted substitution value format), we should undo the workaround:
<type ... feature="ObjCRuntime.IsILCompiler" ...>blocks insrc/ILLink.Substitutions.iOS.xmlandsrc/ILLink.Substitutions.tvOS.xml(and any others that gained them), keeping a singleArchfield substitution with whichever value both tools accept.--feature:ObjCRuntime.IsILCompiler=trueIlcArgfrom_XamarinComputeIlcCompileInputsindotnet/targets/Xamarin.Shared.Sdk.targets, along with the now-unusedObjCRuntime.IsILCompilerfeature switch plumbing.Validation
Ensure
tests/dotnet/MySimpleApp/{iOS,tvOS}still publish cleanly both with and without-p:PublishAot=true, including the configuration where both ILLink and ILC process the XML.References