From 1a6deebb6442e0711fd970db2a378bfb2bc697b7 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 21 Feb 2019 14:49:59 +0100 Subject: [PATCH 01/27] Add an 'arm64_32' capability. --- Versions-ios.plist.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Versions-ios.plist.in b/Versions-ios.plist.in index 7e03641bd020..9f6c68e394f4 100644 --- a/Versions-ios.plist.in +++ b/Versions-ios.plist.in @@ -142,6 +142,7 @@ http-client-handlers mono-symbol-archive sgen-concurrent-gc + arm64_32 Optimizations From 9dd2340972dd977e0bcb4e84ad0a0fe7fa769ea3 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Thu, 10 Jan 2019 19:08:41 +0100 Subject: [PATCH 02/27] [mtouch] Add support for arm64_32 --- msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs | 4 ++++ tests/mtouch/MTouch.cs | 4 ++-- tools/mtouch/Application.cs | 10 +++++++++- tools/mtouch/Target.cs | 6 +++++- tools/mtouch/mtouch.cs | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs b/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs index 0f04fe30e215..f0d283a2eba4 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs +++ b/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs @@ -24,6 +24,7 @@ enum TargetArchitecture ARMv7s = 16, ARMv7k = 32, ARM64 = 64, + ARM64_32 = 128, // Note: needed for backwards compatability ARMv6_ARMv7 = ARMv6 | ARMv7, @@ -486,6 +487,9 @@ protected override string GenerateCommandLineCommands () if (architectures.HasFlag (TargetArchitecture.ARMv7k)) abi += (abi.Length > 0 ? "," : "") + "armv7k" + llvm; + if (architectures.HasFlag (TargetArchitecture.ARM64_32)) + abi += (abi.Length > 0 ? "," : "") + "arm64_32" + llvm; + if (string.IsNullOrEmpty (abi)) abi = "armv7" + llvm + thumb; } diff --git a/tests/mtouch/MTouch.cs b/tests/mtouch/MTouch.cs index 0fd6ef8ce0c2..dd654aa4588a 100644 --- a/tests/mtouch/MTouch.cs +++ b/tests/mtouch/MTouch.cs @@ -676,7 +676,7 @@ public void MT0015 () mtouch.CreateTemporaryApp (); mtouch.Abi = "invalid-arm"; mtouch.AssertExecuteFailure (MTouchAction.BuildSim, "build"); - mtouch.AssertError (15, "Invalid ABI: invalid-arm. 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."); + mtouch.AssertError (15, "Invalid ABI: invalid-arm. Supported ABIs are: i386, x86_64, armv7, armv7+llvm, armv7+llvm+thumb2, armv7s, armv7s+llvm, armv7s+llvm+thumb2, armv7k, armv7k+llvm, arm64, arm64+llvm, arm64_32 and arm64_32+llvm."); } } @@ -2416,7 +2416,7 @@ public void Architectures_Unified_Invalid () 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."); + 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, arm64+llvm, arm64_32 and arm64_32+llvm."); mtouch.Abi = "armv7"; Assert.AreEqual (1, mtouch.Execute (MTouchAction.BuildSim)); diff --git a/tools/mtouch/Application.cs b/tools/mtouch/Application.cs index 6cec4954da11..a5e7d5d16e8e 100644 --- a/tools/mtouch/Application.cs +++ b/tools/mtouch/Application.cs @@ -706,6 +706,8 @@ public void ValidateAbi () if (IsDeviceBuild) { validAbis.Add (Abi.ARMv7k); validAbis.Add (Abi.ARMv7k | Abi.LLVM); + validAbis.Add (Abi.ARM64_32); + validAbis.Add (Abi.ARM64_32 | Abi.LLVM); } else { validAbis.Add (Abi.i386); } @@ -777,6 +779,12 @@ public void ParseAbi (string abi) case "arm64+llvm": value = Abi.ARM64 | Abi.LLVM; break; + case "arm64_32": + value = Abi.ARM64_32; + break; + case "arm64_32+llvm": + value = Abi.ARM64_32 | Abi.LLVM; + break; case "armv7k": value = Abi.ARMv7k; break; @@ -784,7 +792,7 @@ public void ParseAbi (string abi) value = Abi.ARMv7k | Abi.LLVM; break; default: - throw new MonoTouchException (15, true, "Invalid ABI: {0}. 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.", str); + throw new MonoTouchException (15, true, "Invalid ABI: {0}. Supported ABIs are: i386, x86_64, armv7, armv7+llvm, armv7+llvm+thumb2, armv7s, armv7s+llvm, armv7s+llvm+thumb2, armv7k, armv7k+llvm, arm64, arm64+llvm, arm64_32 and arm64_32+llvm.", str); } // merge this value with any existing ARMv? already specified. diff --git a/tools/mtouch/Target.cs b/tools/mtouch/Target.cs index 00c99c11b567..effff6eb116a 100644 --- a/tools/mtouch/Target.cs +++ b/tools/mtouch/Target.cs @@ -106,7 +106,11 @@ public void SelectMonoNative () MonoNativeMode = App.DeploymentTarget.Major >= 10 ? MonoNativeMode.Unified : MonoNativeMode.Compat; break; case ApplePlatform.WatchOS: - MonoNativeMode = App.DeploymentTarget.Major >= 3 ? MonoNativeMode.Unified : MonoNativeMode.Compat; + if (Application.IsArchEnabled (Abis, Abi.ARM64_32)) { + MonoNativeMode = MonoNativeMode.Unified; + } else { + MonoNativeMode = App.DeploymentTarget.Major >= 3 ? MonoNativeMode.Unified : MonoNativeMode.Compat; + } break; default: throw ErrorHelper.CreateError (71, "Unknown platform: {0}. This usually indicates a bug in Xamarin.iOS; please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new with a test case.", App.Platform); diff --git a/tools/mtouch/mtouch.cs b/tools/mtouch/mtouch.cs index 3668f1e29ee6..92329c06d71c 100644 --- a/tools/mtouch/mtouch.cs +++ b/tools/mtouch/mtouch.cs @@ -1067,7 +1067,7 @@ static Application ParseArguments (string [] args, out Action a) }, true // do not show the option anymore }, - { "abi=", "Comma-separated list of ABIs to target. Currently supported: armv7, armv7+llvm, armv7+llvm+thumb2, armv7s, armv7s+llvm, armv7s+llvm+thumb2, arm64, arm64+llvm, i386, x86_64", v => app.ParseAbi (v) }, + { "abi=", "Comma-separated list of ABIs to target. Currently supported: armv7, armv7+llvm, armv7+llvm+thumb2, armv7s, armv7s+llvm, armv7s+llvm+thumb2, arm64, arm64+llvm, arm64_32, arm64_32+llvm, i386, x86_64", v => app.ParseAbi (v) }, { "override-abi=", "Override any previous abi. Only used for testing.", v => { app.ClearAbi (); app.ParseAbi (v); }, true }, // Temporary command line arg until XS has better support for 64bit architectures. { "cxx", "Enable C++ support", v => { app.EnableCxx = true; }}, { "enable-repl:", "Enable REPL support. For simulator only and disabling linking is recommended.", v => { app.EnableRepl = ParseBool (v, "enable-repl"); } }, From 4606d37d645aa14db41168770c53b6fd0a7e8158 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Wed, 23 Jan 2019 21:01:43 +0100 Subject: [PATCH 03/27] [build/runtime] Add build rules for arm64_32 --- Make.config | 2 + builds/Makefile | 139 ++++++++++++++++++++++++++++++++------------- mk/rules.mk | 13 +++++ runtime/Makefile | 9 ++- runtime/bindings.h | 2 +- 5 files changed, 125 insertions(+), 40 deletions(-) diff --git a/Make.config b/Make.config index 673608c612a6..cf6441445f81 100644 --- a/Make.config +++ b/Make.config @@ -226,7 +226,9 @@ SIMULATORWATCH_OBJC_CFLAGS = $(SIMULATORWATCH_CFLAGS) $(COMMON_SIMULATOR_OBJC_CF DEVICEWATCH_SDK = $(XCODE_DEVELOPER_ROOT)/Platforms/WatchOS.platform/Developer/SDKs/WatchOS$(WATCH_SDK_VERSION).sdk DEVICEWATCH_CFLAGS = -arch armv7k -mwatchos-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(DEVICEWATCH_SDK) $(CFLAGS) -fembed-bitcode $(IOS_COMMON_DEFINES) +DEVICEWATCH64_32_CFLAGS = -arch arm64_32 -mwatchos-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(DEVICEWATCH_SDK) $(CFLAGS) -fembed-bitcode $(IOS_COMMON_DEFINES) DEVICEWATCH_OBJC_CFLAGS = $(DEVICEWATCH_CFLAGS) $(DEVICE_OBJC_CFLAGS) +DEVICEWATCH64_32_OBJC_CFLAGS = $(DEVICEWATCH64_32_CFLAGS) $(DEVICE_OBJC_CFLAGS) # TVOS diff --git a/builds/Makefile b/builds/Makefile index 6bd3a23d4af8..d13a34694eaf 100644 --- a/builds/Makefile +++ b/builds/Makefile @@ -1310,15 +1310,16 @@ WATCHOS_BIN_PATH = $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/u ifdef INCLUDE_WATCH ifdef INCLUDE_DEVICE -build:: build-targetwatch -clean-local:: clean-targetwatch +build:: build-targetwatch build-targetwatch64_32 +clean-local:: clean-targetwatch clean-targetwatch64_32 install-local:: install-watchos all-local:: install-watchos targetwatch: build-targetwatch install-watchos -watchos:: targetwatch +targetwatch64_32: build-targetwatch64_32 install-watch64_32 +watchos:: targetwatch targetwatch64_32 -.PHONY: targetwatch +.PHONY: targetwatch targetwatch64_32 .stamp-build-targetwatch: .stamp-build-crosswatch $(MONO_PATH)/configure $(SDK_CONFIG) $(MONO_DEPENDENCIES) $(MAKE) -C $(SDK_BUILDDIR) package-ios-targetwatch $(SDK_ARGS) @@ -1326,39 +1327,84 @@ watchos:: targetwatch $(Q) $(CP) -r $(SDK_DESTDIR)/ios-targetwatch-release/* $(BUILD_DESTDIR)/targetwatch $(Q) touch $@ +.stamp-build-targetwatch64_32: $(MONO_PATH)/configure $(SDK_CONFIG) $(MONO_DEPENDENCIES) + $(MAKE) -C $(SDK_BUILDDIR) package-ios-targetwatch64_32 $(SDK_ARGS) + $(Q) mkdir -p $(BUILD_DESTDIR)/targetwatch64_32 + $(Q) $(CP) -r $(SDK_DESTDIR)/ios-targetwatch64_32-release/* $(BUILD_DESTDIR)/targetwatch64_32 + $(Q) touch $@ + build-targetwatch: .stamp-build-targetwatch +build-targetwatch64_32: .stamp-build-targetwatch64_32 clean-targetwatch: $(Q) rm -rf $(BUILD_DESTDIR)/targetwatch .stamp-*-targetwatch $(MAKE) -C $(SDK_BUILDDIR) clean-ios-targetwatch $(SDK_ARGS) -setup-watchos: setup-targetwatch -build-watchos: build-targetwatch -clean-watchos: clean-targetwatch - -WATCHOS_TARGET_LIBMONOSGEN = $(BUILD_DESTDIR)/targetwatch/lib/libmonosgen-2.0.a -WATCHOS_TARGET_SHAREDMONOSGEN = $(BUILD_DESTDIR)/targetwatch/lib/libmonosgen-2.0.dylib -WATCHOS_TARGET_LIBLOGPROFILER = $(BUILD_DESTDIR)/targetwatch/lib/libmono-profiler-log-static.a -WATCHOS_TARGET_LIBMONOEEINTERP = $(BUILD_DESTDIR)/targetwatch/lib/libmono-ee-interp.a -WATCHOS_TARGET_LIBMONOICALLTABLE = $(BUILD_DESTDIR)/targetwatch/lib/libmono-icall-table.a -WATCHOS_TARGET_LIBMONOILGEN = $(BUILD_DESTDIR)/targetwatch/lib/libmono-ilgen.a -WATCHOS_TARGET_SHAREDLIBLOGPROFILER = $(BUILD_DESTDIR)/targetwatch/lib/libmono-profiler-log.0.dylib -WATCHOS_TARGET_LIBMONONATIVECOMPAT = $(BUILD_DESTDIR)/targetwatch/lib/libmono-native-compat.a -WATCHOS_TARGET_LIBMONONATIVEUNIFIED = $(BUILD_DESTDIR)/targetwatch/lib/libmono-native-unified.a -WATCHOS_TARGET_SHAREDLIBMONONATIVECOMPAT = $(BUILD_DESTDIR)/targetwatch/lib/libmono-native-compat.dylib -WATCHOS_TARGET_SHAREDLIBMONONATIVEUNIFIED = $(BUILD_DESTDIR)/targetwatch/lib/libmono-native-unified.dylib - -$(WATCHOS_TARGET_LIBMONOSGEN): .stamp-build-targetwatch -$(WATCHOS_TARGET_SHAREDMONOSGEN): .stamp-build-targetwatch -$(WATCHOS_TARGET_LIBLOGPROFILER): .stamp-build-targetwatch -$(WATCHOS_TARGET_LIBMONOEEINTERP): .stamp-build-targetwatch -$(WATCHOS_TARGET_LIBMONOICALLTABLE): .stamp-build-targetwatch -$(WATCHOS_TARGET_LIBMONOILGEN): .stamp-build-targetwatch -$(WATCHOS_TARGET_SHAREDLIBLOGPROFILER): .stamp-build-targetwatch -$(WATCHOS_TARGET_LIBMONONATIVECOMPAT): .stamp-build-targetwatch -$(WATCHOS_TARGET_LIBMONONATIVEUNIFIED): .stamp-build-targetwatch -$(WATCHOS_TARGET_SHAREDLIBMONONATIVECOMPAT): .stamp-build-targetwatch -$(WATCHOS_TARGET_SHAREDLIBMONONATIVEUNIFIED): .stamp-build-targetwatch +clean-targetwatch64_32: + $(Q) rm -rf $(BUILD_DESTDIR)/targetwatch64_32 .stamp-*-targetwatch64_32 + $(MAKE) -C $(SDK_BUILDDIR) clean-ios-targetwatch64_32 $(SDK_ARGS) + +setup-watchos: setup-targetwatch setup-targetwatch64_32 +build-watchos: build-targetwatch build-targetwatch64_32 +clean-watchos: clean-targetwatch clean-targetwatch64_32 + +WATCHOS_TARGET_LIBMONOSGEN = \ + $(BUILD_DESTDIR)/targetwatch/lib/libmonosgen-2.0.a \ + $(BUILD_DESTDIR)/targetwatch64_32/lib/libmonosgen-2.0.a + +WATCHOS_TARGET_SHAREDMONOSGEN = \ + $(BUILD_DESTDIR)/targetwatch/lib/libmonosgen-2.0.dylib \ + $(BUILD_DESTDIR)/targetwatch64_32/lib/libmonosgen-2.0.dylib + +WATCHOS_TARGET_LIBLOGPROFILER = \ + $(BUILD_DESTDIR)/targetwatch/lib/libmono-profiler-log-static.a \ + $(BUILD_DESTDIR)/targetwatch64_32/lib/libmono-profiler-log-static.a + +WATCHOS_TARGET_LIBMONOEEINTERP = \ + $(BUILD_DESTDIR)/targetwatch/lib/libmono-ee-interp.a \ + $(BUILD_DESTDIR)/targetwatch64_32/lib/libmono-ee-interp.a + +WATCHOS_TARGET_LIBMONOICALLTABLE = \ + $(BUILD_DESTDIR)/targetwatch/lib/libmono-icall-table.a \ + $(BUILD_DESTDIR)/targetwatch64_32/lib/libmono-icall-table.a + +WATCHOS_TARGET_LIBMONOILGEN = \ + $(BUILD_DESTDIR)/targetwatch/lib/libmono-ilgen.a \ + $(BUILD_DESTDIR)/targetwatch64_32/lib/libmono-ilgen.a + +WATCHOS_TARGET_SHAREDLIBLOGPROFILER = \ + $(BUILD_DESTDIR)/targetwatch/lib/libmono-profiler-log.0.dylib \ + $(BUILD_DESTDIR)/targetwatch64_32/lib/libmono-profiler-log.0.dylib + +WATCHOS_TARGET_LIBMONONATIVECOMPAT = \ + $(BUILD_DESTDIR)/targetwatch/lib/libmono-native-compat.a \ + +WATCHOS_TARGET_LIBMONONATIVEUNIFIED = \ + $(BUILD_DESTDIR)/targetwatch/lib/libmono-native-unified.a \ + $(BUILD_DESTDIR)/targetwatch64_32/lib/libmono-native.a \ + +WATCHOS_TARGET_SHAREDLIBMONONATIVECOMPAT = \ + $(BUILD_DESTDIR)/targetwatch/lib/libmono-native-compat.dylib \ + +WATCHOS_TARGET_SHAREDLIBMONONATIVEUNIFIED = \ + $(BUILD_DESTDIR)/targetwatch/lib/libmono-native-unified.dylib \ + $(BUILD_DESTDIR)/targetwatch64_32/lib/libmono-native.dylib \ + +WATCHOS_TARGET_MONOFRAMEWORK = \ + $(BUILD_DESTDIR)/targetwatch/tmp-lib/Mono \ + $(BUILD_DESTDIR)/targetwatch64_32/tmp-lib/Mono + +$(WATCHOS_TARGET_LIBMONOSGEN): .stamp-build-targetwatch .stamp-build-targetwatch64_32 +$(WATCHOS_TARGET_SHAREDMONOSGEN): .stamp-build-targetwatch .stamp-build-targetwatch64_32 +$(WATCHOS_TARGET_LIBLOGPROFILER): .stamp-build-targetwatch .stamp-build-targetwatch64_32 +$(WATCHOS_TARGET_LIBMONOEEINTERP): .stamp-build-targetwatch .stamp-build-targetwatch64_32 +$(WATCHOS_TARGET_LIBMONOICALLTABLE): .stamp-build-targetwatch .stamp-build-targetwatch64_32 +$(WATCHOS_TARGET_LIBMONOILGEN): .stamp-build-targetwatch .stamp-build-targetwatch64_32 +$(WATCHOS_TARGET_SHAREDLIBLOGPROFILER): .stamp-build-targetwatch .stamp-build-targetwatch64_32 +$(WATCHOS_TARGET_LIBMONONATIVECOMPAT): .stamp-build-targetwatch .stamp-build-targetwatch64_32 +$(WATCHOS_TARGET_LIBMONONATIVEUNIFIED): .stamp-build-targetwatch .stamp-build-targetwatch64_32 +$(WATCHOS_TARGET_SHAREDLIBMONONATIVECOMPAT): .stamp-build-targetwatch .stamp-build-targetwatch64_32 +$(WATCHOS_TARGET_SHAREDLIBMONONATIVEUNIFIED): .stamp-build-targetwatch .stamp-build-targetwatch64_32 device:: watchos @@ -1385,7 +1431,9 @@ $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/usr/lib/libmonosgen-2.0.a: $(WATCHOS_TARGET $(Q) $(WATCHOS_BIN_PATH)/lipo $(WATCHOS_TARGET_LIBMONOSGEN) -create -output $@ $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/usr/lib/libmonosgen-2.0.dylib: $(WATCHOS_TARGET_SHAREDMONOSGEN) | $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/usr/lib - $(Q_STRIP) $(WATCHOS_BIN_PATH)/bitcode_strip $(WATCHOS_TARGET_SHAREDMONOSGEN) -m -o $@ + $(Q_STRIP) $(WATCHOS_BIN_PATH)/bitcode_strip $(BUILD_DESTDIR)/targetwatch/lib/libmonosgen-2.0.dylib -m -o $(BUILD_DESTDIR)/targetwatch/tmp-lib/libmonosgen-2.0.dylib + $(Q_STRIP) $(WATCHOS_BIN_PATH)/bitcode_strip $(BUILD_DESTDIR)/targetwatch64_32/lib/libmonosgen-2.0.dylib -m -o $(BUILD_DESTDIR)/targetwatch64_32/tmp-lib/libmonosgen-2.0.dylib + $(Q_STRIP) $(WATCHOS_BIN_PATH)/lipo $(BUILD_DESTDIR)/targetwatch/tmp-lib/libmonosgen-2.0.dylib $(BUILD_DESTDIR)/targetwatch64_32/tmp-lib/libmonosgen-2.0.dylib -create -output $@ $(Q) $(WATCHOS_BIN_PATH)/install_name_tool -id @rpath/libmonosgen-2.0.dylib $@ $(Q) dsymutil -t 4 -o $@.dSYM $@ @@ -1402,8 +1450,13 @@ $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/usr/lib/libmono-ilgen.a: $(WATCHOS_TARGET_L $(Q) $(WATCHOS_BIN_PATH)/lipo $(WATCHOS_TARGET_LIBMONOILGEN) -create -output $@ $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/usr/lib/libmono-profiler-log.dylib: $(WATCHOS_TARGET_SHAREDLIBLOGPROFILER) | $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/usr/lib - $(Q) $(WATCHOS_BIN_PATH)/bitcode_strip $(WATCHOS_TARGET_SHAREDLIBLOGPROFILER) -m -o $@ - $(Q) $(WATCHOS_BIN_PATH)/install_name_tool -id @rpath/libmono-profiler-log.dylib -change $(SDK_DESTDIR)/ios-targetwatch-release/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib $@ + $(Q) $(WATCHOS_BIN_PATH)/bitcode_strip $(BUILD_DESTDIR)/targetwatch/lib/libmono-profiler-log.0.dylib -m -o $(BUILD_DESTDIR)/targetwatch/tmp-lib/libmono-profiler-log.0.dylib + $(Q) $(WATCHOS_BIN_PATH)/bitcode_strip $(BUILD_DESTDIR)/targetwatch64_32/lib/libmono-profiler-log.0.dylib -m -o $(BUILD_DESTDIR)/targetwatch64_32/tmp-lib/libmono-profiler-log.0.dylib + $(Q) $(WATCHOS_BIN_PATH)/lipo $(BUILD_DESTDIR)/targetwatch/tmp-lib/libmono-profiler-log.0.dylib $(BUILD_DESTDIR)/targetwatch64_32/tmp-lib/libmono-profiler-log.0.dylib -create -output $@ + $(Q) $(WATCHOS_BIN_PATH)/install_name_tool -id @rpath/libmono-profiler-log.dylib \ + -change $(SDK_DESTDIR)/ios-targetwatch-release/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib \ + -change $(SDK_DESTDIR)/ios-targetwatch64_32-release/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib \ + $@ $(Q) dsymutil -t 4 -o $@.dSYM $@ $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/usr/lib/libmono-native-compat.a: $(WATCHOS_TARGET_LIBMONONATIVECOMPAT) | $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/usr/lib @@ -1418,15 +1471,22 @@ $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/usr/lib/libmono-native-compat.dylib: $(WATC $(Q) dsymutil -t 4 -o $@.dSYM $@ $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/usr/lib/libmono-native-unified.dylib: $(WATCHOS_TARGET_SHAREDLIBMONONATIVEUNIFIED) | $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/usr/lib - $(Q) $(WATCHOS_BIN_PATH)/bitcode_strip $(WATCHOS_TARGET_SHAREDLIBMONONATIVEUNIFIED) -m -o $@ - $(Q) $(WATCHOS_BIN_PATH)/install_name_tool -id @rpath/libmono-native-unified.dylib -change $(SDK_DESTDIR)/ios-targetwatch-release/lib/libmono-native-unified.dylib @rpath/libmono-native-unified.dylib -change $(SDK_DESTDIR)/ios-targetwatch-release/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib $@ + $(Q_STRIP) $(WATCHOS_BIN_PATH)/bitcode_strip $(BUILD_DESTDIR)/targetwatch/lib/libmono-native-unified.dylib -m -o $(BUILD_DESTDIR)/targetwatch/tmp-lib/libmono-native-unified.dylib + $(Q_STRIP) $(WATCHOS_BIN_PATH)/bitcode_strip $(BUILD_DESTDIR)/targetwatch64_32/lib/libmono-native.dylib -m -o $(BUILD_DESTDIR)/targetwatch64_32/tmp-lib/libmono-native.dylib + $(Q_STRIP) $(WATCHOS_BIN_PATH)/lipo $(BUILD_DESTDIR)/targetwatch/tmp-lib/libmono-native-unified.dylib $(BUILD_DESTDIR)/targetwatch64_32/tmp-lib/libmono-native.dylib -create -output $@ + $(Q) $(WATCHOS_BIN_PATH)/install_name_tool -id @rpath/libmono-native-unified.dylib \ + -change $(SDK_DESTDIR)/ios-targetwatch64_32-release/lib/libmono-native.dylib @rpath/libmono-native-unified.dylib \ + -change $(SDK_DESTDIR)/ios-targetwatch64_32-release/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib \ + -change $(SDK_DESTDIR)/ios-targetwatch-release/lib/libmono-native-unified.dylib @rpath/libmono-native-unified.dylib \ + -change $(SDK_DESTDIR)/ios-targetwatch-release/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.dylib \ + $@ $(Q) dsymutil -t 4 -o $@.dSYM $@ $(WATCHOS_DIRECTORIES): $(Q) mkdir -p $@ -$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks/Mono.framework/Mono: $(BUILD_DESTDIR)/targetwatch/tmp-lib/Mono | $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks/Mono.framework - $(Q) $(CP) $< $@ +$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks/Mono.framework/Mono: $(WATCHOS_TARGET_MONOFRAMEWORK) | $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks/Mono.framework + $(Q) lipo $(WATCHOS_TARGET_MONOFRAMEWORK) -create -output $@ $(Q) dsymutil -t 4 -o $(patsubst %/,%,$(dir $@)).dSYM $@ $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks/Mono.framework/Info.plist: Mono.framework-watchos.Info.plist | $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks/Mono.framework @@ -1435,6 +1495,9 @@ $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks/Mono.framework/Info.plist: Mono. $(BUILD_DESTDIR)/targetwatch/tmp-lib/Mono: $(BUILD_DESTDIR)/targetwatch/lib/libmonosgen-2.0.a $(Q_GEN) CC="$(IOS_CC)" ./create-shared-library.sh $< $@ -arch armv7k -install_name @rpath/Mono.framework/Mono -mwatchos-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(DEVICEWATCH_SDK) -lc++ -fembed-bitcode +$(BUILD_DESTDIR)/targetwatch64_32/tmp-lib/Mono: $(BUILD_DESTDIR)/targetwatch64_32/lib/libmonosgen-2.0.a + $(Q_GEN) CC="$(IOS_CC)" ./create-shared-library.sh $< $@ -arch arm64_32 -install_name @rpath/Mono.framework/Mono -mwatchos-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(DEVICEWATCH_SDK) -lc++ -fembed-bitcode + install-watchos: $(WATCHOS_TARGETS) endif # INCLUDE_DEVICE diff --git a/mk/rules.mk b/mk/rules.mk index 3900858a9de8..79aadf8ff4bd 100644 --- a/mk/rules.mk +++ b/mk/rules.mk @@ -12,6 +12,7 @@ DEV64_I := $(COMMON_I) SIMW_I := $(COMMON_I) DEVW_I := $(COMMON_I) +DEVW64_32_I := $(COMMON_I) SIM_TV_I:= $(COMMON_I) DEV_TV_I:= $(COMMON_I) @@ -120,6 +121,18 @@ define NativeCompilationTemplate .libs/watchos/%$(1).armv7k.framework: | .libs/watchos $$(call Q_2,LD, [watchos]) $(DEVICE_CC) $(DEVICEWATCH_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks -fapplication-extension +.libs/watchos/%$(1).arm64_32.o: %.m $(EXTRA_DEPENDENCIES) | .libs/watchos + $$(call Q_2,OBJC, [watchos]) $(DEVICE_CC) $(DEVICEWATCH64_32_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(DEVW64_32_I) -g $(2) -c $$< -o $$@ + +.libs/watchos/%$(1).arm64_32.o: %.c $(EXTRA_DEPENDENCIES) | .libs/watchos + $$(call Q_2,CC, [watchos]) $(DEVICE_CC) $(DEVICEWATCH64_32_CFLAGS) $$(EXTRA_DEFINES) $(DEVW64_32_I) -g $(2) -c $$< -o $$@ + +.libs/watchos/%$(1).arm64_32.dylib: | .libs/watchos + $$(call Q_2,LD, [watchos]) $(DEVICE_CC) $(DEVICEWATCH64_32_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/usr/lib -fapplication-extension + +.libs/watchos/%$(1).arm64_32.framework: | .libs/watchos + $$(call Q_2,LD, [watchos]) $(DEVICE_CC) $(DEVICEWATCH64_32_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks -fapplication-extension + ## tv simulator .libs/tvos/%$(1).x86_64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/tvos diff --git a/runtime/Makefile b/runtime/Makefile index e8b3c8a9964c..fbb01e156ceb 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -197,7 +197,7 @@ $(eval $(call PlatformTemplate,ios,IOS,armv7 armv7s arm64,x86 x86_64,IOS,IPHONE) endif ifdef INCLUDE_WATCH -$(eval $(call PlatformTemplate,watchos,WATCHOS,armv7k,x86,WATCH,WATCH)) +$(eval $(call PlatformTemplate,watchos,WATCHOS,armv7k arm64_32,x86,WATCH,WATCH)) endif ifdef INCLUDE_TVOS @@ -336,6 +336,7 @@ armv7_$(1)$(3)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(4).armv7.o,$$($(2)_SOURCE_ armv7s_$(1)$(3)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(4).armv7s.o,$$($(2)_SOURCE_STEMS)) armv7k_$(1)$(3)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(4).armv7k.o,$$($(2)_SOURCE_STEMS)) arm64_$(1)$(3)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(4).arm64.o,$$($(2)_SOURCE_STEMS)) $$(patsubst %,.libs/$(1)/%$(4).arm64.o,$$($(2)_ARM64_SOURCE_STEMS)) +arm64_32_$(1)$(3)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(4).arm64_32.o,$$($(2)_SOURCE_STEMS)) $$(foreach arch,$$($(2)_ARCHITECTURES),$$(eval $$(call LibXamarinArchTemplate,$(1),$(2),$(3),$(4),$$(arch)))) @@ -361,6 +362,9 @@ $$(foreach arch,$$($(2)_ARCHITECTURES),$$(eval $$(call LibXamarinArchTemplate,$( .libs/$(1)/libxamarin$(4).armv7k.dylib: EXTRA_FLAGS=$$($(1)$(3)_COMMON_DYLIB_FLAGS) .libs/$(1)/libxamarin$(4).armv7k.dylib: $$(armv7k_$(1)$(3)_OBJECTS) +.libs/$(1)/libxamarin$(4).arm64_32.dylib: EXTRA_FLAGS=$$($(1)$(3)_COMMON_DYLIB_FLAGS) +.libs/$(1)/libxamarin$(4).arm64_32.dylib: $$(arm64_32_$(1)$(3)_OBJECTS) + .libs/$(1)/Xamarin$(4).x86.framework: EXTRA_FLAGS=$$($(1)$(3)_COMMON_FRAMEWORK_FLAGS) .libs/$(1)/Xamarin$(4).x86.framework: $$(x86_$(1)$(3)_OBJECTS) @@ -378,6 +382,9 @@ $$(foreach arch,$$($(2)_ARCHITECTURES),$$(eval $$(call LibXamarinArchTemplate,$( .libs/$(1)/Xamarin$(4).armv7k.framework: EXTRA_FLAGS=$$($(1)$(3)_COMMON_FRAMEWORK_FLAGS) .libs/$(1)/Xamarin$(4).armv7k.framework: $$(armv7k_$(1)$(3)_OBJECTS) + +.libs/$(1)/Xamarin$(4).arm64_32.framework: EXTRA_FLAGS=$$($(1)$(3)_COMMON_FRAMEWORK_FLAGS) +.libs/$(1)/Xamarin$(4).arm64_32.framework: $$(arm64_32_$(1)$(3)_OBJECTS) endef $(eval $(call LibXamarinTemplate,ios,IOS)) diff --git a/runtime/bindings.h b/runtime/bindings.h index 9b10ee2825bf..0a623df70ee4 100644 --- a/runtime/bindings.h +++ b/runtime/bindings.h @@ -226,7 +226,7 @@ struct MPSImageHistogramInfoWrapper { // entire struct on a 16-byte boundary, which doesn't match how we've // defined it in managed code (explicit layout, but no specific alignment). // So we need to manually pad the struct to match the managed definition. -#if defined (__x86_64__) || defined (__arm64__) +#if !defined(__ILP32__) uint8_t dummy[7]; #else uint8_t dummy[11]; From f272f69e3ad259a2dd4d4c658fdc1cb90ebc1ff7 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 9 May 2019 15:00:18 +0200 Subject: [PATCH 04/27] [runtime] Enable the varargs dynamic trampolines for arm64_32. The varargs dynamic is not even close to correct for arm64_32, but it's still better than failing to compile the runtime. A proper dynamic registrar for arm64_32 is much more complicated, in particular because we can't use assembly code, so it will have to be implemented later. --- runtime/trampolines-varargs.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/trampolines-varargs.m b/runtime/trampolines-varargs.m index 0979b419ac46..70f2eb169978 100644 --- a/runtime/trampolines-varargs.m +++ b/runtime/trampolines-varargs.m @@ -1,4 +1,4 @@ -#if !defined (__i386__) && !defined (__x86_64__) && !defined (__arm64__) +#if !defined (__i386__) && !defined (__x86_64__) && !(defined (__arm64__) && !defined(__ILP32__)) #define __VARARGS_TRAMPOLINES__ 1 #endif From 9c3754b52f8139831f7b440b76316cd9504f4669 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 29 Jan 2019 08:14:26 +0100 Subject: [PATCH 05/27] [msbuild] Make using the fake watchOS 4.3 SDK disabled by default. Since we now have support for ARM64_32. --- .../Xamarin.WatchOS.AppExtension.Common.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS.AppExtension.Common.targets b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS.AppExtension.Common.targets index 2dc84bbb1c20..0434bd6561a3 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS.AppExtension.Common.targets +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.WatchOS.AppExtension.Common.targets @@ -28,7 +28,7 @@ Copyright (C) 2015-2016 Xamarin. All rights reserved. true - True + False From 91a5dc29ae67f7ce633f7e4825125369639673e9 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 7 Feb 2019 18:37:12 +0100 Subject: [PATCH 06/27] [ObjCRuntime] The NSLog_arm64 P/Invoke is now needed on watchOS (ARM64_32) too. --- src/ObjCRuntime/Runtime.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ObjCRuntime/Runtime.cs b/src/ObjCRuntime/Runtime.cs index 05d427a59aed..363149ffff21 100644 --- a/src/ObjCRuntime/Runtime.cs +++ b/src/ObjCRuntime/Runtime.cs @@ -1573,7 +1573,7 @@ static void NSLog (IntPtr format, string s) extern static void NSLog (IntPtr format, [MarshalAs (UnmanagedType.LPStr)] string s); #endif -#if !MONOMAC && !WATCHOS +#if !MONOMAC [DllImport (Constants.FoundationLibrary, EntryPoint = "NSLog")] extern static void NSLog_arm64 (IntPtr format, IntPtr p2, IntPtr p3, IntPtr p4, IntPtr p5, IntPtr p6, IntPtr p7, IntPtr p8, [MarshalAs (UnmanagedType.LPStr)] string s); #endif @@ -1583,7 +1583,7 @@ internal static void NSLog (string format, params object[] args) { var fmt = NSString.CreateNative ("%s"); var val = (args == null || args.Length == 0) ? format : string.Format (format, args); -#if !MONOMAC && !WATCHOS +#if !MONOMAC if (IsARM64CallingConvention) NSLog_arm64 (fmt, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, val); else From e58a31ee8405b4744908c0dc11afbe6896c9036d Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 7 Feb 2019 18:46:08 +0100 Subject: [PATCH 07/27] [CoreGraphics] Fix CGColorConversionInfo on arm64_32. --- src/CoreGraphics/CGColorConversionInfo.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/CoreGraphics/CGColorConversionInfo.cs b/src/CoreGraphics/CGColorConversionInfo.cs index 3434020c3ff8..178cb7232ad2 100644 --- a/src/CoreGraphics/CGColorConversionInfo.cs +++ b/src/CoreGraphics/CGColorConversionInfo.cs @@ -57,16 +57,20 @@ internal CGColorConversionInfo (IntPtr handle, bool owns) /* CGColorSpaceRef __nullable */ IntPtr space3, CGColorConversionInfoTransformType transform3, CGColorRenderingIntent intent3, IntPtr lastSpaceMarker); -#if !MONOMAC && !WATCH +#if !MONOMAC // https://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html // Declare dummies until we're on the stack then the arguments // C language requires arguments smaller than int to be promoted before a call, but beyond that, unused bytes on the stack are not specified by this ABI + // The 'transformX' argument is a CGColorConversionInfoTransformType, which is defined as uint (uint32_t in the header), + // but since each parameter must be pointer-sized (to occupy the right amount of stack space), + // we define it as nuint (and not the enum type, which is 32-bit even on 64-bit platforms). + // Same for the 'intentX' argument (except that it's signed instead of unsigned). [DllImport(Constants.CoreGraphicsLibrary, EntryPoint="CGColorConversionInfoCreateFromList")] extern static /* CGColorConversionInfoRef __nullable */ IntPtr CGColorConversionInfoCreateFromList_arm64 (/* __nullable CFDictionaryRef */ IntPtr options, - IntPtr space1, long transform1, long intent1, // varargs starts after them + IntPtr space1, nuint transform1, nint intent1, // varargs starts after them IntPtr dummy4, IntPtr dummy5, IntPtr dummy6, IntPtr dummy7, // dummies so the rest goes to the stack - IntPtr space2, long transform2, long intent2, - IntPtr space3, long transform3, long intent3, + IntPtr space2, nuint transform2, nint intent2, + IntPtr space3, nuint transform3, nint intent3, IntPtr lastSpaceMarker); #endif @@ -92,12 +96,12 @@ public CGColorConversionInfo (NSDictionary options, params GColorConversionInfoT var first = triples [0]; // there's always one var second = triples.Length > 1 ? triples [1] : empty; var third = triples.Length > 2 ? triples [2] : empty; -#if !MONOMAC && !WATCH +#if !MONOMAC if (Runtime.IsARM64CallingConvention) { - Handle = CGColorConversionInfoCreateFromList_arm64 (o, NativeObjectHelper.GetHandle (first.Space), (long) first.Transform, (long) first.Intent, + Handle = CGColorConversionInfoCreateFromList_arm64 (o, NativeObjectHelper.GetHandle (first.Space), (uint) first.Transform, (int) first.Intent, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, - NativeObjectHelper.GetHandle (second.Space), (long) second.Transform, (long) second.Intent, - NativeObjectHelper.GetHandle (third.Space), (long) third.Transform, (long) third.Intent, + NativeObjectHelper.GetHandle (second.Space), (uint) second.Transform, (int) second.Intent, + NativeObjectHelper.GetHandle (third.Space), (uint) third.Transform, (int) third.Intent, IntPtr.Zero); } else { #endif @@ -105,7 +109,7 @@ public CGColorConversionInfo (NSDictionary options, params GColorConversionInfoT NativeObjectHelper.GetHandle (second.Space), second.Transform, second.Intent, NativeObjectHelper.GetHandle (third.Space), third.Transform, third.Intent, IntPtr.Zero); -#if !MONOMAC && !WATCH +#if !MONOMAC } #endif if (Handle == IntPtr.Zero) From bb09ab8a2426c531bac24dbe3e447674671d9d9b Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 30 Jan 2019 08:57:59 +0100 Subject: [PATCH 08/27] [generator] Treat arm64_32 as arm64 when dealing with objc_msgSend behavior. --- src/generator.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/generator.cs b/src/generator.cs index f084a925717a..b820d38e9c80 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -3863,7 +3863,12 @@ void GenerateNewStyleInvoke (bool supercall, MethodInfo mi, MemberInformation mi if (is_stret_multi) { print ("if (Runtime.Arch == Arch.DEVICE) {"); indent++; - print ("if (IntPtr.Size == 8) {"); + if (BindingTouch.CurrentPlatform == PlatformName.WatchOS) { + print ("if (global::ObjCRuntime.Runtime.IsARM64CallingConvention) {"); + } else { + print ("if (IntPtr.Size == 8) {"); + + } indent++; GenerateInvoke (false, supercall, mi, minfo, selector, args [index64], assign_to_temp, category_type, false, EnumMode.Bit64); indent--; From 2f8100d9626421bbb378dadfa72fa200b65835c0 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 29 Jan 2019 08:16:42 +0100 Subject: [PATCH 09/27] [xharness] Add ARM64_32 support. --- .../BundledResources/BundledResources.csproj | 4 +- .../EmbeddedResources.csproj | 4 +- .../BCLTests/BCLTests-watchos-app.csproj.in | 4 +- .../BCLTests-watchos-extension.csproj.in | 48 ++++++++++++++- .../BCLTests/BCLTests-watchos.csproj.in | 4 +- .../watchOS/Container/Container.csproj | 4 +- .../mscorlib/mscorlib-split.csproj.template | 4 +- .../bindings-framework-test.csproj | 4 +- tests/bindings-test/bindings-test.csproj | 4 +- tests/bindings-test2/bindings-test2.csproj | 4 +- tests/fsharplibrary/fsharplibrary.fsproj | 4 +- tests/templates/WatchApp/App.csproj | 54 +++++++++++++++++ .../templates/WatchContainer/Container.csproj | 4 +- .../templates/WatchExtension/Extension.csproj | 58 ++++++++++++++++++- tests/test-libraries/Makefile | 2 +- tests/xharness/Jenkins.cs | 40 ++++++++++--- tests/xharness/ProjectFileExtensions.cs | 50 +++++++++------- tests/xharness/Simulators.cs | 9 ++- tests/xharness/WatchOSTarget.cs | 34 ++++++++++- 19 files changed, 281 insertions(+), 58 deletions(-) diff --git a/tests/BundledResources/BundledResources.csproj b/tests/BundledResources/BundledResources.csproj index 68f341c960ba..1f9e3f0e83d9 100644 --- a/tests/BundledResources/BundledResources.csproj +++ b/tests/BundledResources/BundledResources.csproj @@ -15,7 +15,7 @@ obj\$(Platform)\$(Configuration)-unified XAMCORE_2_0 - + True full False @@ -24,7 +24,7 @@ prompt 4 - + none True bin\Any CPU\$(Configuration)-unified diff --git a/tests/EmbeddedResources/EmbeddedResources.csproj b/tests/EmbeddedResources/EmbeddedResources.csproj index f48a4c471769..959b2f9527d0 100644 --- a/tests/EmbeddedResources/EmbeddedResources.csproj +++ b/tests/EmbeddedResources/EmbeddedResources.csproj @@ -17,7 +17,7 @@ obj\$(Platform)\$(Configuration)-unified XAMCORE_2_0 - + True full False @@ -26,7 +26,7 @@ prompt 4 - + none True bin\Any CPU\$(Configuration)-unified diff --git a/tests/bcl-test/BCLTests/BCLTests-watchos-app.csproj.in b/tests/bcl-test/BCLTests/BCLTests-watchos-app.csproj.in index 6e4601c25ada..a5da7b00d80b 100644 --- a/tests/bcl-test/BCLTests/BCLTests-watchos-app.csproj.in +++ b/tests/bcl-test/BCLTests/BCLTests-watchos-app.csproj.in @@ -29,7 +29,7 @@ true true - + bin\%NAME%-watchos-app\iPhone\$(Configuration)-watchos-app full true @@ -50,7 +50,7 @@ None iPhone Developer - + bin\%NAME%-watchos-app\iPhone\$(Configuration)-watchos-app true full diff --git a/tests/bcl-test/BCLTests/BCLTests-watchos-extension.csproj.in b/tests/bcl-test/BCLTests/BCLTests-watchos-extension.csproj.in index 0a4240d91a51..5b2eddfeed73 100644 --- a/tests/bcl-test/BCLTests/BCLTests-watchos-extension.csproj.in +++ b/tests/bcl-test/BCLTests/BCLTests-watchos-extension.csproj.in @@ -56,12 +56,36 @@ True iPhone Developer - ARMv7k + ARMv7k, ARM64_32 True cjk,mideast,other,rare,west + + true + false + bin\%NAME%-watchos-extension\iPhone\Debug64_32-watchos-extension + prompt + 4 + true + iPhone Developer + ARM64_32 + + true + + + true + false + bin\%NAME%-watchos-extension\iPhone\Debug32-watchos-extension + prompt + 4 + true + iPhone Developer + ARMv7k + + true + none False @@ -77,6 +101,28 @@ true cjk,mideast,other,rare,west + + true + bin\%NAME%-watchos-extension\iPhone\Release64_32-watchos-extension + prompt + 4 + iPhone Developer + true + --nostrip --nosymbolstrip: --aot-options=-O=float32 --gcc_flags='-fembed-bitcode-marker' + ARM64_32 + True + + + true + bin\%NAME%-watchos-extension\iPhone\Release32-watchos-extension + prompt + 4 + iPhone Developer + true + --nostrip --nosymbolstrip: --aot-options=-O=float32 --gcc_flags='-fembed-bitcode-marker' + ARMv7k + True + diff --git a/tests/bcl-test/BCLTests/BCLTests-watchos.csproj.in b/tests/bcl-test/BCLTests/BCLTests-watchos.csproj.in index a78cd43a0fc2..3dfb6d2cfb97 100644 --- a/tests/bcl-test/BCLTests/BCLTests-watchos.csproj.in +++ b/tests/bcl-test/BCLTests/BCLTests-watchos.csproj.in @@ -26,7 +26,7 @@ iPhone Developer true - + bin\%NAME%\iPhone\$(Configuration)-watchos full true @@ -48,7 +48,7 @@ None iPhone Developer - + bin\%NAME%\iPhone\$(Configuration)-watchos true full diff --git a/tests/bcl-test/BCLTests/templates/watchOS/Container/Container.csproj b/tests/bcl-test/BCLTests/templates/watchOS/Container/Container.csproj index 6b168de33783..84ea65e7c93c 100644 --- a/tests/bcl-test/BCLTests/templates/watchOS/Container/Container.csproj +++ b/tests/bcl-test/BCLTests/templates/watchOS/Container/Container.csproj @@ -26,7 +26,7 @@ iPhone Developer true - + bin\iPhone\$(Configuration)-watchos full true @@ -48,7 +48,7 @@ None iPhone Developer - + bin\iPhone\$(Configuration)-watchos true full diff --git a/tests/bcl-test/mscorlib/mscorlib-split.csproj.template b/tests/bcl-test/mscorlib/mscorlib-split.csproj.template index 0705d8035515..42bc16158f73 100644 --- a/tests/bcl-test/mscorlib/mscorlib-split.csproj.template +++ b/tests/bcl-test/mscorlib/mscorlib-split.csproj.template @@ -15,7 +15,7 @@ Xamarin.iOS XAMCORE_2_0;XAMCORE_3_0 - + True full False @@ -25,7 +25,7 @@ 4 True - + none True bin\Any CPU\$(Configuration)-unified diff --git a/tests/bindings-framework-test/bindings-framework-test.csproj b/tests/bindings-framework-test/bindings-framework-test.csproj index 50a4832fe80f..db0661a1567a 100644 --- a/tests/bindings-framework-test/bindings-framework-test.csproj +++ b/tests/bindings-framework-test/bindings-framework-test.csproj @@ -17,7 +17,7 @@ obj\$(Platform)\$(Configuration)-unified XAMCORE_2_0 - + True full False @@ -27,7 +27,7 @@ 4 True - + none True bin\Any CPU\$(Configuration)-unified diff --git a/tests/bindings-test/bindings-test.csproj b/tests/bindings-test/bindings-test.csproj index b48d61312d4d..91a1e10b16ae 100644 --- a/tests/bindings-test/bindings-test.csproj +++ b/tests/bindings-test/bindings-test.csproj @@ -17,7 +17,7 @@ obj\$(Platform)\$(Configuration)-unified XAMCORE_2_0 - + True full False @@ -27,7 +27,7 @@ 4 True - + none True bin\Any CPU\$(Configuration)-unified diff --git a/tests/bindings-test2/bindings-test2.csproj b/tests/bindings-test2/bindings-test2.csproj index 2dd7659f967e..0497fd9609b9 100644 --- a/tests/bindings-test2/bindings-test2.csproj +++ b/tests/bindings-test2/bindings-test2.csproj @@ -17,7 +17,7 @@ obj\$(Platform)\$(Configuration)-unified XAMCORE_2_0 - + True full False @@ -27,7 +27,7 @@ 4 True - + none True bin\Any CPU\$(Configuration)-unified diff --git a/tests/fsharplibrary/fsharplibrary.fsproj b/tests/fsharplibrary/fsharplibrary.fsproj index 67806ae3462a..b41f8506d127 100644 --- a/tests/fsharplibrary/fsharplibrary.fsproj +++ b/tests/fsharplibrary/fsharplibrary.fsproj @@ -17,7 +17,7 @@ obj\$(Platform)\$(Configuration)-unified XAMCORE_2_0 - + true full false @@ -27,7 +27,7 @@ - + true bin\Any CPU\$(Configuration)-unified ;$(DefineConstants) diff --git a/tests/templates/WatchApp/App.csproj b/tests/templates/WatchApp/App.csproj index 2e4ab614d16a..ac82d5428db8 100644 --- a/tests/templates/WatchApp/App.csproj +++ b/tests/templates/WatchApp/App.csproj @@ -30,6 +30,28 @@ true + bin\iPhone\$(Configuration)-watchos-app + full + true + prompt + 4 + ARMv7k,ARM64_32 + %WATCHAPP_PATH%Entitlements.plist + true + iPhone Developer + + + bin\iPhone\$(Configuration)-watchos-app + full + true + prompt + 4 + ARMv7k + %WATCHAPP_PATH%Entitlements.plist + true + iPhone Developer + + bin\iPhone\$(Configuration)-watchos-app full true @@ -51,6 +73,22 @@ iPhone Developer + bin\iPhone\$(Configuration)-watchos-app + true + full + false + DEBUG; + prompt + 4 + ARMv7k,ARM64_32 + %WATCHAPP_PATH%Entitlements.plist + true + iPhone Developer + true + true + true + + bin\iPhone\$(Configuration)-watchos-app true full @@ -66,6 +104,22 @@ true true + + bin\iPhone\$(Configuration)-watchos-app + true + full + false + DEBUG; + prompt + 4 + ARM64_32 + %WATCHAPP_PATH%Entitlements.plist + true + iPhone Developer + true + true + true + diff --git a/tests/templates/WatchContainer/Container.csproj b/tests/templates/WatchContainer/Container.csproj index bfe59b724cd8..37cb73eb9c93 100644 --- a/tests/templates/WatchContainer/Container.csproj +++ b/tests/templates/WatchContainer/Container.csproj @@ -26,7 +26,7 @@ iPhone Developer true - + bin\iPhone\$(Configuration)-watchos full true @@ -48,7 +48,7 @@ None iPhone Developer - + bin\iPhone\$(Configuration)-watchos true full diff --git a/tests/templates/WatchExtension/Extension.csproj b/tests/templates/WatchExtension/Extension.csproj index 255cbce9c574..1630ee888263 100644 --- a/tests/templates/WatchExtension/Extension.csproj +++ b/tests/templates/WatchExtension/Extension.csproj @@ -43,6 +43,20 @@ i386 + True + full + False + bin\iPhone\Debug-watchos-extension + DEBUG;;$(DefineConstants) + prompt + 0 + True + iPhone Developer + + ARMv7k,ARM64_32 + True + + True full False @@ -55,10 +69,36 @@ ARMv7k True - - + + + True + full + False + bin\iPhone\Debug-watchos-extension + DEBUG;;$(DefineConstants) + prompt + 0 + True + iPhone Developer + + ARM64_32 + True + none + False + bin\iPhone\Release-watchos-extension + MONOTOUCH;;$(DefineConstants) + prompt + 4 + iPhone Developer + -v -v -v -v --nosymbolstrip + ARMv7k,ARM64_32 + True + true + true + + none False bin\iPhone\Release-watchos-extension @@ -72,6 +112,20 @@ true true + + none + False + bin\iPhone\Release-watchos-extension + MONOTOUCH;;$(DefineConstants) + prompt + 4 + iPhone Developer + -v -v -v -v --nosymbolstrip + ARM64_32 + True + true + true + diff --git a/tests/test-libraries/Makefile b/tests/test-libraries/Makefile index eedb07230a08..eb1b9b7a84db 100644 --- a/tests/test-libraries/Makefile +++ b/tests/test-libraries/Makefile @@ -126,7 +126,7 @@ ifdef INCLUDE_TVOS $(eval $(call Template,tvos,TVOS,arm64 x86_64,x86_64,arm64,AppleTVSimulator,AppleTVOS,-mtvos-simulator-version-min=9.0,-mtvos-version-min=9.0 -fembed-bitcode)) endif ifdef INCLUDE_WATCH -$(eval $(call Template,watchos,WATCHOS,armv7k x86,i386,armv7k,WatchSimulator,WatchOS,-mwatchos-simulator-version-min=2.0,-mwatchos-version-min=2.0 -fembed-bitcode)) +$(eval $(call Template,watchos,WATCHOS,armv7k x86 arm64_32,i386,armv7k arm64_32,WatchSimulator,WatchOS,-mwatchos-simulator-version-min=2.0,-mwatchos-version-min=2.0 -fembed-bitcode)) endif ifdef INCLUDE_MAC $(eval $(call Template,macos,MACOS,x86_64,x86_64,,MacOSX,MacOSX,-mmacosx-version-min=$(MIN_OSX_VERSION_FOR_MAC),-mmacosx-version-min=$(MIN_OSX_VERSION_FOR_MAC))) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index 8208d7726c07..54ca9adf2ec3 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -143,6 +143,8 @@ AppRunnerTarget[] GetAppRunnerTargets (TestPlatform platform) case TestPlatform.tvOS: return new AppRunnerTarget [] { AppRunnerTarget.Simulator_tvOS }; case TestPlatform.watchOS: + case TestPlatform.watchOS_32: + case TestPlatform.watchOS_64_32: return new AppRunnerTarget [] { AppRunnerTarget.Simulator_watchOS }; case TestPlatform.iOS_Unified: return new AppRunnerTarget [] { AppRunnerTarget.Simulator_iOS32, AppRunnerTarget.Simulator_iOS64 }; @@ -168,6 +170,8 @@ string GetSimulatorMinVersion (TestPlatform platform) case TestPlatform.tvOS: return "tvOS " + Xamarin.SdkVersions.MinTVOSSimulator; case TestPlatform.watchOS: + case TestPlatform.watchOS_32: + case TestPlatform.watchOS_64_32: return "watchOS " + Xamarin.SdkVersions.MinWatchOSSimulator; default: throw new NotImplementedException (platform.ToString ()); @@ -188,7 +192,7 @@ IEnumerable CreateRunSimulatorTaskAsync (XBuildTask buildTask) ignored = new [] { false }; break; case TestPlatform.watchOS: - platforms = new TestPlatform [] { TestPlatform.watchOS }; + platforms = new TestPlatform [] { TestPlatform.watchOS_32 }; ignored = new [] { false }; break; case TestPlatform.iOS_Unified: @@ -579,15 +583,25 @@ IEnumerable CreateRunDeviceTasks () if (!project.SkipwatchOSVariation) { var watchOSProject = project.AsWatchOSProject (); - var buildWatch = new XBuildTask { + var buildWatch32 = new XBuildTask { Jenkins = this, - ProjectConfiguration = "Debug", + ProjectConfiguration = "Debug32", + ProjectPlatform = "iPhone", + Platform = TestPlatform.watchOS_32, + TestName = project.Name, + }; + buildWatch32.CloneTestProject (watchOSProject); + rv.Add (new RunDeviceTask (buildWatch32, Devices.ConnectedWatch) { Ignored = ignored || !IncludewatchOS, BuildOnly = project.BuildOnly }); + + var buildWatch64_32 = new XBuildTask { + Jenkins = this, + ProjectConfiguration = "Debug64_32", ProjectPlatform = "iPhone", - Platform = TestPlatform.watchOS, + Platform = TestPlatform.watchOS_64_32, TestName = project.Name, }; - buildWatch.CloneTestProject (watchOSProject); - rv.Add (new RunDeviceTask (buildWatch, Devices.ConnectedWatch.Where (d => d.IsSupported (project))) { Ignored = ignored || !IncludewatchOS, BuildOnly = project.BuildOnly }); + buildWatch64_32.CloneTestProject (watchOSProject); + rv.Add (new RunDeviceTask (buildWatch64_32, Devices.ConnectedWatch32_64.Where (d => d.IsSupported (project))) { Ignored = ignored || !IncludewatchOS, BuildOnly = project.BuildOnly }); } } @@ -1366,6 +1380,8 @@ IEnumerable find_tasks (StreamWriter writer, string ids) case "?all-watchos": switch (task.Platform) { case TestPlatform.watchOS: + case TestPlatform.watchOS_32: + case TestPlatform.watchOS_64_32: is_match = true; break; default: @@ -2594,6 +2610,8 @@ protected void SetEnvironmentVariables (Process process) case TestPlatform.iOS_TodayExtension64: case TestPlatform.tvOS: case TestPlatform.watchOS: + case TestPlatform.watchOS_32: + case TestPlatform.watchOS_64_32: process.StartInfo.EnvironmentVariables ["MD_APPLE_SDK_ROOT"] = xcodeRoot; process.StartInfo.EnvironmentVariables ["MD_MTOUCH_SDK_ROOT"] = Path.Combine (Harness.IOS_DESTDIR, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current"); process.StartInfo.EnvironmentVariables ["TargetFrameworkFallbackSearchPaths"] = Path.Combine (Harness.IOS_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild-frameworks"); @@ -3509,6 +3527,10 @@ public override string Mode { case TestPlatform.tvOS: case TestPlatform.watchOS: return Platform.ToString () + " - " + XIMode; + case TestPlatform.watchOS_32: + return "watchOS 32-bits - " + XIMode; + case TestPlatform.watchOS_64_32: + return "watchOS 64-bits (ARM64_32) - " + XIMode; case TestPlatform.iOS_Unified32: return "iOS Unified 32-bits - " + XIMode; case TestPlatform.iOS_Unified64: @@ -3594,6 +3616,8 @@ public RunDeviceTask (XBuildTask build_task, IEnumerable candidates) AppRunnerTarget = AppRunnerTarget.Device_tvOS; break; case TestPlatform.watchOS: + case TestPlatform.watchOS_32: + case TestPlatform.watchOS_64_32: AppRunnerTarget = AppRunnerTarget.Device_watchOS; break; default: @@ -3610,7 +3634,7 @@ protected override async Task RunTestAsync () try { // Set the device we acquired. Device = Candidates.First ((d) => d.UDID == device_resource.Resource.Name); - if (Platform == TestPlatform.watchOS) + if (Device.DevicePlatform == DevicePlatform.watchOS) CompanionDevice = Jenkins.Devices.FindCompanionDevice (Jenkins.DeviceLoadLog, Device); Jenkins.MainLog.WriteLine ("Acquired device '{0}' for '{1}'", Device.Name, ProjectFile); @@ -4082,6 +4106,8 @@ public enum TestPlatform iOS_TodayExtension64, tvOS, watchOS, + watchOS_32, + watchOS_64_32, Mac, Mac_Classic, diff --git a/tests/xharness/ProjectFileExtensions.cs b/tests/xharness/ProjectFileExtensions.cs index 63f9a8d4e620..02f09cf92021 100644 --- a/tests/xharness/ProjectFileExtensions.cs +++ b/tests/xharness/ProjectFileExtensions.cs @@ -120,7 +120,10 @@ static bool EvaluateCondition (XmlNode node, string platform, string configurati return true; var conditionValue = condition.Value; - conditionValue = conditionValue.Replace ("$(Configuration)", configuration).Replace ("$(Platform)", platform); + if (configuration != null) + conditionValue = conditionValue.Replace ("$(Configuration)", configuration); + if (platform != null) + conditionValue = conditionValue.Replace ("$(Platform)", platform); var orsplits = conditionValue.Split (orsplitter, StringSplitOptions.None); foreach (var orsplit in orsplits) { @@ -353,7 +356,9 @@ public static void AddToNode (this XmlDocument csproj, string node, string value if (!IsNodeApplicable (mea, platform, configuration)) continue; - mea.InnerText += " " + value; + if (mea.InnerText.Length > 0 && mea.InnerText [mea.InnerText.Length - 1] != ' ') + mea.InnerText += " "; + mea.InnerText += value; found = true; } @@ -499,12 +504,24 @@ public static void FixTestLibrariesReferences (this XmlDocument csproj, string p } } - public static void FixArchitectures (this XmlDocument csproj, string simulator_arch, string device_arch) + public static void SetArchitecture (this XmlDocument csproj, string platform, string configuration, string architecture) + { + var nodes = csproj.SelectNodes ("/*/*/*[local-name() = 'MtouchArch']"); + foreach (XmlNode n in nodes) { + if (!IsNodeApplicable (n, platform, configuration)) + continue; + n.InnerText = architecture; + } + } + + public static void FixArchitectures (this XmlDocument csproj, string simulator_arch, string device_arch, string platform = null, string configuration = null) { var nodes = csproj.SelectNodes ("/*/*/*[local-name() = 'MtouchArch']"); if (nodes.Count == 0) throw new Exception (string.Format ("Could not find MtouchArch at all")); foreach (XmlNode n in nodes) { + if (platform != null && configuration != null && !IsNodeApplicable (n, platform, configuration)) + continue; switch (n.InnerText.ToLower ()) { case "i386": case "x86_64": @@ -514,11 +531,14 @@ public static void FixArchitectures (this XmlDocument csproj, string simulator_a case "armv7": case "armv7s": case "arm64": + case "arm64_32": + case "armv7k": case "armv7, arm64": + case "armv7k, arm64_32": n.InnerText = device_arch; break; default: - throw new NotImplementedException (string.Format ("Unhandled architecture: {0}", n.Value)); + throw new NotImplementedException (string.Format ("Unhandled architecture: {0}", n.InnerText)); } } @@ -770,13 +790,8 @@ public static void RemoveNode (this XmlDocument csproj, string node) public static void CloneConfiguration (this XmlDocument csproj, string platform, string configuration, string new_configuration) { - var projnode = csproj.SelectNodes ("//*[local-name() = 'PropertyGroup']"); + var projnode = csproj.GetPropertyGroups (platform, configuration); foreach (XmlNode xmlnode in projnode) { - if (xmlnode.Attributes ["Condition"] == null) - continue; - if (!IsNodeApplicable (xmlnode, platform, configuration)) - continue; - var clone = xmlnode.Clone (); var condition = clone.Attributes ["Condition"]; condition.InnerText = condition.InnerText.Replace (configuration, new_configuration); @@ -784,23 +799,14 @@ public static void CloneConfiguration (this XmlDocument csproj, string platform, return; } - throw new Exception ("Configuration not found."); + throw new Exception ($"Configuration {platform}|{configuration} not found."); } public static void DeleteConfiguration (this XmlDocument csproj, string platform, string configuration) { - var projnode = csproj.SelectNodes ("//*[local-name() = 'PropertyGroup']"); - foreach (XmlNode xmlnode in projnode) { - if (xmlnode.Attributes ["Condition"] == null) - continue; - if (!IsNodeApplicable (xmlnode, platform, configuration)) - continue; + var projnode = csproj.GetPropertyGroups (platform, configuration); + foreach (XmlNode xmlnode in projnode) xmlnode.ParentNode.RemoveChild (xmlnode); - - return; - } - - throw new Exception ($"Configuration not found: {platform}:{configuration}"); } static IEnumerable SelectElementNodes (this XmlNode node, string name) diff --git a/tests/xharness/Simulators.cs b/tests/xharness/Simulators.cs index 8f7e02bb7228..ed9a06f27e54 100644 --- a/tests/xharness/Simulators.cs +++ b/tests/xharness/Simulators.cs @@ -690,7 +690,14 @@ public class Devices : ILoadAsync public IEnumerable Connected64BitIOS => connected_devices.Where (x => x.DevicePlatform == DevicePlatform.iOS && x.Supports64Bit); public IEnumerable Connected32BitIOS => connected_devices.Where (x => x.DevicePlatform == DevicePlatform.iOS && x.Supports32Bit); public IEnumerable ConnectedTV => connected_devices.Where (x => x.DevicePlatform == DevicePlatform.tvOS); - public IEnumerable ConnectedWatch => connected_devices.Where (x => x.DevicePlatform == DevicePlatform.watchOS); + public IEnumerable ConnectedWatch => connected_devices.Where (x => x.DevicePlatform == DevicePlatform.watchOS && x.Architecture == Architecture.ARMv7k); + public IEnumerable ConnectedWatch32_64 { + get { + return connected_devices.Where ((x) => { + return x.DevicePlatform == DevicePlatform.watchOS && x.Architecture == Architecture.ARM64_32; + }); + } + } Task ILoadAsync.LoadAsync (Log log, bool include_locked, bool force) { diff --git a/tests/xharness/WatchOSTarget.cs b/tests/xharness/WatchOSTarget.cs index 5f29b40de043..badc67d202c1 100644 --- a/tests/xharness/WatchOSTarget.cs +++ b/tests/xharness/WatchOSTarget.cs @@ -21,6 +21,14 @@ public class WatchOSTarget : iOSTarget public string WatchOSExtensionProjectPath { get; private set; } public string WatchOSProjectPath { get { return ProjectPath; } private set { ProjectPath = value; } } + public override string SimulatorArchitectures { + get { return "i386"; } + } + + public override string DeviceArchitectures { + get { return "ARMv7k, ARM64_32"; } + } + void CreateWatchOSAppProject () { var csproj = new XmlDocument (); @@ -81,6 +89,28 @@ void CreateWatchOSExtensionProject () { var csproj = inputProject; var suffix = Suffix + "-extension"; + + // Remove unused configurations + csproj.DeleteConfiguration ("iPhone", "Release-bitcode"); + csproj.DeleteConfiguration ("iPhone", "Release64"); + csproj.DeleteConfiguration ("iPhone", "Debug64"); + + csproj.FixArchitectures ("i386", "ARMv7k", "iPhone", "Release32"); + csproj.FixArchitectures ("i386", "ARMv7k", "iPhone", "Debug32"); + + // add Release64_32 and set the correct architecture + csproj.CloneConfiguration ("iPhone", "Release", "Release64_32"); + csproj.FixArchitectures ("i386", "ARM64_32", "iPhone", "Release64_32"); + + // add Debug64_32 and set the correct architecture + csproj.CloneConfiguration ("iPhone", "Debug", "Debug64_32"); + csproj.FixArchitectures ("i386", "ARM64_32", "iPhone", "Debug64_32"); + + csproj.FixArchitectures (SimulatorArchitectures, DeviceArchitectures, "iPhoneSimulator", "Debug"); + csproj.FixArchitectures (SimulatorArchitectures, DeviceArchitectures, "iPhoneSimulator", "Release"); + csproj.FixArchitectures (SimulatorArchitectures, DeviceArchitectures, "iPhone", "Debug"); + csproj.FixArchitectures (SimulatorArchitectures, DeviceArchitectures, "iPhone", "Release"); + csproj.SetProjectTypeGuids ("{1E2E965C-F6D2-49ED-B86E-418A60C69EEF};" + LanguageGuid); csproj.SetOutputPath ("bin\\$(Platform)\\$(Configuration)" + suffix); csproj.SetIntermediateOutputPath ("obj\\$(Platform)\\$(Configuration)" + suffix); @@ -88,7 +118,7 @@ void CreateWatchOSExtensionProject () csproj.SetPlatformAssembly ("Xamarin.WatchOS"); csproj.SetImport (IsFSharp ? "$(MSBuildExtensionsPath)\\Xamarin\\WatchOS\\Xamarin.WatchOS.AppExtension.FSharp.targets" : "$(MSBuildExtensionsPath)\\Xamarin\\WatchOS\\Xamarin.WatchOS.AppExtension.CSharp.targets"); csproj.FixProjectReferences ("-watchos"); - csproj.FixArchitectures ("i386", "ARMv7k"); + csproj.FixInfoPListInclude (suffix); csproj.SetOutputType ("Library"); csproj.AddAdditionalDefines ("BITCODE", "iPhone", "Release"); @@ -108,7 +138,7 @@ void CreateWatchOSExtensionProject () // Not linking a watch extensions requires passing -Os to the native compiler. // https://github.com/mono/mono/issues/9867 - var configurations = new string [] { "Debug", "Debug32", "Release", "Release32", "Release-bitcode" }; + var configurations = new string [] { "Debug", "Debug32", "Debug64_32", "Release", "Release32", "Release64_32" }; foreach (var c in configurations) { var flags = "-fembed-bitcode-marker"; if (csproj.GetMtouchLink ("iPhone", c) == "None") From 321c6e7a87ce3522fb4e3405507b2890b6a4eaac Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 21 Feb 2019 14:15:39 +0100 Subject: [PATCH 10/27] [xharness] Don't add Debug variations for arm64_32, we don't support it yet. --- tests/xharness/Jenkins.cs | 60 +++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index 54ca9adf2ec3..0d6db8849d31 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -238,7 +238,7 @@ class TestData public string LinkMode; public string Defines; public string Undefines; - public bool Ignored; + public bool? Ignored; public bool EnableSGenConc; public bool UseThumb; public MonoNativeFlavor MonoNativeFlavor; @@ -266,48 +266,65 @@ IEnumerable GetTestData (RunTestTask test) // 32-bit interpreter doesn't work yet: https://github.com/mono/mono/issues/9871 var supports_interpreter = test.Platform != TestPlatform.iOS_Unified32; var supports_dynamic_registrar_on_device = test.Platform == TestPlatform.iOS_Unified64 || test.Platform == TestPlatform.tvOS; + // arm64_32 is only supported for Release builds for now. + var supports_debug = test.Platform != TestPlatform.watchOS_64_32; + bool? ignored_release = null; + if (test.Platform == TestPlatform.watchOS_64_32) { + // The template test is in the Debug configuration, but we only support arm64_32 in Release, which means the template test is ignored. + // We still want to run any Release configurations, so forcefully unignore those. + ignored_release = false; + } switch (test.ProjectPlatform) { case "iPhone": /* we don't add --assembly-build-target=@all=staticobject because that's the default in all our test projects */ - yield return new TestData { Variation = "AssemblyBuildTarget: dylib (debug)", MTouchExtraArgs = "--assembly-build-target=@all=dynamiclibrary", Debug = true, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Dynamic, MonoNativeFlavor = flavor }; - yield return new TestData { Variation = "AssemblyBuildTarget: SDK framework (debug)", MTouchExtraArgs = "--assembly-build-target=@sdk=framework=Xamarin.Sdk --assembly-build-target=@all=staticobject", Debug = true, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static, MonoNativeFlavor = flavor }; - - yield return new TestData { Variation = "AssemblyBuildTarget: dylib (debug, profiling)", MTouchExtraArgs = "--assembly-build-target=@all=dynamiclibrary", Debug = true, Profiling = true, MonoNativeLinkMode = MonoNativeLinkMode.Dynamic, MonoNativeFlavor = flavor }; - yield return new TestData { Variation = "AssemblyBuildTarget: SDK framework (debug, profiling)", MTouchExtraArgs = "--assembly-build-target=@sdk=framework=Xamarin.Sdk --assembly-build-target=@all=staticobject", Debug = true, Profiling = true, MonoNativeLinkMode = MonoNativeLinkMode.Static, MonoNativeFlavor = flavor }; + if (supports_debug) { + yield return new TestData { Variation = "AssemblyBuildTarget: dylib (debug)", MTouchExtraArgs = "--assembly-build-target=@all=dynamiclibrary", Debug = true, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Dynamic, MonoNativeFlavor = flavor }; + yield return new TestData { Variation = "AssemblyBuildTarget: SDK framework (debug)", MTouchExtraArgs = "--assembly-build-target=@sdk=framework=Xamarin.Sdk --assembly-build-target=@all=staticobject", Debug = true, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static, MonoNativeFlavor = flavor }; + yield return new TestData { Variation = "AssemblyBuildTarget: dylib (debug, profiling)", MTouchExtraArgs = "--assembly-build-target=@all=dynamiclibrary", Debug = true, Profiling = true, MonoNativeLinkMode = MonoNativeLinkMode.Dynamic, MonoNativeFlavor = flavor }; + yield return new TestData { Variation = "AssemblyBuildTarget: SDK framework (debug, profiling)", MTouchExtraArgs = "--assembly-build-target=@sdk=framework=Xamarin.Sdk --assembly-build-target=@all=staticobject", Debug = true, Profiling = true, MonoNativeLinkMode = MonoNativeLinkMode.Static, MonoNativeFlavor = flavor }; + } - yield return new TestData { Variation = "Release", MTouchExtraArgs = "", Debug = false, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static }; + yield return new TestData { Variation = "Release", MTouchExtraArgs = "", Debug = false, Profiling = false, Ignored = ignored_release, MonoNativeLinkMode = MonoNativeLinkMode.Static }; if (test.Platform == TestPlatform.iOS_Unified32) - yield return new TestData { Variation = "Release: UseThumb", MTouchExtraArgs = "", Debug = false, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static, UseThumb = true }; - yield return new TestData { Variation = "AssemblyBuildTarget: SDK framework (release)", MTouchExtraArgs = "--assembly-build-target=@sdk=framework=Xamarin.Sdk --assembly-build-target=@all=staticobject", Debug = false, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static, MonoNativeFlavor = flavor }; + yield return new TestData { Variation = "Release: UseThumb", MTouchExtraArgs = "", Debug = false, Ignored = ignored_release, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static, UseThumb = true }; + yield return new TestData { Variation = "AssemblyBuildTarget: SDK framework (release)", MTouchExtraArgs = "--assembly-build-target=@sdk=framework=Xamarin.Sdk --assembly-build-target=@all=staticobject", Debug = false, Profiling = false, Ignored = ignored_release, MonoNativeLinkMode = MonoNativeLinkMode.Static, MonoNativeFlavor = flavor }; switch (test.TestName) { case "monotouch-test": if (supports_dynamic_registrar_on_device) yield return new TestData { Variation = "Debug (dynamic registrar)", MTouchExtraArgs = "--registrar:dynamic", Debug = true, Profiling = false }; yield return new TestData { Variation = "Release (all optimizations)", MTouchExtraArgs = "--registrar:static --optimize:all", Debug = false, Profiling = false, Defines = "OPTIMIZEALL" }; - yield return new TestData { Variation = "Debug (all optimizations)", MTouchExtraArgs = "--registrar:static --optimize:all", Debug = true, Profiling = false, Defines = "OPTIMIZEALL" }; - yield return new TestData { Variation = "Debug: SGenConc", MTouchExtraArgs = "", Debug = true, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static, EnableSGenConc = true}; + if (supports_debug) { + yield return new TestData { Variation = "Debug (all optimizations)", MTouchExtraArgs = "--registrar:static --optimize:all", Debug = true, Profiling = false, Defines = "OPTIMIZEALL" }; + yield return new TestData { Variation = "Debug: SGenConc", MTouchExtraArgs = "", Debug = true, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static, EnableSGenConc = true}; + } if (supports_interpreter) { - yield return new TestData { Variation = "Debug (interpreter)", MTouchExtraArgs = "--interpreter", Debug = true, Profiling = false, }; - yield return new TestData { Variation = "Debug (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = true, Profiling = false, }; - yield return new TestData { Variation = "Release (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = false, Profiling = false, }; + if (supports_debug) { + yield return new TestData { Variation = "Debug (interpreter)", MTouchExtraArgs = "--interpreter", Debug = true, Profiling = false, }; + yield return new TestData { Variation = "Debug (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = true, Profiling = false, }; + } + yield return new TestData { Variation = "Release (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = false, Profiling = false, Ignored = ignored_release, }; } break; case "mscorlib": yield return new TestData { Variation = "Debug: SGenConc", MTouchExtraArgs = "", Debug = true, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static, EnableSGenConc = true}; if (supports_interpreter) { - yield return new TestData { Variation = "Debug (interpreter)", MTouchExtraArgs = "--interpreter", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; - yield return new TestData { Variation = "Debug (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; - yield return new TestData { Variation = "Release (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = false, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; + if (supports_debug) { + yield return new TestData { Variation = "Debug (interpreter)", MTouchExtraArgs = "--interpreter", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; + yield return new TestData { Variation = "Debug (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; + } + yield return new TestData { Variation = "Release (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = false, Profiling = false, Ignored = ignored_release, Undefines = "FULL_AOT_RUNTIME" }; } break; case "mini": yield return new TestData { Variation = "Debug: SGenConc", MTouchExtraArgs = "", Debug = true, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static, EnableSGenConc = true}; if (supports_interpreter) { - yield return new TestData { Variation = "Debug (interpreter)", MTouchExtraArgs = "--interpreter", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; - yield return new TestData { Variation = "Debug (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; - yield return new TestData { Variation = "Release (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = false, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; + if (supports_debug) { + yield return new TestData { Variation = "Debug (interpreter)", MTouchExtraArgs = "--interpreter", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; + yield return new TestData { Variation = "Debug (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; + } + yield return new TestData { Variation = "Release (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = false, Profiling = false, Ignored = ignored_release, Undefines = "FULL_AOT_RUNTIME" }; } break; } @@ -452,7 +469,7 @@ IEnumerable CreateTestVariations (IEnumerable tests, Func CreateRunDeviceTasks () ProjectPlatform = "iPhone", Platform = TestPlatform.watchOS_64_32, TestName = project.Name, + Ignored = true, }; buildWatch64_32.CloneTestProject (watchOSProject); rv.Add (new RunDeviceTask (buildWatch64_32, Devices.ConnectedWatch32_64.Where (d => d.IsSupported (project))) { Ignored = ignored || !IncludewatchOS, BuildOnly = project.BuildOnly }); From b2c5c8689acd374fb6fdf53266f10b9fe86b66ce Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 30 Jan 2019 14:07:12 +0100 Subject: [PATCH 11/27] [introspection] ARM64_32 adjustments. --- tests/introspection/iOS/iOSApiCtorInitTest.cs | 5 +++++ tests/introspection/iOS/iOSApiPInvokeTest.cs | 4 ++-- tests/introspection/iOS/iOSApiProtocolTest.cs | 11 +++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/introspection/iOS/iOSApiCtorInitTest.cs b/tests/introspection/iOS/iOSApiCtorInitTest.cs index 189879f97b2b..a4d5f19796fb 100644 --- a/tests/introspection/iOS/iOSApiCtorInitTest.cs +++ b/tests/introspection/iOS/iOSApiCtorInitTest.cs @@ -225,6 +225,11 @@ protected override bool Skip (Type type) case "INGetRestaurantGuestIntentResponse": // Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Unable to initialize 'INGetRestaurantGuestIntentResponse'. Please make sure that your intent definition file is valid. return TestRuntime.CheckXcodeVersion (10,0); case "CMMovementDisorderManager": // Not available in simulator, added info to radar://41110708 +#if __WATCHOS__ + // Doesn't exist in the simulator; aborts on device if the required entitlement isn't available. + return true; +#endif + return Runtime.Arch == Arch.SIMULATOR; case "RPSystemBroadcastPickerView": // Symbol not available in simulator return Runtime.Arch == Arch.SIMULATOR; default: diff --git a/tests/introspection/iOS/iOSApiPInvokeTest.cs b/tests/introspection/iOS/iOSApiPInvokeTest.cs index 8ce4ffa3a204..a79b030c518f 100644 --- a/tests/introspection/iOS/iOSApiPInvokeTest.cs +++ b/tests/introspection/iOS/iOSApiPInvokeTest.cs @@ -64,10 +64,10 @@ protected override bool Skip (string symbolName) case "MPSSetHeapCacheDuration": return simulator; - // it's not needed for ARM64 and Apple does not have stubs for them in libobjc.dylib + // it's not needed for ARM64/ARM64_32 and Apple does not have stubs for them in libobjc.dylib case "objc_msgSend_stret": case "objc_msgSendSuper_stret": - return IntPtr.Size == 8 && !simulator; + return !simulator; default: return base.Skip (symbolName); diff --git a/tests/introspection/iOS/iOSApiProtocolTest.cs b/tests/introspection/iOS/iOSApiProtocolTest.cs index 1a2336f5c4fc..9f8c0d35b950 100644 --- a/tests/introspection/iOS/iOSApiProtocolTest.cs +++ b/tests/introspection/iOS/iOSApiProtocolTest.cs @@ -82,6 +82,17 @@ protected override bool Skip (Type type) // but that web page doesn't explain anything (it's mostly empty, so this is probably just lagging documentation) // I also tried enabling every entitlement in Xcode, but it still didn't work. return true; +#if __WATCHOS__ && !XAMCORE_4_0 + case "INCarAirCirculationModeResolutionResult": + case "INCarAudioSourceResolutionResult": + case "INCarDefrosterResolutionResult": + case "INCarSeatResolutionResult": + case "INRadioTypeResolutionResult": + case "INRelativeSettingResolutionResult": + case "INRelativeReferenceResolutionResult": + // These were bound by mistake, and they're gone in XAMCORE_4_0. + return true; +#endif } return base.Skip (type); From c4c17fa293dd1db367d5fcff99c4bd85122fbdaf Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 12 Feb 2019 12:27:36 +0100 Subject: [PATCH 12/27] [monotouch-test] Adjust for arm64_32 abi. --- .../ObjCRuntime/RegistrarTest.cs | 2 +- .../ObjCRuntime/TrampolineTest.cs | 40 +++++++++++-------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs b/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs index 375969f10748..4f448874c69b 100644 --- a/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs +++ b/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs @@ -1389,7 +1389,7 @@ public void TestTypeEncodings () #if MONOMAC var boolEncoding = "c"; #else - var boolEncoding = (IntPtr.Size == 8 || TrampolineTest.IsArmv7k) ? "B" : "c"; + var boolEncoding = (IntPtr.Size == 8 || TrampolineTest.IsArmv7k || TrampolineTest.IsArm64CallingConvention) ? "B" : "c"; #endif var exp = new string [] { "@", ":", "^v", "C", "c", "s", "s", "S", "i", "I", "q", "Q", "f", "d", boolEncoding, "@", ":", "#" }; diff --git a/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs b/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs index 7abbe0efd482..6fae88dc4996 100644 --- a/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs +++ b/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs @@ -62,10 +62,16 @@ public static bool IsArm32 { } #endif + public static bool IsArm64CallingConvention { + get { + return Runtime.IsARM64CallingConvention; + } + } + public static bool IsArmv7k { get { #if __WATCHOS__ - return Runtime.Arch == Arch.DEVICE; + return Runtime.Arch == Arch.DEVICE && !IsArm64CallingConvention; #else return false; #endif @@ -78,7 +84,7 @@ public void StretTrampolineTest () { CMTimeRange tr; using (var obj = new StretTrampolines ()) { - if (IsArm64) { + if (IsArm64CallingConvention) { tr = CMTimeRange_objc_msgSend (obj.Handle, Selector.GetHandle ("myTimeRange")); } else { CMTimeRange_objc_msgSend (out tr, obj.Handle, Selector.GetHandle ("myTimeRange")); @@ -221,21 +227,21 @@ public void FloatingPointStretTrampolineTest () int i; rect2 = new RectangleF (1.2f, 2.3f, 3.4f, 4.5f); - if (IsArm64 || IsArmv7k) { + if (IsArm64CallingConvention || IsArmv7k) { rect = RectangleF_objc_msgSend_IntPtr_IntPtr_RectangleF (obj.Handle, new Selector ("testRectangleF_string_string_RectangleF:b:c:").Handle, new NSString ("a").Handle, new NSString ("b").Handle, rect2); } else { RectangleF_objc_msgSend_stret_IntPtr_IntPtr_RectangleF (out rect, obj.Handle, new Selector ("testRectangleF_string_string_RectangleF:b:c:").Handle, new NSString ("a").Handle, new NSString ("b").Handle, rect2); } Assert.That (rect == new RectangleF (rect2.X * pi, rect2.Y * pi, rect2.Width * pi, rect2.Height * pi), "#testRectangleF_string_string_RectangleF:b:c:"); - if (IsArm64 || IsArmv7k) { + if (IsArm64CallingConvention || IsArmv7k) { rect = Messaging.RectangleF_objc_msgSend (obj.Handle, new Selector ("testRectangleF").Handle); } else { Messaging.RectangleF_objc_msgSend_stret (out rect, obj.Handle, new Selector ("testRectangleF").Handle); } Assert.That (rect == new RectangleF (1.2f, 2.3f, 3.4f, 4.5f), "#testRectangleF"); - if (IsArm64 || IsArmv7k) { + if (IsArm64CallingConvention || IsArmv7k) { rect = Messaging.RectangleF_objc_msgSend (class_ptr, new Selector ("staticTestRectangleF").Handle); } else { Messaging.RectangleF_objc_msgSend_stret (out rect, class_ptr, new Selector ("staticTestRectangleF").Handle); @@ -243,14 +249,14 @@ public void FloatingPointStretTrampolineTest () Assert.That (rect == new RectangleF (1.2f, 2.3f, 3.4f, 4.5f), "#static testRectangleF"); i = 152; - if (IsArm64 || IsArmv7k) { + if (IsArm64CallingConvention || IsArmv7k) { rect = Messaging.RectangleF_objc_msgSend_int (obj.Handle, new Selector ("testRectangleF_int:").Handle, 152); } else { Messaging.RectangleF_objc_msgSend_stret_int (out rect, obj.Handle, new Selector ("testRectangleF_int:").Handle, 152); } Assert.That (rect == new RectangleF (i + .1f, i + .2f, i + .3f, i + .4f), "#ret RectF-int", "#testRectangleF_int:"); - if (IsArm64 || IsArmv7k) { + if (IsArm64CallingConvention || IsArmv7k) { rect = Messaging.RectangleF_objc_msgSend_IntPtr (obj.Handle, new Selector ("testRectangleF_IntPtr:").Handle, tmp_obj.Handle); } else { Messaging.RectangleF_objc_msgSend_stret_IntPtr (out rect, obj.Handle, new Selector ("testRectangleF_IntPtr:").Handle, tmp_obj.Handle); @@ -259,7 +265,7 @@ public void FloatingPointStretTrampolineTest () #if !__TVOS__ mkregion = new MKCoordinateRegion (new CLLocationCoordinate2D (123.456, 345.678), new MKCoordinateSpan (987.654, 654.321)); - if (IsArm64 || IsArmv7k) { + if (IsArm64CallingConvention || IsArmv7k) { rect = Messaging.RectangleF_objc_msgSend_MKCoordinateRegion_IntPtr (obj.Handle, new Selector ("testRectangleF_MCCoordinateRegion_IntPtr:str:").Handle, mkregion, tmp_obj.Handle); } else { Messaging.RectangleF_objc_msgSend_stret_MKCoordinateRegion_IntPtr (out rect, obj.Handle, new Selector ("testRectangleF_MCCoordinateRegion_IntPtr:str:").Handle, mkregion, tmp_obj.Handle); @@ -267,7 +273,7 @@ public void FloatingPointStretTrampolineTest () Assert.That (rect == new RectangleF (123.456f+pi, 345.678f-pi, 987.654f*pi, 654.321f/pi), "#testRectangleF_MCCoordinateRegion_IntPtr:str:"); mkmaprect = new MKMapRect (111.1, 222.2, 333.3, 444.4); - if (IsArm64 || IsArmv7k) { + if (IsArm64CallingConvention || IsArmv7k) { rect = Messaging.RectangleF_objc_msgSend_MKMapRect (obj.Handle, new Selector ("testRectangleF_MKMapRect:").Handle, mkmaprect); } else { Messaging.RectangleF_objc_msgSend_stret_MKMapRect (out rect, obj.Handle, new Selector ("testRectangleF_MKMapRect:").Handle, mkmaprect); @@ -276,7 +282,7 @@ public void FloatingPointStretTrampolineTest () #endif // !__TVOS__ rect2 = new RectangleF (9.9f, 8.8f, 7.7f, 6.6f); - if (IsArm64 || IsArmv7k) { + if (IsArm64CallingConvention || IsArmv7k) { rect = Messaging.RectangleF_objc_msgSend_RectangleF (obj.Handle, new Selector ("testRectangleF_RectangleF:").Handle, rect2); } else { Messaging.RectangleF_objc_msgSend_stret_RectangleF (out rect, obj.Handle, new Selector ("testRectangleF_RectangleF:").Handle, rect2); @@ -285,7 +291,7 @@ public void FloatingPointStretTrampolineTest () rect2 = new RectangleF (5.44f, 4.33f, 3.22f, 2.11f); i = 8; - if (IsArm64 || IsArmv7k) { + if (IsArm64CallingConvention || IsArmv7k) { rect = Messaging.RectangleF_objc_msgSend_RectangleF_int (obj.Handle, new Selector ("testRectangleF_RectangleF_int:i:").Handle, rect2, 8); } else { Messaging.RectangleF_objc_msgSend_stret_RectangleF_int (out rect, obj.Handle, new Selector ("testRectangleF_RectangleF_int:i:").Handle, rect2, 8); @@ -293,7 +299,7 @@ public void FloatingPointStretTrampolineTest () AreAlmostEqual (rect, new RectangleF (5.44f*i, 4.33f+i, 3.22f-i, 2.11f/i), "testRectangleF_RectangleF_int:i:"); rect2 = new RectangleF (5.4f, 4.3f, 3.2f, 2.1f); - if (IsArm64 || IsArmv7k) { + if (IsArm64CallingConvention || IsArmv7k) { rect = Messaging.RectangleF_objc_msgSend_RectangleF_IntPtr (obj.Handle, new Selector ("testRectangleF_RectangleF_IntPtr:str:").Handle, rect2, tmp_obj.Handle); } else { Messaging.RectangleF_objc_msgSend_stret_RectangleF_IntPtr (out rect, obj.Handle, new Selector ("testRectangleF_RectangleF_IntPtr:str:").Handle, rect2, tmp_obj.Handle); @@ -302,7 +308,7 @@ public void FloatingPointStretTrampolineTest () rect2 = new RectangleF (1, 2, 3, 4); rect3 = new RectangleF (9, 8, 7, 6); - if (IsArm64 || IsArmv7k) { + if (IsArm64CallingConvention || IsArmv7k) { rect = Messaging.RectangleF_objc_msgSend_RectangleF_RectangleF_float ( obj.Handle, new Selector ("testRectangleF_RectangleF_RectangleF_float:b:c:").Handle, rect2, rect3, (float) pi); } else { Messaging.RectangleF_objc_msgSend_stret_RectangleF_RectangleF_float (out rect, obj.Handle, new Selector ("testRectangleF_RectangleF_RectangleF_float:b:c:").Handle, rect2, rect3, (float) pi); @@ -312,7 +318,7 @@ public void FloatingPointStretTrampolineTest () rect2 = new RectangleF (1, 2, 3, 4); rect3 = new RectangleF (9, 8, 7, 6); rect4 = new RectangleF (10, 20, 30, 40); - if (IsArm64 || IsArmv7k) { + if (IsArm64CallingConvention || IsArmv7k) { rect = Messaging.RectangleF_objc_msgSend_RectangleF_RectangleF_RectangleF (obj.Handle, new Selector ("testRectangleF_RectangleF_RectangleF_RectangleF:b:c:").Handle, rect2, rect3, rect4); } else { Messaging.RectangleF_objc_msgSend_stret_RectangleF_RectangleF_RectangleF (out rect, obj.Handle, new Selector ("testRectangleF_RectangleF_RectangleF_RectangleF:b:c:").Handle, rect2, rect3, rect4); @@ -320,21 +326,21 @@ public void FloatingPointStretTrampolineTest () Assert.That (rect == new RectangleF (20, 30, 40, 50), "#testRectangleF_RectangleF_RectangleF_RectangleF:b:c:"); #if !__WATCHOS__ - if (IsArm64) { + if (IsArm64CallingConvention) { matrix3 = Messaging.Matrix3_objc_msgSend (obj.Handle, new Selector ("testMatrix3").Handle); } else { Messaging.Matrix3_objc_msgSend_stret (out matrix3, obj.Handle, new Selector ("testMatrix3").Handle); } Assert.That (matrix3.Equals (new Matrix3 (1, 2, 3, 4, 5, 6, 7, 8, 9)), "#testMatrix3"); - if (IsArm64) { + if (IsArm64CallingConvention) { matrix4 = Matrix4_objc_msgSend (obj.Handle, new Selector ("testMatrix4").Handle); } else { Matrix4_objc_msgSend_stret (out matrix4, obj.Handle, new Selector ("testMatrix4").Handle); } Assert.That (matrix4.Equals (new Matrix4 (9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3)), "#testMatrix4"); - if (IsArm64) { + if (IsArm64CallingConvention) { catransform3d = Messaging.CATransform3D_objc_msgSend (obj.Handle, new Selector ("testCATransform3D").Handle); } else { Messaging.CATransform3D_objc_msgSend_stret (out catransform3d, obj.Handle, new Selector ("testCATransform3D").Handle); From 1bf8ed3ebc2a3264e4da91a58e3f7355fa0c9d03 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 12 Feb 2019 12:24:30 +0100 Subject: [PATCH 13/27] [tests][mtouch] Add abi/architecture tests for arm64_32. --- tests/mtouch/MTouch.cs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/mtouch/MTouch.cs b/tests/mtouch/MTouch.cs index dd654aa4588a..97e89cfe4160 100644 --- a/tests/mtouch/MTouch.cs +++ b/tests/mtouch/MTouch.cs @@ -2459,6 +2459,42 @@ public void Architectures_TVOS_Invalid () } } + [Test] + [TestCase (Target.Dev, null, "ARMv7k")] + [TestCase (Target.Dev, "arm64_32+llvm", "ARM64_32")] + [TestCase (Target.Dev, "armv7k+llvm,arm64_32+llvm", "ARMv7k,ARM64_32")] + [TestCase (Target.Sim, null, "i386")] + public void Architectures_WatchOS (Target target, string abi, string expected_abi) + { + AssertDeviceAvailable (); + + using (var mtouch = new MTouchTool ()) { + mtouch.Profile = Profile.watchOS; + mtouch.Abi = abi; + mtouch.CreateTemporaryCacheDirectory (); + mtouch.CreateTemporaryWatchKitExtension (); + mtouch.Action = target == Target.Dev ? MTouchAction.BuildDev : MTouchAction.BuildSim; + mtouch.AssertExecute ("build"); + VerifyArchitectures (mtouch.NativeExecutablePath, "arch", expected_abi.Split (',')); + } + } + + [Test] + public void Architectures_WatchOS_Invalid () + { + AssertDeviceAvailable (); + + using (var mtouch = new MTouchTool ()) { + mtouch.Profile = Profile.watchOS; + mtouch.CreateTemporaryWatchKitExtension (); + + mtouch.Abi = "armv7"; + mtouch.AssertExecuteFailure (MTouchAction.BuildDev, "device - armv7"); + mtouch.AssertError ("MT", 75, "Invalid architecture 'ARMv7' for WatchOS projects. Valid architectures are: ARMv7k, ARMv7k+LLVM, ARM64_32, ARM64_32+LLVM"); + mtouch.AssertErrorCount (1); + } + } + [Test] public void MonoFrameworkArchitectures () { From adbc87ff1dc5848b700d8ec4325ec019e33186ff Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 4 Feb 2019 11:04:06 +0100 Subject: [PATCH 14/27] [monotouch-test] LLVM's too smart for our tests, so ignore Symbols.FunctionNames when LLVM is enabled. --- tests/monotouch-test/mono/Symbols.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/monotouch-test/mono/Symbols.cs b/tests/monotouch-test/mono/Symbols.cs index 4a9ab88db6b0..692130c91218 100644 --- a/tests/monotouch-test/mono/Symbols.cs +++ b/tests/monotouch-test/mono/Symbols.cs @@ -27,6 +27,7 @@ public void FunctionNames () Collect (); bool aot = symbols [1].Contains ("MonoTouchFixtures_Symbols_Collect"); + bool llvmonly = symbols [1].Contains ("mono_llvmonly_runtime_invoke"); // LLVM inlines the Collect function, so 'Collect' doesn't show up in the stack trace :/ bool interp = false; if (!aot) { @@ -38,7 +39,7 @@ public void FunctionNames () } } - Assert.IsTrue (aot || interp, "#1"); + Assert.IsTrue (aot || interp || llvmonly, $"#1\n\t{string.Join ("\n\t", symbols)}"); } void Collect () From 76c2361965245190c4a92158eb0fdd029cb540f8 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 26 Feb 2019 17:49:09 +0100 Subject: [PATCH 15/27] [tests][mtouch] Adjust minOS version test for arm64_32. --- tests/common/ProductTests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/common/ProductTests.cs b/tests/common/ProductTests.cs index eb08cfb2a95e..6b1075d03ac6 100644 --- a/tests/common/ProductTests.cs +++ b/tests/common/ProductTests.cs @@ -129,6 +129,8 @@ public void MinOSVersion (Profile profile, MachO.LoadCommands load_command, Mach break; case MachO.LoadCommands.MinwatchOS: version = SdkVersions.MinWatchOSVersion; + if (device) + alternate_version = new Version (5, 1, 0); // arm64_32 has min OS 5.1 mono_native_compat_version = SdkVersions.MinWatchOSVersion; mono_native_unified_version = new Version (5, 0, 0); break; From e3fc04a8a34a897e872ec988b6cd49f7ca9e337a Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 10 May 2019 08:22:11 +0200 Subject: [PATCH 16/27] [tests][mtouch] Adjust Xamarin.Tests.ProductTests.MinOSVersion for watchOS/arm64_32 slices. --- tests/common/ProductTests.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/common/ProductTests.cs b/tests/common/ProductTests.cs index 6b1075d03ac6..8ad2d089280a 100644 --- a/tests/common/ProductTests.cs +++ b/tests/common/ProductTests.cs @@ -104,6 +104,7 @@ public void MinOSVersion (Profile profile, MachO.LoadCommands load_command, Mach Version alternate_version = null; Version mono_native_compat_version; Version mono_native_unified_version; + Version alternate_mono_native_unified_version = null; switch (load_command) { case MachO.LoadCommands.MinMacOSX: version = SdkVersions.MinOSXVersion; @@ -133,6 +134,8 @@ public void MinOSVersion (Profile profile, MachO.LoadCommands load_command, Mach alternate_version = new Version (5, 1, 0); // arm64_32 has min OS 5.1 mono_native_compat_version = SdkVersions.MinWatchOSVersion; mono_native_unified_version = new Version (5, 0, 0); + if (device) + alternate_mono_native_unified_version = new Version (5, 1, 0); // armv7k has 5.0, arm64_32 has 5.1 break; default: throw new NotImplementedException (load_command.ToString ()); @@ -143,6 +146,8 @@ public void MinOSVersion (Profile profile, MachO.LoadCommands load_command, Mach mono_native_unified_version = mono_native_unified_version.WithBuild (); if (alternate_version == null) alternate_version = version; + if (alternate_mono_native_unified_version == null) + alternate_mono_native_unified_version = mono_native_unified_version; switch (Path.GetFileName (machoFile)) { case "libmono-native-compat.dylib": @@ -152,7 +157,7 @@ public void MinOSVersion (Profile profile, MachO.LoadCommands load_command, Mach break; case "libmono-native-unified.dylib": case "libmono-native-unified.a": - if (mono_native_unified_version != lc_min_version) + if (mono_native_unified_version != lc_min_version && alternate_mono_native_unified_version != lc_min_version) failed.Add ($"Unexpected minOS version (expected {mono_native_unified_version}, found {lc_min_version}) in {machoFile} ({slice.Filename})."); break; default: From b67fa47edb08cfb1b1fcbae75b3d6420de29f61e Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 10 May 2019 09:17:25 +0200 Subject: [PATCH 17/27] Bump mono. New commits in mono/mono: * mono/mono@7814ea810cf [sdks] Make sure the mono-version.txt directory exists * mono/mono@f9cdf7b9866 Bump helix-binaries * mono/mono@238d4a71db5 A deadlock happens when during a process_suspend there is a pending invoke and then when it's calling the invoke there is another call to process_suspend in the same thread. (#14387) * mono/mono@189b0c5c35b [sdks] Add Mono version to ios/mac archive * mono/mono@ff46d6e49ea [sdks] Fix wrong path * mono/mono@2397d41abfb [sdks] Add Mono binaries to mac archive Diff: https://github.com/mono/mono/compare/bc3791b0ffb077da0f415f70b401c2d086b8d821..7814ea810cfd6e54be962562da5c1118c7a6a4f2 --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index bc3791b0ffb0..7814ea810cfd 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit bc3791b0ffb077da0f415f70b401c2d086b8d821 +Subproject commit 7814ea810cfd6e54be962562da5c1118c7a6a4f2 From 3881b86f6183671efad26376277a842ac671c38d Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 10 May 2019 09:17:53 +0200 Subject: [PATCH 18/27] Bump mono. New commits in mono/mono: * mono/mono@7361a4f01c7 [llvmonly] make local copy of trace_ips pointer from exception object (#14409) * mono/mono@7daf13e0d44 [2019-02] [runtime] Use MAP_JIT automatically when running under a hardened runtime on osx. (#14413) * mono/mono@ca78977b319 [sdks] Add .cs source files to ios archive Diff: https://github.com/mono/mono/compare/7814ea810cfd6e54be962562da5c1118c7a6a4f2..7361a4f01c77f0d643f3e4b6d1bc58a7ced9289c --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index 7814ea810cfd..7361a4f01c77 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit 7814ea810cfd6e54be962562da5c1118c7a6a4f2 +Subproject commit 7361a4f01c77f0d643f3e4b6d1bc58a7ced9289c From 3a72377b70055521228dd366cdbdef5b19087bfe Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 10 May 2019 09:29:23 +0200 Subject: [PATCH 19/27] [xharness] Don't run the mono-native-compat test on ARM64_32. ARM64_32 only supports the unified native mode. --- tests/xharness/Harness.cs | 3 ++- tests/xharness/Jenkins.cs | 22 ++++++++++++---------- tests/xharness/TestProject.cs | 1 + 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index 4068a77d3ff9..df302157bd45 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -364,7 +364,8 @@ void AutoConfigureIOS () var monoNativeInfo = new MonoNativeInfo (this, flavor); var iosTestProject = new iOSTestProject (monoNativeInfo.ProjectPath, generateVariations: false) { MonoNativeInfo = monoNativeInfo, - Name = monoNativeInfo.ProjectName + Name = monoNativeInfo.ProjectName, + SkipwatchOSARM64_32Variation = monoNativeInfo.ProjectName.Contains ("compat"), }; IOSTestProjects.Add (iosTestProject); diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index 0d6db8849d31..4e2cd9d7a26c 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -610,16 +610,18 @@ IEnumerable CreateRunDeviceTasks () buildWatch32.CloneTestProject (watchOSProject); rv.Add (new RunDeviceTask (buildWatch32, Devices.ConnectedWatch) { Ignored = ignored || !IncludewatchOS, BuildOnly = project.BuildOnly }); - var buildWatch64_32 = new XBuildTask { - Jenkins = this, - ProjectConfiguration = "Debug64_32", - ProjectPlatform = "iPhone", - Platform = TestPlatform.watchOS_64_32, - TestName = project.Name, - Ignored = true, - }; - buildWatch64_32.CloneTestProject (watchOSProject); - rv.Add (new RunDeviceTask (buildWatch64_32, Devices.ConnectedWatch32_64.Where (d => d.IsSupported (project))) { Ignored = ignored || !IncludewatchOS, BuildOnly = project.BuildOnly }); + if (!project.SkipwatchOSARM64_32Variation) { + var buildWatch64_32 = new XBuildTask { + Jenkins = this, + ProjectConfiguration = "Debug64_32", + ProjectPlatform = "iPhone", + Platform = TestPlatform.watchOS_64_32, + TestName = project.Name, + Ignored = true, + }; + buildWatch64_32.CloneTestProject (watchOSProject); + rv.Add (new RunDeviceTask (buildWatch64_32, Devices.ConnectedWatch32_64.Where (d => d.IsSupported (project))) { Ignored = ignored || !IncludewatchOS, BuildOnly = project.BuildOnly }); + } } } diff --git a/tests/xharness/TestProject.cs b/tests/xharness/TestProject.cs index 9d845c318f82..abf985628d99 100644 --- a/tests/xharness/TestProject.cs +++ b/tests/xharness/TestProject.cs @@ -150,6 +150,7 @@ public class iOSTestProject : TestProject { public bool SkipiOSVariation; public bool SkipwatchOSVariation; + public bool SkipwatchOSARM64_32Variation; public bool SkiptvOSVariation; public bool BuildOnly; From 8d6215f9ecbedfc05e82c04203c2c5fb17ad2aba Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 10 May 2019 15:17:28 +0200 Subject: [PATCH 20/27] Bump mono. New commits in mono/mono: * mono/mono@f1aa58d9a90 [2019-02] Do not allocate handles in ReleaseMutex. (#14428) * mono/mono@382c836e7fb Mutex memory leak on sgen GC (nursery, major). * mono/mono@6ab15f25295 Usually do not create a handle in mono_runtime_invoke_handle. (#14423) Diff: https://github.com/mono/mono/compare/7361a4f01c77f0d643f3e4b6d1bc58a7ced9289c..f1aa58d9a90007cfb85bf393b5e61fac639be60a --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index 7361a4f01c77..f1aa58d9a900 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit 7361a4f01c77f0d643f3e4b6d1bc58a7ced9289c +Subproject commit f1aa58d9a90007cfb85bf393b5e61fac639be60a From b6f735c26b07df345ac40243eb70dca0d7aa9f0a Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 16 May 2019 15:22:59 -0700 Subject: [PATCH 21/27] [xharness] Rework arm64_32 variations a bit so that they're not always enabled. We don't want to try to run arm64_32 tests on bots that don't have devices attached, so make sure they follow the logic of other device tests. --- tests/xharness/Jenkins.cs | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index 4e2cd9d7a26c..6a6dd0e201e5 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -268,12 +268,6 @@ IEnumerable GetTestData (RunTestTask test) var supports_dynamic_registrar_on_device = test.Platform == TestPlatform.iOS_Unified64 || test.Platform == TestPlatform.tvOS; // arm64_32 is only supported for Release builds for now. var supports_debug = test.Platform != TestPlatform.watchOS_64_32; - bool? ignored_release = null; - if (test.Platform == TestPlatform.watchOS_64_32) { - // The template test is in the Debug configuration, but we only support arm64_32 in Release, which means the template test is ignored. - // We still want to run any Release configurations, so forcefully unignore those. - ignored_release = false; - } switch (test.ProjectPlatform) { case "iPhone": @@ -285,10 +279,11 @@ IEnumerable GetTestData (RunTestTask test) yield return new TestData { Variation = "AssemblyBuildTarget: SDK framework (debug, profiling)", MTouchExtraArgs = "--assembly-build-target=@sdk=framework=Xamarin.Sdk --assembly-build-target=@all=staticobject", Debug = true, Profiling = true, MonoNativeLinkMode = MonoNativeLinkMode.Static, MonoNativeFlavor = flavor }; } - yield return new TestData { Variation = "Release", MTouchExtraArgs = "", Debug = false, Profiling = false, Ignored = ignored_release, MonoNativeLinkMode = MonoNativeLinkMode.Static }; + if (test.ProjectConfiguration.Contains ("Debug")) + yield return new TestData { Variation = "Release", MTouchExtraArgs = "", Debug = false, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static }; if (test.Platform == TestPlatform.iOS_Unified32) - yield return new TestData { Variation = "Release: UseThumb", MTouchExtraArgs = "", Debug = false, Ignored = ignored_release, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static, UseThumb = true }; - yield return new TestData { Variation = "AssemblyBuildTarget: SDK framework (release)", MTouchExtraArgs = "--assembly-build-target=@sdk=framework=Xamarin.Sdk --assembly-build-target=@all=staticobject", Debug = false, Profiling = false, Ignored = ignored_release, MonoNativeLinkMode = MonoNativeLinkMode.Static, MonoNativeFlavor = flavor }; + yield return new TestData { Variation = "Release: UseThumb", MTouchExtraArgs = "", Debug = false, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static, UseThumb = true }; + yield return new TestData { Variation = "AssemblyBuildTarget: SDK framework (release)", MTouchExtraArgs = "--assembly-build-target=@sdk=framework=Xamarin.Sdk --assembly-build-target=@all=staticobject", Debug = false, Profiling = false, MonoNativeLinkMode = MonoNativeLinkMode.Static, MonoNativeFlavor = flavor }; switch (test.TestName) { case "monotouch-test": @@ -304,7 +299,7 @@ IEnumerable GetTestData (RunTestTask test) yield return new TestData { Variation = "Debug (interpreter)", MTouchExtraArgs = "--interpreter", Debug = true, Profiling = false, }; yield return new TestData { Variation = "Debug (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = true, Profiling = false, }; } - yield return new TestData { Variation = "Release (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = false, Profiling = false, Ignored = ignored_release, }; + yield return new TestData { Variation = "Release (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = false, Profiling = false, }; } break; case "mscorlib": @@ -314,7 +309,7 @@ IEnumerable GetTestData (RunTestTask test) yield return new TestData { Variation = "Debug (interpreter)", MTouchExtraArgs = "--interpreter", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; yield return new TestData { Variation = "Debug (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; } - yield return new TestData { Variation = "Release (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = false, Profiling = false, Ignored = ignored_release, Undefines = "FULL_AOT_RUNTIME" }; + yield return new TestData { Variation = "Release (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = false, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; } break; case "mini": @@ -324,7 +319,7 @@ IEnumerable GetTestData (RunTestTask test) yield return new TestData { Variation = "Debug (interpreter)", MTouchExtraArgs = "--interpreter", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; yield return new TestData { Variation = "Debug (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = true, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; } - yield return new TestData { Variation = "Release (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = false, Profiling = false, Ignored = ignored_release, Undefines = "FULL_AOT_RUNTIME" }; + yield return new TestData { Variation = "Release (interpreter -mscorlib)", MTouchExtraArgs = "--interpreter=-mscorlib", Debug = false, Profiling = false, Undefines = "FULL_AOT_RUNTIME" }; } break; } @@ -373,7 +368,7 @@ IEnumerable CreateTestVariations (IEnumerable tests, Func (tests); @@ -613,11 +608,10 @@ IEnumerable CreateRunDeviceTasks () if (!project.SkipwatchOSARM64_32Variation) { var buildWatch64_32 = new XBuildTask { Jenkins = this, - ProjectConfiguration = "Debug64_32", + ProjectConfiguration = "Release64_32", // We don't support Debug for ARM64_32 yet. ProjectPlatform = "iPhone", Platform = TestPlatform.watchOS_64_32, TestName = project.Name, - Ignored = true, }; buildWatch64_32.CloneTestProject (watchOSProject); rv.Add (new RunDeviceTask (buildWatch64_32, Devices.ConnectedWatch32_64.Where (d => d.IsSupported (project))) { Ignored = ignored || !IncludewatchOS, BuildOnly = project.BuildOnly }); From 1e31ea2f8300e46f7c117365670bba5240e00f45 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 10 May 2019 16:29:35 +0200 Subject: [PATCH 22/27] Fix whitespace. --- tests/introspection/iOS/iOSApiCtorInitTest.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/introspection/iOS/iOSApiCtorInitTest.cs b/tests/introspection/iOS/iOSApiCtorInitTest.cs index a4d5f19796fb..817941f26bda 100644 --- a/tests/introspection/iOS/iOSApiCtorInitTest.cs +++ b/tests/introspection/iOS/iOSApiCtorInitTest.cs @@ -226,10 +226,10 @@ protected override bool Skip (Type type) return TestRuntime.CheckXcodeVersion (10,0); case "CMMovementDisorderManager": // Not available in simulator, added info to radar://41110708 #if __WATCHOS__ - // Doesn't exist in the simulator; aborts on device if the required entitlement isn't available. - return true; + // Doesn't exist in the simulator; aborts on device if the required entitlement isn't available. + return true; #endif - return Runtime.Arch == Arch.SIMULATOR; + return Runtime.Arch == Arch.SIMULATOR; case "RPSystemBroadcastPickerView": // Symbol not available in simulator return Runtime.Arch == Arch.SIMULATOR; default: From eab32da266add3a27f9913899d9c74e7f7044ac2 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 10 May 2019 17:09:31 +0200 Subject: [PATCH 23/27] [monotouch-test] Don't go completely overboard when trying to fill the GC's nursery. --- tests/monotouch-test/mono/MonoWeakReferenceTest.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/monotouch-test/mono/MonoWeakReferenceTest.cs b/tests/monotouch-test/mono/MonoWeakReferenceTest.cs index 749abb074114..7ae7bcdb4fd3 100644 --- a/tests/monotouch-test/mono/MonoWeakReferenceTest.cs +++ b/tests/monotouch-test/mono/MonoWeakReferenceTest.cs @@ -84,7 +84,11 @@ public void WeakTest () Assert.That (t.Obj3, Is.Not.Null, "'t.Obj3' should not be null"); //overflow the nursery, make sure we fill it +#if __WATCHOS__ + for (int i = 0; i < 1000 * 100; ++i) // the apple watch doesn't have much memory, so try to not run into OOMs either. The nursery is 512k, so 100k objects should be more than enough to fill it. +#else for (int i = 0; i < 1000 * 1000 * 10; ++i) +#endif new OneField (); Exception ex = null; From 21b869081860848e79984f4f4adb6d31d03ffbbb Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 10 May 2019 18:57:17 +0200 Subject: [PATCH 24/27] [tests] Fix reporting back to xharness for watchOS NUnit/XUnit tests. * Choose the first hostname for the HttpTextWriter if there are multiple hosts. * Open the HttpTextWriter before writing to it. * Don't overwrite the http writer with another writer immediately after creating it. * Close the HttpTextWriter when done writing. * Wait for the HttpTextWriter to complete the final http request before exiting. --- .../watchOS/Extension/InterfaceController.cs | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tests/bcl-test/BCLTests/templates/watchOS/Extension/InterfaceController.cs b/tests/bcl-test/BCLTests/templates/watchOS/Extension/InterfaceController.cs index 7088beb818ab..05a98a48d40f 100644 --- a/tests/bcl-test/BCLTests/templates/watchOS/Extension/InterfaceController.cs +++ b/tests/bcl-test/BCLTests/templates/watchOS/Extension/InterfaceController.cs @@ -25,6 +25,7 @@ public partial class InterfaceController : WKInterfaceController { bool running; Xamarin.iOS.UnitTests.TestRunner runner; + HttpTextWriter http_writer; [Action ("runTests:")] partial void RunTests (NSObject obj); @@ -93,10 +94,14 @@ void RunTests () { var options = ApplicationOptions.Current; TextWriter writer = null; - if (!string.IsNullOrEmpty (options.HostName) && string.IsNullOrEmpty(options.LogFile)) - writer = new HttpTextWriter () { HostName = options.HostName, Port = options.HostPort }; - if (!string.IsNullOrEmpty (options.LogFile)) + if (!string.IsNullOrEmpty (options.HostName) && string.IsNullOrEmpty (options.LogFile)) { + http_writer = new HttpTextWriter () { HostName = options.HostName.Split (',')[0], Port = options.HostPort }; + Console.WriteLine ("Sending results to {0}:{1} using HTTP", http_writer.HostName, http_writer.Port); + http_writer.Open (); + writer = http_writer; + } else if (!string.IsNullOrEmpty (options.LogFile)) { writer = new StreamWriter (options.LogFile); + } // we generate the logs in two different ways depending if the generate xml flag was // provided. If it was, we will write the xml file to the tcp writer if present, else @@ -157,8 +162,16 @@ void RunTests () logger.Info ($"Xml result can be found {resultsFilePath}"); } logger.Info ($"Tests run: {runner.TotalTests} Passed: {runner.PassedTests} Inconclusive: {runner.InconclusiveTests} Failed: {runner.FailedTests} Ignored: {runner.FilteredTests}"); - if (options.TerminateAfterExecution) - TerminateWithSuccess (); + if (options.TerminateAfterExecution) { + var writer_finished_task = http_writer?.FinishedTask; + http_writer?.Close (); + Task.Run (async () => { + if (writer_finished_task != null) { + await writer_finished_task; + } + TerminateWithSuccess (); + }); + } }); }); } From 5b4b398ae6f96a60b6927873b2d1985e2658c275 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 10 May 2019 18:59:03 +0200 Subject: [PATCH 25/27] [tests] Link NUnit/XUnit watchOS extensions. Makes them much smaller. --- .../BCLTests/BCLTests-watchos-extension.csproj.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/bcl-test/BCLTests/BCLTests-watchos-extension.csproj.in b/tests/bcl-test/BCLTests/BCLTests-watchos-extension.csproj.in index 5b2eddfeed73..d67594a5f55e 100644 --- a/tests/bcl-test/BCLTests/BCLTests-watchos-extension.csproj.in +++ b/tests/bcl-test/BCLTests/BCLTests-watchos-extension.csproj.in @@ -58,8 +58,7 @@ ARMv7k, ARM64_32 True - - + SdkOnly cjk,mideast,other,rare,west @@ -73,6 +72,7 @@ ARM64_32 true + SdkOnly true @@ -85,6 +85,7 @@ ARMv7k true + SdkOnly none @@ -100,6 +101,7 @@ true true cjk,mideast,other,rare,west + SdkOnly true @@ -111,6 +113,7 @@ --nostrip --nosymbolstrip: --aot-options=-O=float32 --gcc_flags='-fembed-bitcode-marker' ARM64_32 True + SdkOnly true @@ -122,6 +125,7 @@ --nostrip --nosymbolstrip: --aot-options=-O=float32 --gcc_flags='-fembed-bitcode-marker' ARMv7k True + SdkOnly From b53e39ab36a3a0e61f2a50002ecabd2ced818a5b Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 20 May 2019 18:43:33 +0200 Subject: [PATCH 26/27] Bump mono. New commits in mono/mono: * mono/mono@1ce13bb09d4 [arm] one more attempt to fix slotsize issue on llvmonly (#14444) (#14535) * mono/mono@bb3c9db4976 [2019-02] [monodroid] Introduce 'win32 host' BCL build (#14504) * mono/mono@ca17767758c [sdks] Set PATH in Android Windows SDK pipeline job (#14519) * mono/mono@1cb80e7ecfc [sdks] Set win-amd64 CI_TAGS for windows pipeline step (#14516) * mono/mono@c857c27d2e5 [2019-02][sdks] Build Android SDK on Windows (#14472) * mono/mono@ab378434b96 [2019-02][ci] Add Android Windows (Release) archive job to pipeline (#14503) * mono/mono@06c3f553122 [sdks] Lipo arm64_32 binaries for watchOS * mono/mono@0f69e271534 [sdks] Use -pathmap CSC option for iOS/Mac * mono/mono@69fae70242e [WinForms] Related Forms closing issue (#13717) * mono/mono@4fa246df3f9 [2019-02] [WinForms] fix EditingCellFormattedValue getter and setter for bool value (#14437) * mono/mono@a55d1c93771 [2019-02] TextInfo.ChangeCase should not use CultureInfo.CurrentCulture (#14438) * mono/mono@b41578079ec [2019-02] Revert "[System] Add FSEvent FileSystemWatcher to monotouch BCL profile" (#14448) * mono/mono@09429597dcb [metadata] use handle stack in mono_runtime_object_init_handle (#14445) * mono/mono@77ddc3abc18 [arm64] set MONO_ARCH_HAVE_UNWIND_BACKTRACE for watch4 (#14452) Diff: https://github.com/mono/mono/compare/f1aa58d9a90007cfb85bf393b5e61fac639be60a..1ce13bb09d464e7ffefbd0072b2d95669d080732 --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index f1aa58d9a900..1ce13bb09d46 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit f1aa58d9a90007cfb85bf393b5e61fac639be60a +Subproject commit 1ce13bb09d464e7ffefbd0072b2d95669d080732 From 6b1d01535e6d9be324452f281579ba47881bad33 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 21 May 2019 07:44:58 +0200 Subject: [PATCH 27/27] Bump mono. New commits in mono/mono: * mono/mono@16c6ac81b39 [interp] disable inlining for built-in types (#14531) Diff: https://github.com/mono/mono/compare/1ce13bb09d464e7ffefbd0072b2d95669d080732..16c6ac81b39bdb26786c2fda155a0a3500961798 --- external/mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mono b/external/mono index 1ce13bb09d46..16c6ac81b39b 160000 --- a/external/mono +++ b/external/mono @@ -1 +1 @@ -Subproject commit 1ce13bb09d464e7ffefbd0072b2d95669d080732 +Subproject commit 16c6ac81b39bdb26786c2fda155a0a3500961798