[dotnet] Remove workaround for private symbols for AOT. (#12334)

* [dotnet] Remove workaround for private symbols for AOT.

* [tools] Make Application.AotArguments a list of string.

This is just a simple refactoring to make Application.AotArguments a list of
strings instead of a comma-separated list of values.

* [tools] Only use direct-icalls when linking mono statically.

Ref: https://github.com/dotnet/runtime/issues/55000

* [mtouch] Fix aot arguments comparison.

* [tests] Adjust mtouch test according to mtouch changes.

* [tests] Add minimum OS version to the Mac Catalyst variation of the MySimpleApp test case.
This commit is contained in:
Rolf Bjarne Kvinge 2021-08-09 09:45:58 +02:00 коммит произвёл GitHub
Родитель ecad9d9667
Коммит 4371133cf7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 15 добавлений и 8 удалений

Просмотреть файл

@ -704,13 +704,11 @@
<_AOTInputDirectory>$(_IntermediateNativeLibraryDir)aot-input/</_AOTInputDirectory>
<_AOTOutputDirectory>$(_IntermediateNativeLibraryDir)aot-output/</_AOTOutputDirectory>
<_LibMonoLinkMode Condition="'$(_LibMonoLinkMode)' == '' And '$(_RunAotCompiler)' == 'true'">static</_LibMonoLinkMode> <!-- https://github.com/dotnet/runtime/issues/55000 -->
<_LibMonoLinkMode Condition="'$(_LibMonoLinkMode)' == '' And ('$(ComputedPlatform)' != 'iPhone' Or '$(_PlatformName)' == 'macOS')">dylib</_LibMonoLinkMode>
<_LibMonoLinkMode Condition="'$(_LibMonoLinkMode)' == ''">static</_LibMonoLinkMode>
<_LibMonoExtension Condition="'$(_LibMonoLinkMode)' == 'dylib'">dylib</_LibMonoExtension>
<_LibMonoExtension Condition="'$(_LibMonoLinkMode)' == 'static'">a</_LibMonoExtension>
<_LibXamarinLinkMode Condition="'$(_LibXamarinLinkMode)' == '' And '$(_RunAotCompiler)' == 'true'">static</_LibXamarinLinkMode> <!-- https://github.com/dotnet/runtime/issues/55000 -->
<_LibXamarinLinkMode Condition="'$(_LibXamarinLinkMode)' == '' And '$(ComputedPlatform)' != 'iPhone' And '$(_PlatformName)' != 'macOS'">dylib</_LibXamarinLinkMode>
<_LibXamarinLinkMode Condition="'$(_LibXamarinLinkMode)' == ''">static</_LibXamarinLinkMode>
<_LibXamarinExtension Condition="'$(_LibXamarinLinkMode)' == 'dylib'">dylib</_LibXamarinExtension>

Просмотреть файл

@ -2,5 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- We need this because we'd otherwise default to the latest macOS version we support (currently 12.0), and we'll want to execute on earlier versions -->
<key>LSMinimumSystemVersion</key>
<string>11.0</string>
</dict>
</plist>

Просмотреть файл

@ -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 ().");
}
}
}

Просмотреть файл

@ -72,7 +72,7 @@ namespace Xamarin.Bundler {
public HashSet<string> IgnoredSymbols = new HashSet<string> ();
// 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<string> AotArguments = new List<string> ();
public List<string> AotOtherArguments = null;
public DlsymOptions DlsymOptions;
@ -1463,7 +1463,11 @@ namespace Xamarin.Bundler {
aotArguments = new List<string> ();
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) {

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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 => {