diff --git a/Make.config b/Make.config
index a1a8c133a59..f6290671e53 100644
--- a/Make.config
+++ b/Make.config
@@ -289,9 +289,11 @@ XAMARIN_IPHONEOS_SDK = $(MONOTOUCH_DEVICE_SDK)
XAMARIN_WATCHSIMULATOR_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.WatchSimulator.sdk
XAMARIN_WATCHOS_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.WatchOS.sdk
-SIMULATORWATCH_SDK = $(XCODE_DEVELOPER_ROOT)/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator$(WATCH_SDK_VERSION).sdk
-SIMULATORWATCH_CFLAGS = -arch i386 -mwatchos-simulator-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(SIMULATORWATCH_SDK) $(CFLAGS) -g $(IOS_COMMON_DEFINES)
-SIMULATORWATCH_OBJC_CFLAGS = $(SIMULATORWATCH_CFLAGS) $(COMMON_SIMULATOR_OBJC_CFLAGS)
+SIMULATORWATCH_SDK = $(XCODE_DEVELOPER_ROOT)/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator$(WATCH_SDK_VERSION).sdk
+SIMULATORWATCH_CFLAGS = -arch i386 -mwatchos-simulator-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(SIMULATORWATCH_SDK) $(CFLAGS) -g $(IOS_COMMON_DEFINES)
+SIMULATORWATCH64_CFLAGS = -arch x86_64 -mwatchos-simulator-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(SIMULATORWATCH_SDK) $(CFLAGS) -g $(IOS_COMMON_DEFINES)
+SIMULATORWATCH_OBJC_CFLAGS = $(SIMULATORWATCH_CFLAGS) $(COMMON_SIMULATOR_OBJC_CFLAGS)
+SIMULATORWATCH64_OBJC_CFLAGS = $(SIMULATORWATCH64_CFLAGS) $(COMMON_SIMULATOR_OBJC_CFLAGS)
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)
@@ -486,8 +488,9 @@ ifdef INCLUDE_DEVICE
DOTNET_WATCHOS_RUNTIME_IDENTIFIERS=watchos-arm watchos-x86
DOTNET_WATCHOS_RUNTIME_IDENTIFIERS_32=watchos-arm watchos-x86
else
-DOTNET_WATCHOS_RUNTIME_IDENTIFIERS=watchos-x86
+DOTNET_WATCHOS_RUNTIME_IDENTIFIERS=watchos-x86 watchos-x64
DOTNET_WATCHOS_RUNTIME_IDENTIFIERS_32=watchos-x86
+DOTNET_WATCHOS_RUNTIME_IDENTIFIERS_64=watchos-x64
endif
endif
diff --git a/dotnet/package/Microsoft.watchOS.Runtime.watchos-x64/package.csproj b/dotnet/package/Microsoft.watchOS.Runtime.watchos-x64/package.csproj
new file mode 100644
index 00000000000..87ceff7013b
--- /dev/null
+++ b/dotnet/package/Microsoft.watchOS.Runtime.watchos-x64/package.csproj
@@ -0,0 +1,9 @@
+
+
+
+ <_PlatformName>watchOS
+ <_RuntimeIdentifier>watchos-x64
+
+
+
+
diff --git a/dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets b/dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets
index e1c1ded4480..e9e865bba8b 100644
--- a/dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets
+++ b/dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets
@@ -59,7 +59,7 @@
<_RuntimePackRuntimeIdentifiers Condition=" '$(_PlatformName)' == 'iOS' ">ios-x64;ios-arm64;ios-arm;ios-x86
<_RuntimePackRuntimeIdentifiers Condition=" '$(_PlatformName)' == 'tvOS' ">tvos-x64;tvos-arm64
- <_RuntimePackRuntimeIdentifiers Condition=" '$(_PlatformName)' == 'watchOS' ">watchos-x86;watchos-arm
+ <_RuntimePackRuntimeIdentifiers Condition=" '$(_PlatformName)' == 'watchOS' ">watchos-x86;watchos-x64;watchos-arm
<_RuntimePackRuntimeIdentifiers Condition=" '$(_PlatformName)' == 'macOS' ">osx-x64
diff --git a/mk/mono.mk b/mk/mono.mk
index 29c76091c4f..dc9da703aee 100644
--- a/mk/mono.mk
+++ b/mk/mono.mk
@@ -1,4 +1,4 @@
-NEEDED_MONO_VERSION := be2226b5a1c57df065efc4c1cf008d581e5cec7d
+NEEDED_MONO_VERSION := ac596375c762c6b8dbe3c802f0ce626004eab51c
NEEDED_MONO_BRANCH := 2020-02
MONO_DIRECTORY := mono
diff --git a/mk/rules.mk b/mk/rules.mk
index e2c7b59105a..bfcf325bbc3 100644
--- a/mk/rules.mk
+++ b/mk/rules.mk
@@ -8,6 +8,7 @@ DEV7s_I := $(COMMON_I)
DEV64_I := $(COMMON_I)
SIMW_I := $(COMMON_I)
+SIMW64_I := $(COMMON_I)
DEVW_I := $(COMMON_I)
DEVW64_32_I := $(COMMON_I)
@@ -91,19 +92,34 @@ define NativeCompilationTemplate
## watch simulator
.libs/watchsimulator/%$(1).x86.o: %.m $(EXTRA_DEPENDENCIES) | .libs/watchsimulator
- $$(call Q_2,OBJC, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(SIMW_I) -g $(2) -c $$< -o $$@
+ $$(call Q_2,OBJC, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(SIMW_I) -g $(2) -c $$< -o $$@
.libs/watchsimulator/%$(1).x86.o: %.c $(EXTRA_DEPENDENCIES) | .libs/watchsimulator
- $$(call Q_2,CC, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_CFLAGS) $$(EXTRA_DEFINES) $(SIMW_I) -g $(2) -c $$< -o $$@
+ $$(call Q_2,CC, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_CFLAGS) $$(EXTRA_DEFINES) $(SIMW_I) -g $(2) -c $$< -o $$@
.libs/watchsimulator/%$(1).x86.o: %.s $(EXTRA_DEPENDENCIES) | .libs/watchsimulator
- $$(call Q_2,ASM, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_CFLAGS) $$(EXTRA_DEFINES) $(SIMW_I) -g $(2) -c $$< -o $$@
+ $$(call Q_2,ASM, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_CFLAGS) $$(EXTRA_DEFINES) $(SIMW_I) -g $(2) -c $$< -o $$@
.libs/watchsimulator/%$(1).x86.dylib: | .libs/watchsimulator
- $$(call Q_2,LD, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib -fapplication-extension
+ $$(call Q_2,LD, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib -fapplication-extension
.libs/watchsimulator/%$(1).x86.framework: | .libs/watchsimulator
- $$(call Q_2,LD, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks -fapplication-extension
+ $$(call Q_2,LD, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks -fapplication-extension
+
+.libs/watchsimulator/%$(1).x86_64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/watchsimulator
+ $$(call Q_2,OBJC, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH64_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(SIMW64_I) -g $(2) -c $$< -o $$@
+
+.libs/watchsimulator/%$(1).x86_64.o: %.c $(EXTRA_DEPENDENCIES) | .libs/watchsimulator
+ $$(call Q_2,CC, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH64_CFLAGS) $$(EXTRA_DEFINES) $(SIMW64_I) -g $(2) -c $$< -o $$@
+
+.libs/watchsimulator/%$(1).x86_64.o: %.s $(EXTRA_DEPENDENCIES) | .libs/watchsimulator
+ $$(call Q_2,ASM, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH64_CFLAGS) $$(EXTRA_DEFINES) $(SIMW64_I) -g $(2) -c $$< -o $$@
+
+.libs/watchsimulator/%$(1).x86_64.dylib: | .libs/watchsimulator
+ $$(call Q_2,LD, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib -fapplication-extension
+
+.libs/watchsimulator/%$(1).x86_64.framework: | .libs/watchsimulator
+ $$(call Q_2,LD, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks -fapplication-extension
## watch device
diff --git a/runtime/Makefile b/runtime/Makefile
index e9251a84420..b54c0d024a5 100644
--- a/runtime/Makefile
+++ b/runtime/Makefile
@@ -185,7 +185,7 @@ ifdef INCLUDE_WATCH
ifdef INCLUDE_DEVICE
$(eval $(call PlatformTemplate,watchos,WATCHOS,armv7k arm64_32))
endif
-$(eval $(call PlatformTemplate,watchsimulator,WATCHSIMULATOR,x86))
+$(eval $(call PlatformTemplate,watchsimulator,WATCHSIMULATOR,x86 x86_64))
endif
ifdef INCLUDE_TVOS
@@ -565,6 +565,7 @@ $(eval $(call DotNetCopyLibTemplate,tvOS,tvos-arm64,tvos,arm64))
endif
endif
ifdef INCLUDE_WATCH
+$(eval $(call DotNetCopyLibTemplate,watchOS,watchos-x64,watchsimulator,x86_64))
$(eval $(call DotNetCopyLibTemplate,watchOS,watchos-x86,watchsimulator,i386))
ifdef INCLUDE_DEVICE
$(eval $(call DotNetLipoLibTemplate,watchOS,watchos-arm,watchos,armv7k arm64_32))
@@ -621,6 +622,7 @@ $(eval $(call DotNetCopyFrameworkTemplate,tvOS,tvos-arm64,tvos,arm64,$(IOS_DESTD
endif
endif
ifdef INCLUDE_WATCH
+$(eval $(call DotNetCopyFrameworkTemplate,watchOS,watchos-x64,watchsimulator,x86_64,$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks))
$(eval $(call DotNetCopyFrameworkTemplate,watchOS,watchos-x86,watchsimulator,i386,$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks))
ifdef INCLUDE_DEVICE
$(eval $(call DotNetLipoFrameworkTemplate,watchOS,watchos-arm,watchos,armv7k arm64_32,$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks))
diff --git a/src/Makefile b/src/Makefile
index b00381e6360..183f0080db2 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -808,11 +808,10 @@ $(WATCHOS_DOTNET_BUILD_DIR)/watchos.rsp: Makefile Makefile.generator frameworks.
$(WATCHOS_APIS) \
> $@
-$(WATCHOS_DOTNET_BUILD_DIR)/32/Xamarin.WatchOS%dll $(WATCHOS_DOTNET_BUILD_DIR)/32/Xamarin.WatchOS%pdb $(WATCHOS_DOTNET_BUILD_DIR)/ref/Xamarin.WatchOS%dll: $(WATCHOS_DOTNET_BUILD_DIR)/watchos-generated-sources $(WATCHOS_SOURCES) $(PRODUCT_KEY_PATH) | $(WATCHOS_DOTNET_BUILD_DIR)/32 $(WATCHOS_DOTNET_BUILD_DIR)/ref
+$(WATCHOS_DOTNET_BUILD_DIR)/32/Xamarin.WatchOS%dll $(WATCHOS_DOTNET_BUILD_DIR)/32/Xamarin.WatchOS%pdb: $(WATCHOS_DOTNET_BUILD_DIR)/watchos-generated-sources $(WATCHOS_SOURCES) $(PRODUCT_KEY_PATH) | $(WATCHOS_DOTNET_BUILD_DIR)/32 $(WATCHOS_DOTNET_BUILD_DIR)/ref
$(Q_DOTNET_GEN) \
$(SYSTEM_CSC) $(DOTNET_FLAGS) -out:$(WATCHOS_DOTNET_BUILD_DIR)/32/Xamarin.WatchOS.dll -optimize \
-publicsign -keyfile:$(PRODUCT_KEY_PATH) \
- -refout:$(WATCHOS_DOTNET_BUILD_DIR)/ref/Xamarin.WatchOS.dll \
$(WATCH_DEFINES) \
$(ARGS_32) \
$(WATCHOS_WARNINGS_TO_FIX) \
@@ -821,6 +820,19 @@ $(WATCHOS_DOTNET_BUILD_DIR)/32/Xamarin.WatchOS%dll $(WATCHOS_DOTNET_BUILD_DIR)/3
$(WATCHOS_SOURCES) \
@$<
+$(WATCHOS_DOTNET_BUILD_DIR)/64/Xamarin.WatchOS%dll $(WATCHOS_DOTNET_BUILD_DIR)/64/Xamarin.WatchOS%pdb $(WATCHOS_DOTNET_BUILD_DIR)/ref/Xamarin.WatchOS%dll: $(WATCHOS_DOTNET_BUILD_DIR)/watchos-generated-sources $(WATCHOS_SOURCES) $(PRODUCT_KEY_PATH) | $(WATCHOS_DOTNET_BUILD_DIR)/64 $(WATCHOS_DOTNET_BUILD_DIR)/ref
+ $(Q_DOTNET_GEN) \
+ $(SYSTEM_CSC) $(DOTNET_FLAGS) -out:$(WATCHOS_DOTNET_BUILD_DIR)/64/Xamarin.WatchOS.dll -optimize \
+ -publicsign -keyfile:$(PRODUCT_KEY_PATH) \
+ -refout:$(WATCHOS_DOTNET_BUILD_DIR)/ref/Xamarin.WatchOS.dll \
+ $(WATCH_DEFINES) \
+ $(ARGS_64) \
+ $(WATCHOS_WARNINGS_TO_FIX) \
+ -warnaserror:$(NULLABILITY_WARNINGS) \
+ $(IOS_CSC_FLAGS_XI) \
+ $(WATCHOS_SOURCES) \
+ @$<
+
$(WATCH_BUILD_DIR)/watch-32/Xamarin.WatchOS%dll $(WATCH_BUILD_DIR)/watch-32/Xamarin.WatchOS%pdb: $(WATCHOS_SOURCES) $(WATCH_BUILD_DIR)/watch/generated_sources $(PRODUCT_KEY_PATH) | $(WATCH_BUILD_DIR)/watch-32
$(call Q_PROF_CSC,watch) $(WATCH_CSC) -nologo -out:$(basename $@).dll -target:library -debug -unsafe -optimize \
-publicsign -keyfile:$(PRODUCT_KEY_PATH) $(WATCH_DEFINES) \
@@ -829,6 +841,14 @@ $(WATCH_BUILD_DIR)/watch-32/Xamarin.WatchOS%dll $(WATCH_BUILD_DIR)/watch-32/Xama
-nowarn:219,618,114,414,1635,3021,$(IOS_WARNINGS_THAT_YOU_SHOULD_FIX) \
$(WATCHOS_SOURCES) @$(WATCH_BUILD_DIR)/watch/generated_sources
+$(WATCH_BUILD_DIR)/watch-64/Xamarin.WatchOS%dll $(WATCH_BUILD_DIR)/watch-64/Xamarin.WatchOS%pdb: $(WATCHOS_SOURCES) $(WATCH_BUILD_DIR)/watch/generated_sources $(PRODUCT_KEY_PATH) | $(WATCH_BUILD_DIR)/watch-64
+ $(call Q_PROF_CSC,watch) $(WATCH_CSC) -nologo -out:$(basename $@).dll -target:library -debug -unsafe -optimize \
+ -publicsign -keyfile:$(PRODUCT_KEY_PATH) $(WATCH_DEFINES) \
+ -deterministic \
+ $(ARGS_64) \
+ -nowarn:219,618,114,414,1635,3021,$(IOS_WARNINGS_THAT_YOU_SHOULD_FIX) \
+ $(WATCHOS_SOURCES) @$(WATCH_BUILD_DIR)/watch/generated_sources
+
$(WATCH_BUILD_DIR)/reference/Xamarin.WatchOS.dll: $(WATCH_BUILD_DIR)/watch-32/Xamarin.WatchOS.dll | $(WATCH_BUILD_DIR)/reference
$(Q_STRIP) mono-cil-strip -q $< $@
@@ -862,6 +882,7 @@ WATCH_TARGETS_DIRS += \
$(WATCH_BUILD_DIR) \
$(WATCH_BUILD_DIR)/watch \
$(WATCH_BUILD_DIR)/watch-32 \
+ $(WATCH_BUILD_DIR)/watch-64 \
$(WATCH_BUILD_DIR)/reference \
$(WATCH_BUILD_DIR)/reference/Facades \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.WatchOS \
@@ -873,12 +894,15 @@ WATCH_TARGETS += \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.WatchOS/Xamarin.WatchOS.dll \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.WatchOS/Xamarin.WatchOS.pdb \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/32bits/Xamarin.WatchOS.dll \
+ $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/64bits/Xamarin.WatchOS.dll \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/32bits/Xamarin.WatchOS.pdb \
+ $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/64bits/Xamarin.WatchOS.pdb \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.WatchOS/MonoTouch.NUnitLite.dll \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.WatchOS/MonoTouch.NUnitLite.pdb
DOTNET_TARGETS += \
$(WATCHOS_DOTNET_BUILD_DIR)/32/Xamarin.WatchOS.dll \
+ $(WATCHOS_DOTNET_BUILD_DIR)/64/Xamarin.WatchOS.dll \
$(WATCHOS_DOTNET_BUILD_DIR)/ref/Xamarin.WatchOS.dll \
$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Ref/ref/net5.0/Xamarin.WatchOS.dll \
$(foreach rid,$(DOTNET_WATCHOS_RUNTIME_IDENTIFIERS),$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/net5.0/Xamarin.WatchOS.dll) \
@@ -888,6 +912,7 @@ DOTNET_TARGETS_DIRS += \
$(WATCHOS_DOTNET_BUILD_DIR) \
$(WATCHOS_DOTNET_BUILD_DIR)/generated-sources \
$(WATCHOS_DOTNET_BUILD_DIR)/32 \
+ $(WATCHOS_DOTNET_BUILD_DIR)/64 \
$(WATCHOS_DOTNET_BUILD_DIR)/ref \
$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Ref/ref/net5.0 \
$(foreach rid,$(DOTNET_WATCHOS_RUNTIME_IDENTIFIERS),$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/net5.0) \
@@ -909,15 +934,27 @@ $(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Ref/ref/net5.0/Xamarin.WatchOS.dll: $(WATCHOS
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/32bits/Xamarin.WatchOS.dll: $(WATCH_BUILD_DIR)/watch-32/Xamarin.WatchOS.dll | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/32bits
$(Q) install -m 0755 $< $@
+$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/64bits/Xamarin.WatchOS.dll: $(WATCH_BUILD_DIR)/watch-64/Xamarin.WatchOS.dll | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/64bits
+ $(Q) install -m 0755 $< $@
+
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/32bits/Xamarin.WatchOS.pdb: $(WATCH_BUILD_DIR)/watch-32/Xamarin.WatchOS.pdb | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/32bits
$(Q) install -m 0644 $< $@
+$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/64bits/Xamarin.WatchOS.pdb: $(WATCH_BUILD_DIR)/watch-64/Xamarin.WatchOS.pdb | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/64bits
+ $(Q) install -m 0644 $< $@
+
$(foreach rid,$(DOTNET_WATCHOS_RUNTIME_IDENTIFIERS_32),$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/net5.0/Xamarin.WatchOS.dll): $(WATCHOS_DOTNET_BUILD_DIR)/32/Xamarin.WatchOS.dll | $(foreach rid,$(DOTNET_WATCHOS_RUNTIME_IDENTIFIERS_32),$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/net5.0)
$(Q) $(CP) $< $@
+$(foreach rid,$(DOTNET_WATCHOS_RUNTIME_IDENTIFIERS_64),$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/net5.0/Xamarin.WatchOS.dll): $(WATCHOS_DOTNET_BUILD_DIR)/64/Xamarin.WatchOS.dll | $(foreach rid,$(DOTNET_WATCHOS_RUNTIME_IDENTIFIERS_64),$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/net5.0)
+ $(Q) $(CP) $< $@
+
$(foreach rid,$(DOTNET_WATCHOS_RUNTIME_IDENTIFIERS_32),$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/net5.0/Xamarin.WatchOS.pdb): $(WATCHOS_DOTNET_BUILD_DIR)/32/Xamarin.WatchOS.pdb | $(foreach rid,$(DOTNET_WATCHOS_RUNTIME_IDENTIFIERS_32),$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/net5.0)
$(Q) $(CP) $< $@
+$(foreach rid,$(DOTNET_WATCHOS_RUNTIME_IDENTIFIERS_64),$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/net5.0/Xamarin.WatchOS.pdb): $(WATCHOS_DOTNET_BUILD_DIR)/64/Xamarin.WatchOS.pdb | $(foreach rid,$(DOTNET_WATCHOS_RUNTIME_IDENTIFIERS_64),$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/net5.0)
+ $(Q) $(CP) $< $@
+
$(WATCH_TARGETS_DIRS):
$(Q) mkdir -p $@
diff --git a/src/ObjCRuntime/Registrar.cs b/src/ObjCRuntime/Registrar.cs
index f7494e8f876..d3b3ea96b0b 100644
--- a/src/ObjCRuntime/Registrar.cs
+++ b/src/ObjCRuntime/Registrar.cs
@@ -838,7 +838,11 @@ public Trampoline Trampoline {
var mi = (System.Reflection.MethodInfo) Method;
bool is_stret;
#if __WATCHOS__
- is_stret = Runtime.Arch == Arch.DEVICE ? Stret.ArmNeedStret (NativeReturnType, null) : Stret.X86NeedStret (NativeReturnType, null);
+ if (Runtime.Arch == Arch.DEVICE) {
+ is_stret = Stret.ArmNeedStret (NativeReturnType, null);
+ } else {
+ is_stret = IntPtr.Size == 4 ? Stret.X86NeedStret (NativeReturnType, null) : Stret.X86_64NeedStret (NativeReturnType, null);
+ }
#elif MONOMAC
is_stret = IntPtr.Size == 8 ? Stret.X86_64NeedStret (NativeReturnType, null) : Stret.X86NeedStret (NativeReturnType, null);
#elif __IOS__
diff --git a/tests/mtouch/MTouch.cs b/tests/mtouch/MTouch.cs
index d049f02fdb3..cb5e349333b 100644
--- a/tests/mtouch/MTouch.cs
+++ b/tests/mtouch/MTouch.cs
@@ -2528,6 +2528,7 @@ public void Architectures_TVOS_Invalid ()
[TestCase (Target.Dev, "arm64_32+llvm", "ARM64_32", MTouchBitcode.Unspecified)]
[TestCase (Target.Dev, "armv7k+llvm,arm64_32+llvm", "ARMv7k,ARM64_32", MTouchBitcode.Full)]
[TestCase (Target.Sim, null, "i386", MTouchBitcode.Unspecified)]
+ [TestCase (Target.Sim, "x86_64", "x86_64", MTouchBitcode.Unspecified)]
public void Architectures_WatchOS (Target target, string abi, string expected_abi, MTouchBitcode bitcode)
{
AssertDeviceAvailable ();
diff --git a/tests/test-libraries/Makefile b/tests/test-libraries/Makefile
index 07f96f7a6e1..7247373fac6 100644
--- a/tests/test-libraries/Makefile
+++ b/tests/test-libraries/Makefile
@@ -124,7 +124,7 @@ $(eval $(call Template,tvsimulator,TVSIMULATOR,x86_64,AppleTVSimulator,-mtvos-si
$(eval $(call Template,tvos,TVOS,arm64,AppleTVOS,-mtvos-version-min=9.0 -fembed-bitcode,TVOS))
endif
ifdef INCLUDE_WATCH
-$(eval $(call Template,watchsimulator,WATCHSIMULATOR,x86,WatchSimulator,-mwatchos-simulator-version-min=2.0,WATCHOS))
+$(eval $(call Template,watchsimulator,WATCHSIMULATOR,x86 x86_64,WatchSimulator,-mwatchos-simulator-version-min=2.0,WATCHOS))
$(eval $(call Template,watchos,WATCHOS,armv7k arm64_32,WatchOS,-mwatchos-version-min=2.0 -fembed-bitcode,WATCHOS))
endif
ifdef INCLUDE_MAC
diff --git a/tests/xharness/Jenkins/Jenkins.cs b/tests/xharness/Jenkins/Jenkins.cs
index 412af62b652..9a90fc9ddc9 100644
--- a/tests/xharness/Jenkins/Jenkins.cs
+++ b/tests/xharness/Jenkins/Jenkins.cs
@@ -42,7 +42,7 @@ class Jenkins {
public bool IncludeiOSExtensions;
public bool ForceExtensionBuildOnly;
public bool IncludetvOS = true;
- public bool IncludewatchOS = false;
+ public bool IncludewatchOS = true;
public bool IncludeMmpTest;
public bool IncludeiOSMSBuild = true;
public bool IncludeMtouch;
diff --git a/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestImporter/Templates/Managed/Resources/Managed.watchOS.App.csproj.in b/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestImporter/Templates/Managed/Resources/Managed.watchOS.App.csproj.in
index a5da7b00d80..f24c95f38b8 100644
--- a/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestImporter/Templates/Managed/Resources/Managed.watchOS.App.csproj.in
+++ b/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestImporter/Templates/Managed/Resources/Managed.watchOS.App.csproj.in
@@ -21,7 +21,7 @@
DEBUG;
prompt
4
- i386
+ i386, x86_64
None
true
true
@@ -46,7 +46,7 @@
true
prompt
4
- i386
+ i386, x86_64
None
iPhone Developer
diff --git a/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestImporter/Templates/Managed/Resources/Managed.watchOS.Extension.csproj.in b/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestImporter/Templates/Managed/Resources/Managed.watchOS.Extension.csproj.in
index 10fc91f4201..d6a0a6b8213 100644
--- a/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestImporter/Templates/Managed/Resources/Managed.watchOS.Extension.csproj.in
+++ b/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestImporter/Templates/Managed/Resources/Managed.watchOS.Extension.csproj.in
@@ -27,7 +27,7 @@
True
True
- i386
+ i386, x86_64
iPhone Developer
None
cjk,mideast,other,rare,west
@@ -42,7 +42,7 @@
None
True
- i386
+ i386, x86_64
cjk,mideast,other,rare,west
diff --git a/tests/xharness/Targets/WatchOSTarget.cs b/tests/xharness/Targets/WatchOSTarget.cs
index e4168a03787..68455089e2e 100644
--- a/tests/xharness/Targets/WatchOSTarget.cs
+++ b/tests/xharness/Targets/WatchOSTarget.cs
@@ -21,7 +21,7 @@ public class WatchOSTarget : iOSTarget
public string WatchOSProjectPath { get { return ProjectPath; } private set { ProjectPath = value; } }
public override string SimulatorArchitectures {
- get { return "i386"; }
+ get { return "i386, x86_64"; }
}
public override string DeviceArchitectures {
diff --git a/tools/common/Application.cs b/tools/common/Application.cs
index c95d2e8457f..a3a361179d0 100644
--- a/tools/common/Application.cs
+++ b/tools/common/Application.cs
@@ -671,6 +671,7 @@ public void ValidateAbi ()
validAbis.Add (Abi.ARM64_32 | Abi.LLVM);
} else {
validAbis.Add (Abi.i386);
+ validAbis.Add (Abi.x86_64);
}
break;
case ApplePlatform.TVOS:
diff --git a/tools/mtouch/Makefile b/tools/mtouch/Makefile
index 292597b8304..9135e71eff8 100644
--- a/tools/mtouch/Makefile
+++ b/tools/mtouch/Makefile
@@ -237,6 +237,7 @@ $(eval $(call RunRegistrar,ios,armv7s,32,$(IOS_SDK_VERSION),iOS,$(DEVICE7S_CFLAG
$(eval $(call RunRegistrar,ios,arm64,64,$(IOS_SDK_VERSION),iOS,$(DEVICE64_CFLAGS),$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/SDKs/MonoTouch.iphoneos.sdk/include,$(MONOTOUCH_MONO_PATH)))
$(eval $(call RunRegistrar,tvos,x86_64,64,$(TVOS_SDK_VERSION),TVOS,$(SIMULATORTV_CFLAGS),$(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/include,$(MONOTOUCH_TV_MONO_PATH)))
$(eval $(call RunRegistrar,tvos,arm64,64,$(TVOS_SDK_VERSION),TVOS,$(DEVICETV_CFLAGS),$(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/include,$(MONOTOUCH_TV_MONO_PATH)))
+$(eval $(call RunRegistrar,watchos,x86_64,64,$(WATCH_SDK_VERSION),WatchOS,$(SIMULATORWATCH64_CFLAGS),$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/include,$(MONOTOUCH_WATCH_MONO_PATH)))
$(eval $(call RunRegistrar,watchos,i386,32,$(WATCH_SDK_VERSION),WatchOS,$(SIMULATORWATCH_CFLAGS),$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/include,$(MONOTOUCH_WATCH_MONO_PATH)))
$(eval $(call RunRegistrar,watchos,armv7k,32,$(WATCH_SDK_VERSION),WatchOS,$(DEVICEWATCH_CFLAGS),$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/include,$(MONOTOUCH_WATCH_MONO_PATH)))
$(eval $(call RunRegistrar,watchos,arm64_32,32,$(WATCH_SDK_VERSION),WatchOS,$(DEVICEWATCH64_32_CFLAGS),$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/include,$(MONOTOUCH_WATCH_MONO_PATH)))
@@ -250,6 +251,9 @@ $(eval $(call RunRegistrar,watchos,arm64_32,32,$(WATCH_SDK_VERSION),WatchOS,$(DE
%.registrar.watchos.device.a: %.registrar.watchos.armv7k.a %.registrar.watchos.arm64_32.a
$(Q_LIPO) $(DEVICE_BIN_PATH)/lipo -create -output $@ $^
+%.registrar.watchos.simulator.a: %.registrar.watchos.i386.a %.registrar.watchos.x86_64.a
+ $(Q_LIPO) $(DEVICE_BIN_PATH)/lipo -create -output $@ $^
+
TARGETS = \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/mtouch \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch/mtouch.exe \
@@ -312,7 +316,7 @@ $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/%: % | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/l
$(IOS_DESTDIR)$(MONOTOUCH_SIMULATOR_SDK)/lib/%.registrar.a: %.registrar.ios.simulator.a | $(IOS_DESTDIR)$(MONOTOUCH_SIMULATOR_SDK)/lib
$(Q) $(CP) $< $@
-$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib/%.registrar.a: %.registrar.watchos.i386.a | $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib
+$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib/%.registrar.a: %.registrar.watchos.simulator.a | $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib
$(Q) $(CP) $< $@
$(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib/%.registrar.a: %.registrar.tvos.x86_64.a | $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib
diff --git a/tools/mtouch/mtouch.cs b/tools/mtouch/mtouch.cs
index e5d50c06a29..6acf7050d0f 100644
--- a/tools/mtouch/mtouch.cs
+++ b/tools/mtouch/mtouch.cs
@@ -161,6 +161,7 @@ public static string GetArch64Directory (Application app)
switch (app.Platform) {
case ApplePlatform.iOS:
case ApplePlatform.TVOS:
+ case ApplePlatform.WatchOS:
return Path.Combine (GetPlatformFrameworkDirectory (app), "..", "..", "64bits");
default:
throw ErrorHelper.CreateError (71, Errors.MX0071, app.Platform, "Xamarin.iOS");