[dotnet] Add support for the interpreter + AOT when needed. Fixes #11421 and #11724.#12211
Conversation
… run the AOT compiler or not. We also can't link dynamically with libmonosgen-2.0.dylib if we AOT compile anything, so make sure we don't do that.
This also meant propagating how libmono is linked from the MSBuild code to the Application class so that our existing logic is able to correctly determine which native mono lib to use.
…atalyst. The interpreter requires running the AOT compiler for System.Private.CoreLib.dll, so the first step in implementing the interpreter is to implement support for the AOT compiler as well. For .NET the logic is now as follows: * If the interpreter is enabled, AOT compile System.Private.CoreLib.dll. * If the interpreter is disabled, AOT everything on device + Mac Catalyst on ARM64.
…hem. This means not listing per-assembly linker flags for only binding projects, but delay it until we've computed the linker flags for all assemblies (and reflect this in variable names as well).
…phy.Native.Apple for Mac Catalyst.
Fixes these test failures:
Ctor_Trust: System.DllNotFoundException : libSystem.Security.Cryptography.Native.Apple
MailX1: System.DllNotFoundException : libSystem.Security.Cryptography.Native.Apple
Encrypt_Empty: System.DllNotFoundException : libSystem.Security.Cryptography.Native.Apple
KeyRecordTest: System.DllNotFoundException : libSystem.Security.Cryptography.Native.Apple
Basic_Leaf_Only: System.DllNotFoundException : libSystem.Security.Cryptography.Native.Apple
which are all because of
Xamarin.MacCatalyst: Unable to resolve P/Invoke 'AppleCryptoNative_X509GetContentType' in the library 'libSystem.Security.Cryptography.Native.Apple'
which happens because without this change we're not linking with the static version
of libSystem.Security.Cryptography.Native.Apple.
Using 'direct-pinvoke' will tell the AOT compiler to emit a direct call to the native function declared in the DllImport, which doesn't work when we want to redirect to a different native funcion (in our xamarin_pinvoke_override/PINVOKE_OVERRIDE implementation). This fixes our exception marshalling tests in monotouch-test.
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results27 tests failed, 91 tests passed.Failed tests
Pipeline on Agent XAMBOT-1108.BigSur' |
This is not the final fix, but this code will be reworked extensively, and this fix works for now to make the interpreter work.
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results2 tests failed, 116 tests passed.Failed tests
Pipeline on Agent XAMBOT-1100.BigSur' |
|
Test failures are unrelated
|
|
/sudo backport release/6.0.1xx-preview7 |
|
Backport Job to branch release/6.0.1xx-preview7 Created! The magic is happening here |
This comment has been minimized.
This comment has been minimized.
|
Hooray! Backport succeeded! Please see https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5024059 for more details. |
because the interpreter needs it (at least System.Private.CoreLib.dll must
be AOT-compiled when using the interpreter).
interpreter, since we can't use the JIT.
Fixes #11724.
Fixes #11421.