From 0fbd88e4bd00b5f5218a20468e617b3d79d10a1d Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Thu, 23 Apr 2020 20:47:51 +0300 Subject: [PATCH] [mono] Enable LLVM for iOS by default for AppleAppBuilder (#35338) * Enable LLVM for iOS by default * Update Makefile --- eng/testing/tests.targets | 2 ++ src/mono/msbuild/AppleAppBuilder/AotCompiler.cs | 3 +-- src/mono/msbuild/AppleAppBuilder/AppleAppBuilder.cs | 2 +- src/mono/netcore/sample/iOS/Makefile | 3 ++- src/mono/netcore/sample/iOS/Program.csproj | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index 8e1bd8e..4524a8b 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -174,6 +174,8 @@ GenerateXcodeProject="True" BuildAppBundle="True" Optimized="True" + UseLlvm="$(MonoEnableLLVM)" + LlvmPath="$(RuntimePackDir)\native\cross" DevTeamProvisioning="$(DevTeamProvisioning)" OutputDirectory="$(BundleDir)" AppDir="$(BundleDir)"> diff --git a/src/mono/msbuild/AppleAppBuilder/AotCompiler.cs b/src/mono/msbuild/AppleAppBuilder/AotCompiler.cs index 6f9eef6..5a5b8f9 100644 --- a/src/mono/msbuild/AppleAppBuilder/AotCompiler.cs +++ b/src/mono/msbuild/AppleAppBuilder/AotCompiler.cs @@ -63,8 +63,7 @@ internal class AotCompiler // TODO: enable direct-pinvokes (to get rid of -force_loads) //.Append("direct-pinvoke,") .Append("full,") - .Append("mattr=+crc,") // enable System.Runtime.Intrinsics.Arm - .Append("mattr=+base,"); // (Crc32 and ArmBase for now) + .Append("mattr=+crc,"); // enable System.Runtime.Intrinsics.Arm (Crc32 and ArmBase for now) if (useLlvm) { diff --git a/src/mono/msbuild/AppleAppBuilder/AppleAppBuilder.cs b/src/mono/msbuild/AppleAppBuilder/AppleAppBuilder.cs index 4c55399..bdf5362 100644 --- a/src/mono/msbuild/AppleAppBuilder/AppleAppBuilder.cs +++ b/src/mono/msbuild/AppleAppBuilder/AppleAppBuilder.cs @@ -139,7 +139,7 @@ public class AppleAppBuilderTask : Task throw new ArgumentException($"ProjectName='{ProjectName}' should not contain spaces"); } - if (UseLlvm && !string.IsNullOrEmpty(LlvmPath)) + if (UseLlvm && string.IsNullOrEmpty(LlvmPath)) { // otherwise we might accidentally use some random llc/opt from PATH (installed with clang) throw new ArgumentException($"LlvmPath shoun't be empty when UseLlvm is set"); diff --git a/src/mono/netcore/sample/iOS/Makefile b/src/mono/netcore/sample/iOS/Makefile index 58f935e..31a7e93 100644 --- a/src/mono/netcore/sample/iOS/Makefile +++ b/src/mono/netcore/sample/iOS/Makefile @@ -1,6 +1,7 @@ MONO_CONFIG=Debug MONO_ARCH=arm64 DOTNET := ../../../../.././dotnet.sh +USE_LLVM=True # usage example: # 'make all MONO_ARCH=x64 MONO_CONFIG=Release' to build the app for simulator @@ -11,7 +12,7 @@ program: bundle: clean program $(DOTNET) msbuild /t:BuildAppBundle /p:Configuration=$(MONO_CONFIG) /p:TargetArchitecture=$(MONO_ARCH) \ - /p:UseLlvm=$(UseLlvm) /p:LlvmPath=$(LlvmPath) + /p:UseLlvm=$(USE_LLVM) deploy-sim: $(DOTNET) msbuild /t:IosDeployToSimulator /p:Configuration=$(MONO_CONFIG) /p:TargetArchitecture=$(MONO_ARCH) diff --git a/src/mono/netcore/sample/iOS/Program.csproj b/src/mono/netcore/sample/iOS/Program.csproj index 7a31c46..908aad0 100644 --- a/src/mono/netcore/sample/iOS/Program.csproj +++ b/src/mono/netcore/sample/iOS/Program.csproj @@ -45,7 +45,7 @@ DevTeamProvisioning="$(DevTeamProvisioning)" OutputDirectory="$(BundleDir)" UseLlvm="$(UseLlvm)" - LlvmPath="$(LlvmPath)" + LlvmPath="$(RuntimePackDir)\native\cross" Optimized="False" AppDir="$(BundleDir)"> -- 2.7.4