Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[do-not-merge] ARM64_32 changes #5418

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
branch = master
[submodule "external/mono"]
path = external/mono
url = ../../mono/mono.git
branch = 2018-08
url = ../../lewurm/mono.git
branch = 2018-08-watch4
[submodule "external/opentk"]
path = external/opentk
url = ../../mono/opentk.git
Expand Down
2 changes: 2 additions & 0 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,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

Expand Down
88 changes: 60 additions & 28 deletions builds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1189,47 +1189,69 @@ 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: $(MONO_PATH)/configure $(SDK_CONFIG) $(MONO_DEPENDENCIES)
$(MAKE) -C $(SDK_BUILDDIR) package-ios-targetwatch $(SDK_ARGS)
$(Q) mkdir -p $(BUILD_DESTDIR)/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_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
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_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

device:: watchos

Expand All @@ -1252,7 +1274,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 targetwatch_libmonosgen-2.0.dylib
$(Q_STRIP) $(WATCHOS_BIN_PATH)/bitcode_strip $(BUILD_DESTDIR)/targetwatch64_32/lib/libmonosgen-2.0.dylib -m -o targetwatch64_32_libmonosgen-2.0.dylib
$(Q_STRIP) $(WATCHOS_BIN_PATH)/lipo targetwatch_libmonosgen-2.0.dylib targetwatch64_32_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 $@

Expand All @@ -1269,15 +1293,20 @@ $(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 targetwatch_libmono-profiler-log.0.dylib
$(Q) $(WATCHOS_BIN_PATH)/bitcode_strip $(BUILD_DESTDIR)/targetwatch64_32/lib/libmono-profiler-log.0.dylib -m -o targetwatch64_32_libmono-profiler-log.0.dylib
$(Q) $(WATCHOS_BIN_PATH)/lipo targetwatch_libmono-profiler-log.0.dylib targetwatch64_32_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 $@

$(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
Expand All @@ -1286,6 +1315,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
Expand Down
13 changes: 13 additions & 0 deletions mk/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -117,6 +118,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
Expand Down
4 changes: 4 additions & 0 deletions msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ enum TargetArchitecture
ARMv7s = 16,
ARMv7k = 32,
ARM64 = 64,
ARM64_32 = 128,

// Note: needed for backwards compatability
ARMv6_ARMv7 = ARMv6 | ARMv7,
Expand Down Expand Up @@ -487,6 +488,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;
}
Expand Down
10 changes: 9 additions & 1 deletion runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,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
Expand Down Expand Up @@ -318,6 +318,7 @@ ZLIB_HELPER_IOS_x86 = $(SDK_BUILDDIR)/ios-sim32-release/support/zlib-help
ZLIB_HELPER_IOS_x86_64 = $(SDK_BUILDDIR)/ios-sim64-release/support/zlib-helper.o

ZLIB_HELPER_WATCHOS_armv7k = $(SDK_BUILDDIR)/ios-targetwatch-release/support/zlib-helper.o
ZLIB_HELPER_WATCHOS_arm64_32 = $(SDK_BUILDDIR)/ios-targetwatch64_32-release/support/zlib-helper.o
ZLIB_HELPER_WATCHOS_x86 = $(SDK_BUILDDIR)/ios-simwatch-release/support/zlib-helper.o

ZLIB_HELPER_TVOS_arm64 = $(SDK_BUILDDIR)/ios-targettv-release/support/zlib-helper.o
Expand Down Expand Up @@ -345,6 +346,7 @@ armv7_$(1)$(3)_OBJECTS = $(ZLIB_HELPER_$(2)_armv7) $$(patsubst %,.libs/$(1)/%$
armv7s_$(1)$(3)_OBJECTS = $(ZLIB_HELPER_$(2)_armv7s) $$(patsubst %,.libs/$(1)/%$(4).armv7s.o,$$($(2)_SOURCE_STEMS))
armv7k_$(1)$(3)_OBJECTS = $(ZLIB_HELPER_$(2)_armv7k) $$(patsubst %,.libs/$(1)/%$(4).armv7k.o,$$($(2)_SOURCE_STEMS))
arm64_$(1)$(3)_OBJECTS = $(ZLIB_HELPER_$(2)_arm64) $$(patsubst %,.libs/$(1)/%$(4).arm64.o,$$($(2)_SOURCE_STEMS))
arm64_32_$(1)$(3)_OBJECTS = $(ZLIB_HELPER_$(2)_arm64_32) $$(patsubst %,.libs/$(1)/%$(4).arm64_32.o,$$($(2)_SOURCE_STEMS))

$$(foreach arch,$$($(2)_ARCHITECTURES),$$(eval $$(call LibXamarinArchTemplate,$(1),$(2),$(3),$(4),$$(arch))))

Expand All @@ -370,6 +372,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)

Expand All @@ -387,6 +392,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))
Expand Down
3 changes: 2 additions & 1 deletion runtime/bindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ struct MDLVoxelIndexExtentWrapper {
MDLVoxelIndexWrapper maximumExtent;
};

