[mtouch] Don't allow building for 32-bit when deployment target is >= 11. Fixes #57966. (#2303)

* [mtouch] Don't allow building for 32-bit when deployment target is >= 11. Fixes #57966.

Also bump maccore to get an mlaunch error for launching a 32-bit app in a 64-bit-only simulator.

https://bugzilla.xamarin.com/show_bug.cgi?id=57966

* [tests][msbuild] Make sure all Info.plists have deployment targets.

Otherwise we get different behavior (32-bit allowed or not) depending on which
Xcode is used to build.

* [mtouch] Default to 64-bit arch if not specified and targeting iOS 11+.

* [tests] Tweak tests to either specify a deployment target < 11 or not build a 32-bit arch.
This commit is contained in:
Rolf Bjarne Kvinge 2017-07-11 08:54:50 +02:00 коммит произвёл GitHub
Родитель 871c055308
Коммит 981af59058
12 изменённых файлов: 110 добавлений и 34 удалений

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

@ -557,6 +557,18 @@ linker. This will most likely result in native linker errors.
The solution is to remove the `--dynamic-symbol-mode=linker` argument from the additional mtouch arguments in the project's Build options.
<h3><a name="MT0116"/>MT0116: Invalid architecture: {arch}. 32-bit architectures are not supported when deployment target is 11 or later. Make sure the project does not build for a 32-bit architecture.</h3>
iOS 11 does not contain support for 32-bit applications, so it's not supported
to build for a 32-bit application when the deployment target is iOS 11 or
later.
Either change the target architecture in the project's iOS build options to
arm64, or change the deployment target in the project's Info.plist to an
earlier iOS version.
<h3><a name="MT0117"/>MT0117: Can't launch a 32-bit app on a simulator that only supports 64-bit.</h3>
<!-- 0116 - 0124: free to use -->
<h3><a name="MT0125"/>MT0125: The --assembly-build-target command-line argument is ignored in the simulator.</h3>

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

@ -1,5 +1,5 @@
ifdef ENABLE_XAMARIN
NEEDED_MACCORE_VERSION := 18deb964b64886af65fb1760b19adeee58dd8bea
NEEDED_MACCORE_VERSION := 16f7b4ca4b5c0766ae8e257080ad8d9f28a1a4e1
NEEDED_MACCORE_BRANCH := xcode9
MACCORE_DIRECTORY := maccore

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

@ -18,6 +18,8 @@
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>

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

@ -18,6 +18,8 @@
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>

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

@ -18,6 +18,8 @@
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>

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

