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

ARM64_32 Debug Mode #7012

Merged
merged 3 commits into from
Sep 24, 2019
Merged
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
6 changes: 5 additions & 1 deletion builds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@ install-local:: install-cross
$(MONO_IOS_SDK_DESTDIR)/ios-cross32-release/bin/arm-darwin-mono-sgen: .stamp-$(MONO_BUILD_MODE)
$(MONO_IOS_SDK_DESTDIR)/ios-cross64-release/bin/aarch64-darwin-mono-sgen: .stamp-$(MONO_BUILD_MODE)
$(MONO_IOS_SDK_DESTDIR)/ios-crosswatch-release/bin/armv7k-unknown-darwin-mono-sgen: .stamp-$(MONO_BUILD_MODE)
$(MONO_IOS_SDK_DESTDIR)/ios-crosswatch-release/bin/aarch64-apple-darwin10_ilp32-mono-sgen: .stamp-$(MONO_BUILD_MODE)

$(PREFIX)/bin/arm-darwin-mono-sgen: $(MONO_IOS_SDK_DESTDIR)/ios-cross32-release/bin/arm-darwin-mono-sgen | $(PREFIX)/bin
$(call Q_2,INSTALL ,[CROSS]) install -c -m 0755 $(INSTALL_STRIP_FLAG) $^ $@
Expand All @@ -968,11 +969,14 @@ $(PREFIX)/bin/arm64-darwin-mono-sgen: $(MONO_IOS_SDK_DESTDIR)/ios-cross64-releas
$(PREFIX)/bin/armv7k-unknown-darwin-mono-sgen: $(MONO_IOS_SDK_DESTDIR)/ios-crosswatch-release/bin/armv7k-unknown-darwin-mono-sgen | $(PREFIX)/bin
$(call Q_2,INSTALL ,[CROSS]) install -c -m 0755 $(INSTALL_STRIP_FLAG) $^ $@

$(PREFIX)/bin/arm64_32-darwin-mono-sgen: $(MONO_IOS_SDK_DESTDIR)/ios-crosswatch64_32-release/bin/aarch64-apple-darwin10_ilp32-mono-sgen | $(PREFIX)/bin
$(call Q_2,INSTALL ,[CROSS]) install -c -m 0755 $(INSTALL_STRIP_FLAG) $^ $@

$(PREFIX)/bin:
$(Q) mkdir -p $@

.PHONY: install-cross
install-cross: $(PREFIX)/bin/arm-darwin-mono-sgen $(PREFIX)/bin/arm64-darwin-mono-sgen $(PREFIX)/bin/armv7k-unknown-darwin-mono-sgen
install-cross: $(PREFIX)/bin/arm-darwin-mono-sgen $(PREFIX)/bin/arm64-darwin-mono-sgen $(PREFIX)/bin/armv7k-unknown-darwin-mono-sgen $(PREFIX)/bin/arm64_32-darwin-mono-sgen

#
# LLVM
Expand Down
12 changes: 12 additions & 0 deletions docs/website/mtouch-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,18 @@ This warning is shown if the assemblies names given to the `--interpreter` optio

<!-- 0143-0144: used by mmp -->

<a name="MT0145" />

### MT0145: Please use device builds on WatchOS.

This error occurs if you use combined device builds for a Watch extension project. Per device builds are default in new projects.

<a name="MT0146" />

### MT0146: ARM64_32 Debug mode requires --interpreter[=all], forcing it.

This warning is shown when `--interpreter` isn't specified explicitly for ARM64_32 Debug builds. The AOT compiler can't be used because it doesn't support ARM64_32.

# MT1xxx: Project related error messages

### MT10xx: Installer / mtouch
Expand Down
2 changes: 1 addition & 1 deletion tools/mtouch/Assembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public void CreateAOTTask (Abi abi)
aotInfo.AsmFiles.Add (asm_output);
aotInfo.AotDataFiles.Add (data);

var aotCompiler = Driver.GetAotCompiler (App, Target.Is64Build);
var aotCompiler = Driver.GetAotCompiler (App, abi, Target.Is64Build);
var aotArgs = Driver.GetAotArguments (App, assembly_path, abi, build_dir, asm_output ?? other_output, llvm_aot_ofile, data);
var task = new AOTTask
{
Expand Down
3 changes: 2 additions & 1 deletion tools/mtouch/BuildTasks.mtouch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ public override IEnumerable<string> FileDependencies {
if (Assembly.HasDependencyMap)
inputs.AddRange (Assembly.DependencyMap);
inputs.Add (AssemblyName);
inputs.Add (Driver.GetAotCompiler (Assembly.App, Assembly.Target.Is64Build));
foreach (var abi in Assembly.Target.Abis)
inputs.Add (Driver.GetAotCompiler (Assembly.App, abi, Assembly.Target.Is64Build));
var mdb = Assembly.FullPath + ".mdb";
if (File.Exists (mdb))
inputs.Add (mdb);
Expand Down
23 changes: 19 additions & 4 deletions tools/mtouch/mtouch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public static int XcodeRun (string command, string args, StringBuilder output =
return ret;
}

public static string GetAotCompiler (Application app, bool is64bits)
public static string GetAotCompiler (Application app, Abi abi, bool is64bits)
{
switch (app.Platform) {
case ApplePlatform.iOS:
Expand All @@ -372,7 +372,12 @@ public static string GetAotCompiler (Application app, bool is64bits)
return Path.Combine (cross_prefix, "bin", "arm-darwin-mono-sgen");
}
case ApplePlatform.WatchOS:
return Path.Combine (cross_prefix, "bin", "armv7k-unknown-darwin-mono-sgen");
/* Use arm64_32 cross only for Debug mode */
if (abi == Abi.ARM64_32 && !app.EnableLLVMOnlyBitCode) {
return Path.Combine (cross_prefix, "bin", "arm64_32-darwin-mono-sgen");
} else {
return Path.Combine (cross_prefix, "bin", "armv7k-unknown-darwin-mono-sgen");
}
case ApplePlatform.TVOS:
return Path.Combine (cross_prefix, "bin", "arm64-darwin-mono-sgen");
default:
Expand Down Expand Up @@ -1339,14 +1344,24 @@ static int Main2 (string[] args)
app.UseInterpreter = false;
}

// FIXME: the interpreter only supports ARM64 right now
// FIXME: the interpreter only supports ARM64{,_32} right now
// temporary - without a check here the error happens when deploying
if (!app.IsSimulatorBuild && !app.IsArchEnabled (Abi.ARM64))
if (!app.IsSimulatorBuild && (!app.IsArchEnabled (Abi.ARM64) && !app.IsArchEnabled (Abi.ARM64_32)))
throw ErrorHelper.CreateError (99, "Internal error: The interpreter is currently only available for 64 bits.");

// needs to be set after the argument validations
// interpreter can use some extra code (e.g. SRE) that is not shipped in the default (AOT) profile
app.EnableRepl = true;
} else {
if (app.Platform == ApplePlatform.WatchOS && app.IsArchEnabled (Abi.ARM64_32) && app.BitCodeMode != BitCodeMode.LLVMOnly) {
if (app.IsArchEnabled (Abi.ARMv7k)) {
throw ErrorHelper.CreateError (145, "Please use device builds on WatchOS.");
} else {
ErrorHelper.Warning (146, "ARM64_32 Debug mode requires --interpreter[=all], forcing it.");
app.UseInterpreter = true;
app.InterpretedAssemblies.Clear ();
}
}
}

if (cross_prefix == null)
Expand Down