static_assert (sizeof (MPSImageHistogramInfoWrapper) == sizeof (MPSImageHistogramInfo), "Sizes aren't equal");
/* FIXME: fails on arm64_32 */
// static_assert (sizeof (MPSImageHistogramInfoWrapper) == sizeof (MPSImageHistogramInfo), "Sizes aren't equal");

struct Vector4f xamarin_vector_float3__Vector4_objc_msgSend (id self, SEL sel);
void xamarin_vector_float3__Vector4_objc_msgSend_stret (struct Vector4f *v4, id self, SEL sel);
Expand Down
4 changes: 2 additions & 2 deletions tests/templates/WatchApp/App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<Optimize>true</Optimize>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchArch>ARMv7k</MtouchArch>
<MtouchArch>ARM64_32</MtouchArch>
<CodesignEntitlements>%WATCHAPP_PATH%Entitlements.plist</CodesignEntitlements>
<MtouchFloat32>true</MtouchFloat32>
<CodesignKey>iPhone Developer</CodesignKey>
Expand All @@ -58,7 +58,7 @@
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchArch>ARMv7k</MtouchArch>
<MtouchArch>ARM64_32</MtouchArch>
<CodesignEntitlements>%WATCHAPP_PATH%Entitlements.plist</CodesignEntitlements>
<MtouchFloat32>true</MtouchFloat32>
<CodesignKey>iPhone Developer</CodesignKey>
Expand Down
4 changes: 2 additions & 2 deletions tests/templates/WatchExtension/Extension.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<MtouchDebug>True</MtouchDebug>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchExtraArgs></MtouchExtraArgs>
<MtouchArch>ARMv7k</MtouchArch>
<MtouchArch>ARM64_32</MtouchArch>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<IpaPackageName>
</IpaPackageName>
Expand All @@ -67,7 +67,7 @@
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchExtraArgs>-v -v -v -v --nosymbolstrip</MtouchExtraArgs>
<MtouchArch>ARMv7k</MtouchArch>
<MtouchArch>ARM64_32</MtouchArch>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<MtouchUseLlvm>true</MtouchUseLlvm>
<MtouchEnableBitcode>true</MtouchEnableBitcode>
Expand Down
17 changes: 15 additions & 2 deletions tests/xharness/Simulators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ public enum Architecture
ARMv7k,
ARMv7s,
ARM64,
ARM64_32,
i386,
x86_64,
}
Expand Down Expand Up @@ -879,8 +880,20 @@ public Architecture Architecture {
}

// https://www.theiphonewiki.com/wiki/List_of_Apple_Watches
if (model.StartsWith ("Watch", StringComparison.Ordinal))
return Architecture.ARMv7k;
if (model.StartsWith ("Watch", StringComparison.Ordinal)) {
var identifier = model.Substring ("iPod".Length);
var values = identifier.Split (',');
switch (values [0]) {
case "1": // Apple Watch (1st gen)
case "2": // Apple Watch Series 1 and Series 2
case "3": // Apple Watch Series 3
return Architecture.ARMv7k;

case "4": // Apple Watch Series 4
default:
return Architecture.ARM64_32;
}
}

// https://www.theiphonewiki.com/wiki/List_of_Apple_TVs
if (model.StartsWith ("AppleTV", StringComparison.Ordinal))
Expand Down
2 changes: 1 addition & 1 deletion tests/xharness/WatchOSTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,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.FixArchitectures ("i386", "ARM64_32");
csproj.FixInfoPListInclude (suffix);
csproj.SetOutputType ("Library");
csproj.AddAdditionalDefines ("BITCODE", "iPhone", "Release");
Expand Down
14 changes: 13 additions & 1 deletion tools/mtouch/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ public bool IsInterpreted (string assembly)

public bool IsAOTCompiled (string assembly)
{
if (EnableLLVMOnlyBitCode && UseInterpreter)
/* fake AOT compile every assembly */
return true;
if (!UseInterpreter)
return true;

Expand Down Expand Up @@ -691,8 +694,11 @@ 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);
/* TODO: not sure about simulator */
}
break;
case ApplePlatform.TVOS:
Expand Down Expand Up @@ -762,14 +768,20 @@ 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;
case "armv7k+llvm":
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, arm64_32+llvm.", str);
}

// merge this value with any existing ARMv? already specified.
Expand Down
Loading