diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets
index c2c4e268d3..d1c926967a 100644
--- a/dotnet/targets/Xamarin.Shared.Sdk.targets
+++ b/dotnet/targets/Xamarin.Shared.Sdk.targets
@@ -704,13 +704,11 @@
<_AOTInputDirectory>$(_IntermediateNativeLibraryDir)aot-input/
<_AOTOutputDirectory>$(_IntermediateNativeLibraryDir)aot-output/
- <_LibMonoLinkMode Condition="'$(_LibMonoLinkMode)' == '' And '$(_RunAotCompiler)' == 'true'">static
<_LibMonoLinkMode Condition="'$(_LibMonoLinkMode)' == '' And ('$(ComputedPlatform)' != 'iPhone' Or '$(_PlatformName)' == 'macOS')">dylib
<_LibMonoLinkMode Condition="'$(_LibMonoLinkMode)' == ''">static
<_LibMonoExtension Condition="'$(_LibMonoLinkMode)' == 'dylib'">dylib
<_LibMonoExtension Condition="'$(_LibMonoLinkMode)' == 'static'">a
- <_LibXamarinLinkMode Condition="'$(_LibXamarinLinkMode)' == '' And '$(_RunAotCompiler)' == 'true'">static
<_LibXamarinLinkMode Condition="'$(_LibXamarinLinkMode)' == '' And '$(ComputedPlatform)' != 'iPhone' And '$(_PlatformName)' != 'macOS'">dylib
<_LibXamarinLinkMode Condition="'$(_LibXamarinLinkMode)' == ''">static
<_LibXamarinExtension Condition="'$(_LibXamarinLinkMode)' == 'dylib'">dylib
diff --git a/tests/dotnet/MySimpleApp/MacCatalyst/Info.plist b/tests/dotnet/MySimpleApp/MacCatalyst/Info.plist
index 6631ffa6f2..246b63052c 100644
--- a/tests/dotnet/MySimpleApp/MacCatalyst/Info.plist
+++ b/tests/dotnet/MySimpleApp/MacCatalyst/Info.plist
@@ -2,5 +2,8 @@
+
+ LSMinimumSystemVersion
+ 11.0
diff --git a/tests/mtouch/MTouch.cs b/tests/mtouch/MTouch.cs
index f805db9287..9c35b2965c 100644
--- a/tests/mtouch/MTouch.cs
+++ b/tests/mtouch/MTouch.cs
@@ -1386,7 +1386,7 @@ public class B : A {}
app.WarnAsError = new int [] { 113 };
app.AotArguments = "dwarfdebug"; // doesn't matter exactly what, just that it's different from the extension.
app.AssertExecuteFailure (MTouchAction.BuildDev, "build app");
- app.AssertError (113, "Native code sharing has been disabled for the extension 'testServiceExtension' because the arguments to the AOT compiler are different between the container app (dwarfdebug,static,asmonly,direct-icalls,) and the extension (static,asmonly,direct-icalls,).");
+ app.AssertError (113, "Native code sharing has been disabled for the extension 'testServiceExtension' because the arguments to the AOT compiler are different between the container app (dwarfdebug) and the extension ().");
}
}
}
diff --git a/tools/common/Application.cs b/tools/common/Application.cs
index 2e07299fb2..12a8e28616 100644
--- a/tools/common/Application.cs
+++ b/tools/common/Application.cs
@@ -72,7 +72,7 @@ namespace Xamarin.Bundler {
public HashSet IgnoredSymbols = new HashSet ();
// The AOT arguments are currently not used for macOS, but they could eventually be used there as well (there's no mmp option to set these yet).
- public string AotArguments = "static,asmonly,direct-icalls,";
+ public List AotArguments = new List ();
public List AotOtherArguments = null;
public DlsymOptions DlsymOptions;
@@ -1463,7 +1463,11 @@ namespace Xamarin.Bundler {
aotArguments = new List ();
aotArguments.Add ($"--aot=mtriple={(enable_thumb ? arch.Replace ("arm", "thumb") : arch)}-ios");
aotArguments.Add ($"data-outfile={dataFile}");
- aotArguments.AddRange (app.AotArguments.Split (new char [] { ',' }, StringSplitOptions.RemoveEmptyEntries));
+ aotArguments.Add ("static");
+ aotArguments.Add ("asmonly");
+ if (app.LibMonoLinkMode == AssemblyBuildTarget.StaticObject)
+ aotArguments.Add ("direct-icalls");
+ aotArguments.AddRange (app.AotArguments);
if (llvm_only)
aotArguments.Add ("llvmonly");
else if (interp) {
diff --git a/tools/mtouch/Application.mtouch.cs b/tools/mtouch/Application.mtouch.cs
index fc538e5ab4..a31d681c5e 100644
--- a/tools/mtouch/Application.mtouch.cs
+++ b/tools/mtouch/Application.mtouch.cs
@@ -508,8 +508,10 @@ namespace Xamarin.Bundler {
}
// All arguments to the AOT compiler must be identical
- if (AotArguments != appex.AotArguments) {
- ErrorHelper.Warning (113, Errors.MT0113, appex.Name, String.Format (Errors.MT0113_d, AotArguments, appex.AotArguments));
+ var allAotArguments = string.Join (",", AotArguments);
+ var allAppexAotArguments = string.Join (",", appex.AotArguments);
+ if (allAotArguments != allAppexAotArguments) {
+ ErrorHelper.Warning (113, Errors.MT0113, appex.Name, String.Format (Errors.MT0113_d, allAotArguments, allAppexAotArguments));
continue;
}
diff --git a/tools/mtouch/mtouch.cs b/tools/mtouch/mtouch.cs
index 2efad9616c..a836912dba 100644
--- a/tools/mtouch/mtouch.cs
+++ b/tools/mtouch/mtouch.cs
@@ -388,7 +388,7 @@ namespace Xamarin.Bundler
var os = new OptionSet () {
{ "dot:", "Generate a dot file to visualize the build tree.", v => dotfile = v ?? string.Empty },
{ "aot=", "Arguments to the static compiler",
- v => app.AotArguments = v + (v.EndsWith (",", StringComparison.Ordinal) ? String.Empty : ",") + app.AotArguments
+ v => app.AotArguments.AddRange (v.Split (new char [] { ',' }, StringSplitOptions.RemoveEmptyEntries))
},
{ "aot-options=", "Non AOT arguments to the static compiler",
v => {