@ -42,6 +42,7 @@ namespace Xamarin
mtouch.CreateTemporaryApp ();
mtouch.CreateTemporaryCacheDirectory ();
mtouch.Abi = "armv7,arm64";
mtouch.TargetVer = "10.3"; // otherwise 32-bit build isn't possible
mtouch.DSym = false; // speeds up the test
mtouch.MSym = false; // speeds up the test
mtouch.AssertExecute (MTouchAction.BuildDev, "build");
@ -106,6 +107,7 @@ namespace Xamarin
mtouch.NoStrip = true; // faster test
mtouch.NoSymbolStrip = string.Empty; // faster test
mtouch.Verbosity = 4; // This is needed to get mtouch to print the output we're verifying
mtouch.TargetVer = "10.3"; // otherwise 32-bit builds aren't possible
mtouch.AssertExecute (MTouchAction.BuildDev, "build");
// Check that --llvm is passed to the AOT compiler for every assembly we AOT.
var assemblies_checked = 0;
@ -235,6 +237,7 @@ namespace Xamarin
extension.CreateTemporaryServiceExtension (extraCode: codeA);
extension.CreateTemporaryCacheDirectory ();
extension.Abi = abi;
extension.TargetVer = "10.3"; // otherwise 32-bit builds aren't possible
extension.Debug = debug;
extension.AssemblyBuildTargets.AddRange (assembly_build_targets);
extension.DSym = false; // faster test
@ -247,6 +250,7 @@ namespace Xamarin
mtouch.CreateTemporaryApp (extraCode: codeA);
mtouch.CreateTemporaryCacheDirectory ();
mtouch.Abi = abi;
mtouch.TargetVer = "10.3"; // otherwise 32-bit builds aren't possible
mtouch.Debug = debug;
mtouch.AssemblyBuildTargets.AddRange (assembly_build_targets);
mtouch.DSym = false; // faster test
@ -761,6 +765,7 @@ namespace Xamarin
using (var mtouch = new MTouchTool ()) {
mtouch.CreateTemporaryApp ();
mtouch.Abi = "armv7k";
mtouch.TargetVer = "10.3";
mtouch.AssertExecuteFailure (MTouchAction.BuildDev, "build");
mtouch.AssertError (75, "Invalid architecture 'ARMv7k' for iOS projects. Valid architectures are: ARMv7, ARMv7+Thumb, ARMv7+LLVM, ARMv7+LLVM+Thumb, ARMv7s, ARMv7s+Thumb, ARMv7s+LLVM, ARMv7s+LLVM+Thumb, ARM64, ARM64+LLVM");
}
@ -1218,6 +1223,7 @@ namespace Xamarin
extension.CreateTemporaryServiceExtension ();
extension.CreateTemporaryCacheDirectory ();
extension.Abi = extension_abi;
extension.TargetVer = "10.3"; // otherwise 32-bit builds aren't possible
extension.AssertExecute (MTouchAction.BuildDev, "build extension");
using (var app = new MTouchTool ()) {
app.AppExtensions.Add (extension);
@ -1225,6 +1231,7 @@ namespace Xamarin
app.CreateTemporaryCacheDirectory ();
app.WarnAsError = new int [] { 113 };
app.Abi = app_abi;
app.TargetVer = "10.3"; // otherwise 32-bit builds aren't possible
app.AssertExecuteFailure (MTouchAction.BuildDev, "build app");
app.AssertError (113, $"Native code sharing has been disabled for the extension 'testServiceExtension' because the container app does not build for the ABI {error_abi} (while the extension is building for this ABI).");
}
@ -1239,6 +1246,7 @@ namespace Xamarin
extension.CreateTemporaryServiceExtension ();
extension.CreateTemporaryCacheDirectory ();
extension.Abi = extension_abi;
extension.TargetVer = "10.3"; // otherwise 32-bit builds aren't possible
extension.AssertExecute (MTouchAction.BuildDev, "build extension");
using (var app = new MTouchTool ()) {
app.AppExtensions.Add (extension);
@ -1246,6 +1254,7 @@ namespace Xamarin
app.CreateTemporaryCacheDirectory ();
app.WarnAsError = new int [] { 113 };
app.Abi = app_abi;
app.TargetVer = "10.3"; // otherwise 32-bit builds aren't possible
app.AssertExecuteFailure (MTouchAction.BuildDev, "build app");
app.AssertError (113, $"Native code sharing has been disabled for the extension 'testServiceExtension' because the container app is building for the ABI {container_error_abi}, which is not compatible with the extension's ABI ({extension_error_abi}).");
}
@ -1307,6 +1316,23 @@ namespace Xamarin
}
}
[Test]
[TestCase ("armv7", "ARMv7")]
[TestCase ("armv7s", "ARMv7s")]
[TestCase ("armv7,armv7s", "ARMv7")]
[TestCase ("i386", "i386")]
public void MT0116 (string abi, string messageAbi)
{
using (var mtouch = new MTouchTool ()) {
mtouch.CreateTemporaryApp ();
mtouch.CreateTemporaryCacheDirectory ();
mtouch.TargetVer = "11.0";
mtouch.Abi = abi;
mtouch.AssertExecuteFailure (abi == "i386" ? MTouchAction.BuildSim : MTouchAction.BuildDev, "build");
mtouch.AssertError (116, $"Invalid architecture: {messageAbi}. 32-bit architectures are not supported when deployment target is 11 or later.");
}
}
[Test]
public void MT0125 ()
{
@ -1365,8 +1391,8 @@ public class BindingAppB {
}
";
var bindingLibA = CreateBindingLibrary (tmpdir, nativeCodeA, null, null, extraCodeA, name: "bindingA");
var bindingLibB = CreateBindingLibrary (tmpdir, nativeCodeB, null, null, extraCodeB, name: "bindingB", references: new string [] { bindingLibA });
var bindingLibA = CreateBindingLibrary (tmpdir, nativeCodeA, null, null, extraCodeA, name: "bindingA", arch: "arm64");
var bindingLibB = CreateBindingLibrary (tmpdir, nativeCodeB, null, null, extraCodeB, name: "bindingB", references: new string [] { bindingLibA }, arch: "arm64");
var exe = CompileTestAppExecutable (tmpdir, @"
public class TestApp {
static void Main () {
@ -1552,6 +1578,7 @@ public class TestApp {
{
switch (profile) {
case Profile.iOS:
return "x86_64";
case Profile.watchOS:
return "i386";
case Profile.tvOS:
@ -1839,11 +1866,12 @@ public class TestApp {
{
Profile = Profile.iOS,
FastDev = true,
TargetVer = "10.3", // otherwise 32-bit build isn't possible
Abi = "armv7,arm64",
}) {
mtouch.CreateTemporaryApp ();
Assert.AreEqual (0, mtouch.Execute (MTouchAction.BuildDev));
mtouch.AssertExecute (MTouchAction.BuildDev);
var bin = mtouch.NativeExecutablePath;
VerifyArchitectures (bin, "arm7s/64", "armv7", "arm64");
foreach (var dylib in Directory.GetFileSystemEntries (mtouch.AppPath, "*.dylib")) {
@ -1898,27 +1926,28 @@ public class TestApp {
}
[Test]
[TestCase (Target.Dev, "armv7")]
[TestCase (Target.Dev, "armv7s")]
[TestCase (Target.Dev, "armv7,armv7s")]
[TestCase (Target.Dev, "arm64")]
[TestCase (Target.Dev, "arm64+llvm")]
[TestCase (Target.Dev, "armv7,arm64")]
[TestCase (Target.Dev, "armv7s,arm64")]
[TestCase (Target.Dev, "armv7,armv7s,arm64")]
[TestCase (Target.Sim, "i386")]
[TestCase (Target.Sim, "x86_64")]
public void Architectures_Unified (Target target, string abi)
[TestCase (Target.Dev, "armv7", "10.3")]
[TestCase (Target.Dev, "armv7s", "10.3")]
[TestCase (Target.Dev, "armv7,armv7s", "10.3")]
[TestCase (Target.Dev, "arm64", null)]
[TestCase (Target.Dev, "arm64+llvm", null)]
[TestCase (Target.Dev, "armv7,arm64", "10.3")]
[TestCase (Target.Dev, "armv7s,arm64", "10.3")]
[TestCase (Target.Dev, "armv7,armv7s,arm64", "10.3")]
[TestCase (Target.Sim, "i386", "10.3")]
[TestCase (Target.Sim, "x86_64", null)]
public void Architectures_Unified (Target target, string abi, string deployment_target)
{
using (var mtouch = new MTouchTool ()) {
mtouch.Profile = Profile.iOS;
mtouch.CreateTemporaryApp ();
mtouch.Abi = abi;
mtouch.TargetVer = deployment_target;
var bin = Path.Combine (mtouch.AppPath, Path.GetFileNameWithoutExtension (mtouch.RootAssembly));
Assert.AreEqual (0, mtouch.Execute (target == Target.Dev ? MTouchAction.BuildDev : MTouchAction.BuildSim));
mtouch.AssertExecute (target == Target.Dev ? MTouchAction.BuildDev : MTouchAction.BuildSim);
VerifyArchitectures (bin, abi, abi.Replace ("+llvm", string.Empty).Split (','));
}
@ -1932,6 +1961,7 @@ public class TestApp {
mtouch.CreateTemporaryApp ();
mtouch.Abi = "i386,x86_64";
mtouch.TargetVer = "10.3";
var bin = Path.Combine (mtouch.AppPath, Path.GetFileNameWithoutExtension (mtouch.RootAssembly));
var bin32 = Path.Combine (mtouch.AppPath, ".monotouch-32", Path.GetFileNameWithoutExtension (mtouch.RootAssembly));
@ -1952,6 +1982,7 @@ public class TestApp {
mtouch.Profile = Profile.iOS;
mtouch.CreateTemporaryApp ();
mtouch.TargetVer = "10.3";
mtouch.Abi = "armv6";
Assert.AreEqual (1, mtouch.Execute (MTouchAction.BuildDev));
mtouch.AssertError ("MT", 15, "Invalid ABI: armv6. Supported ABIs are: i386, x86_64, armv7, armv7+llvm, armv7+llvm+thumb2, armv7s, armv7s+llvm, armv7s+llvm+thumb2, armv7k, armv7k+llvm, arm64 and arm64+llvm.");
@ -2004,6 +2035,7 @@ public class TestApp {
extension.CreateTemporaryServiceExtension ();
extension.CreateTemporaryCacheDirectory ();
extension.Abi = "armv7,arm64";
extension.TargetVer = "10.3";
extension.Linker = MTouchLinker.LinkAll; // faster test
extension.NoStrip = true; // faster test
extension.AssertExecute (MTouchAction.BuildDev, "build extension");
@ -2112,6 +2144,7 @@ public class TestApp {
mtouch.Linker = linker;
mtouch.Registrar = registrar;
mtouch.Abi = abi;
mtouch.TargetVer = "10.3"; // otherwise 32-bit builds aren't possible
mtouch.Timeout = TimeSpan.FromMinutes (5);
mtouch.AssertExecute (target == Target.Dev ? MTouchAction.BuildDev : MTouchAction.BuildSim, "build");
var fi = new FileInfo (mtouch.NativeExecutablePath);
@ -2153,7 +2186,7 @@ public class BindingApp {
public static extern void DummyMethod ();
}
";
var bindingLib = CreateBindingLibrary (tmpdir, nativeCode, null, null, extraCode);
var bindingLib = CreateBindingLibrary (tmpdir, nativeCode, null, null, extraCode, arch: "arm64");
var exe = CompileTestAppExecutable (tmpdir, @"
public class TestApp {
static void Main () {
@ -2267,6 +2300,7 @@ public class TestApp {
mtouch.CreateTemporaryApp ();
mtouch.NoFastSim = true;
mtouch.Abi = "i386";
mtouch.TargetVer = "10.3"; // otherwise 32-bit build isn't possible
mtouch.GccFlags = Quote (lib);
mtouch.AssertExecute (MTouchAction.BuildSim, "build a");
mtouch.AssertWarning (5203, $"Native linking warning: warning: ignoring file {lib}, file was built for archive which is not the architecture being linked (i386): {lib}");
@ -2484,6 +2518,7 @@ class Test {
}
";
mtouch.Abi = "armv7,arm64";
mtouch.TargetVer = "10.3"; // otherwise 32-bit builds aren't possible
mtouch.CreateTemporaryApp (code: code);
mtouch.CreateTemporaryCacheDirectory ();
@ -2571,6 +2606,7 @@ class Test {
mtouch.RootAssembly = exe;
mtouch.References = new [] { DLL };
mtouch.Timeout = TimeSpan.FromMinutes (5);
mtouch.TargetVer = "10.3"; // otherwise 32-bit builds aren't possible
foreach (var test in tests) {
mtouch.Abi = test.Abi;
@ -2590,6 +2626,7 @@ class Test {
mtouch.CreateTemporaryApp ();
mtouch.CreateTemporaryCacheDirectory ();
mtouch.Abi = "armv7,arm64";
mtouch.TargetVer = "10.3"; // otherwise 32-bit builds aren't possible
mtouch.AssertExecute (MTouchAction.BuildDev, "build");
FileAssert.Exists (Path.Combine (mtouch.AppPath, "testApp.exe"));
// Don't check for mscorlib.dll, there might be two versions of it (since Xamarin.iOS.dll depends on it), or there might not.
@ -2604,6 +2641,7 @@ class Test {
mtouch.CreateTemporaryApp ();
mtouch.GccFlags = "-all_load";
mtouch.Abi = "armv7,arm64";
mtouch.TargetVer = "10.3"; // otherwise 32-bit builds aren't possible
mtouch.AssertExecute (MTouchAction.BuildDev, "build");
}
}
@ -3273,7 +3311,7 @@ public class Dummy {
<MtouchDebug>True</MtouchDebug>
<MtouchExtraArgs>-v -v -v -v</MtouchExtraArgs>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<MtouchArch>i386, x86_64</MtouchArch>
<MtouchArch>x86_64</MtouchArch>
<MtouchLink>None</MtouchLink>
</PropertyGroup>
<PropertyGroup Condition="" '$(Configuration)|$(Platform)' == 'Debug|iPhone' "">
@ -3285,7 +3323,7 @@ public class Dummy {
<MtouchDebug>True</MtouchDebug>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchExtraArgs>-v -v -v -v</MtouchExtraArgs>
<MtouchArch>ARMv7, ARM64</MtouchArch>
<MtouchArch>ARM64</MtouchArch>
<MtouchLink>Full</MtouchLink>
</PropertyGroup>
<ItemGroup>
@ -3358,9 +3396,9 @@ public class Dummy {
return assembly;
}
static string CreateBindingLibrary (string targetDirectory, string nativeCode, string bindingCode, string linkWith = null, string extraCode = "", string name = "binding", string[] references = null)
static string CreateBindingLibrary (string targetDirectory, string nativeCode, string bindingCode, string linkWith = null, string extraCode = "", string name = "binding", string[] references = null, string arch = "armv7")
{
var o = CompileNativeLibrary (targetDirectory, nativeCode, name: name);
var o = CompileNativeLibrary (targetDirectory, nativeCode, name: name, arch: arch);
var cs = Path.Combine (targetDirectory, $"{name}Code.cs");
var dll = Path.Combine (targetDirectory, $"{name}Library.dll");

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

@ -160,7 +160,12 @@ namespace Xamarin
public void AssertExecute (MTouchAction action, string message = null)
{
NUnit.Framework.Assert.AreEqual (0, Execute (action), message);
var rv = Execute (action);
if (rv == 0)
return;
var errors = Messages.Where ((v) => v.IsError).ToList ();
Assert.Fail ($"Expected execution to succeed, but exit code was {rv}, and there were {errors.Count} error(s): {message}\n\t" +
string.Join ("\n\t", errors.Select ((v) => v.ToString ())));
}
public void AssertExecuteFailure (MTouchAction action, string message = null)

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

@ -6,11 +6,11 @@ ALL_TESTS=select-native-compiler bug-13945 bug-35786
all-local tests run-tests:: $(ALL_TESTS)
select-native-compiler:
$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -mno-thumb -miphoneos-version-min=$(IOS_SDK_VERSION) -isysroot $(XCODE_DEVELOPER_ROOT)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(IOS_SDK_VERSION).sdk -Wall -g -c select-native-compiler/native.cpp -o select-native-compiler/libNative.a
$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -miphoneos-version-min=$(IOS_SDK_VERSION) -isysroot $(XCODE_DEVELOPER_ROOT)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(IOS_SDK_VERSION).sdk -Wall -g -c select-native-compiler/native.cpp -o select-native-compiler/libNative.a
mkdir -p select-native-compiler/SelectNativeCompiler.app
$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/btouch-native select-native-compiler/binding.cs --link-with=select-native-compiler/libNative.a,Native -s:select-native-compiler/managed.cs -o:select-native-compiler/binding.dll
$(SYSTEM_MCS) select-native-compiler/app.cs -r:$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS/Xamarin.iOS.dll -r:select-native-compiler/binding.dll -out:select-native-compiler/app.exe
$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/mtouch -r:select-native-compiler/binding.dll select-native-compiler/app.exe --abi=armv7 -sdk "$(IOS_SDK_VERSION)" -dev:select-native-compiler/SelectNativeCompiler.app -sdkroot $(XCODE_DEVELOPER_ROOT) -r:$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/mtouch -r:select-native-compiler/binding.dll select-native-compiler/app.exe --abi=arm64 -sdk "$(IOS_SDK_VERSION)" -dev:select-native-compiler/SelectNativeCompiler.app -sdkroot $(XCODE_DEVELOPER_ROOT) -r:$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
bug-13945 bug-35786:
$(MAKE) -C $@

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

@ -8,26 +8,26 @@ bug-13945:
@echo "void foo () {}" > nativeA.m
@echo "void bar () {}" > nativeB.m
@mkdir -p .libs
@$(MAKE) .libs/ios/nativeA.armv7.o
@$(MAKE) .libs/ios/nativeB.armv7.o
@$(MAKE) .libs/ios/nativeA.arm64.o
@$(MAKE) .libs/ios/nativeB.arm64.o
@rm -Rf TheApp.app cache cache-first
@mkdir -p TheApp.app
@mkdir -p cache
@cp .libs/ios/nativeA.armv7.o libNative.a
@cp .libs/ios/nativeA.arm64.o libNative.a
@$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/btouch-native binding.cs --link-with=libNative.a,Native -s:managed.cs -o:binding.dll
@$(SYSTEM_MCS) app.cs -r:$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS/Xamarin.iOS.dll -r:binding.dll -out:app.exe
@$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/mtouch -r:binding.dll app.exe --abi=armv7 -sdk "$(IOS_SDK_VERSION)" -dev:TheApp.app -sdkroot $(XCODE_DEVELOPER_ROOT) --cache=$(shell pwd)/cache -r:$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
@$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/mtouch -r:binding.dll app.exe --abi=arm64 -sdk "$(IOS_SDK_VERSION)" -dev:TheApp.app -sdkroot $(XCODE_DEVELOPER_ROOT) --cache=$(shell pwd)/cache -r:$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
@cp -Rp cache cache-first
@cp .libs/ios/nativeB.armv7.o libNative.a
@cp .libs/ios/nativeB.arm64.o libNative.a
@$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/btouch-native binding.cs --link-with=libNative.a,Native -s:managed.cs -o:binding.dll
# do not rebuild the .exe
@$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/mtouch -r:binding.dll app.exe --abi=armv7 -sdk "$(IOS_SDK_VERSION)" -dev:TheApp.app -sdkroot $(XCODE_DEVELOPER_ROOT) --cache=$(shell pwd)/cache -r:$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
@$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/mtouch -r:binding.dll app.exe --abi=arm64 -sdk "$(IOS_SDK_VERSION)" -dev:TheApp.app -sdkroot $(XCODE_DEVELOPER_ROOT) --cache=$(shell pwd)/cache -r:$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
# this will verify that binding.dll wasn't AOT'ed again - if binding.dll.armv7.s differ then the AOT compiler executed.
@diff -u cache-first/armv7/binding.dll.s cache/armv7/binding.dll.s
# this will verify that binding.dll wasn't AOT'ed again - if binding.dll.arm64.s differ then the AOT compiler executed.
@diff -u cache-first/arm64/binding.dll.s cache/arm64/binding.dll.s
@echo "$@: Success"
include $(TOP)/mk/rules.mk

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

@ -38,7 +38,7 @@ bug-35786:
@# we lower the ulimit here so that we don't have to create that many assemblies to test with
@# the ulimit default on Yosemite is ulimit=256, which requires 300 assemblies to break the stripper, and 400 assemblies to break the AOT compiler.
@# with 96 here, we only need 20 assemblies to break the stripper, and 35 to break the AOT compiler, so running the test with 100 assemblies should be more than enough.
ulimit -n 96 && $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/mtouch --dev libs/bug-35786.app --abi armv7,arm64 libs/bug-35786.exe --sdkroot $(XCODE_DEVELOPER_ROOT) --sdk $(IOS_SDK_VERSION) -r:$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
ulimit -n 96 && $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/mtouch --dev libs/bug-35786.app --targetver=10.3 --abi armv7,arm64 libs/bug-35786.exe --sdkroot $(XCODE_DEVELOPER_ROOT) --sdk $(IOS_SDK_VERSION) -r:$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
include $(TOP)/mk/rules.mk

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

@ -3,7 +3,11 @@ using System.Collections.Generic;
using System.IO;
using System.Net;
#if MLAUNCH
using Xamarin.Launcher;
#else
using Xamarin.Bundler;
#endif
namespace Xamarin
{

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

@ -595,7 +595,11 @@ namespace Xamarin.Bundler {
switch (Platform) {
case ApplePlatform.iOS:
if (abis.Count == 0) {
abis.Add (IsDeviceBuild ? Abi.ARMv7 : Abi.i386);
if (DeploymentTarget == null || DeploymentTarget.Major >= 11) {
abis.Add (IsDeviceBuild ? Abi.ARM64 : Abi.x86_64);
} else {
abis.Add (IsDeviceBuild ? Abi.ARMv7 : Abi.i386);
}
}
break;
case ApplePlatform.WatchOS:
@ -1340,6 +1344,13 @@ namespace Xamarin.Bundler {
RootAssemblies.Add (Path.Combine (Driver.GetPlatformFrameworkDirectory (this), Driver.GetProductAssembly (this) + ".dll"));
}
if (Platform == ApplePlatform.iOS) {
if (DeploymentTarget.Major >= 11 && Is32Build) {
var invalidArches = abis.Where ((v) => (v & Abi.Arch32Mask) != 0);
throw ErrorHelper.CreateError (116, $"Invalid architecture: {invalidArches.First ()}. 32-bit architectures are not supported when deployment target is 11 or later.");
}
}
InitializeCommon ();
Driver.Watch ("Resolve References", 1);