Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: tools/testing/dart/compiler_configuration.dart

Issue 1922163002: Initial support to test.dart for running precompiler tests on android devices (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cleanup of CL and of existing code. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/testing/dart/compiler_configuration.dart
diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart
index 161252a17841a0569f90098f660039ae6d641b04..7c0945eed81bb9cc15f7e1385d269f4a75529e0c 100644
--- a/tools/testing/dart/compiler_configuration.dart
+++ b/tools/testing/dart/compiler_configuration.dart
@@ -79,7 +79,8 @@ abstract class CompilerConfiguration {
isDebug: isDebug,
isChecked: isChecked,
arch: configuration['arch'],
- useBlobs: useBlobs);
+ useBlobs: useBlobs,
+ isAndroid: configuration['system'] == 'android');
case 'none':
return new NoneCompilerConfiguration(
isDebug: isDebug,
@@ -302,11 +303,11 @@ class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration {
class PrecompilerCompilerConfiguration extends CompilerConfiguration {
final String arch;
final bool useBlobs;
+ final bool isAndroid;
- PrecompilerCompilerConfiguration({bool isDebug, bool isChecked, String arch, bool useBlobs})
- : super._subclass(isDebug: isDebug, isChecked: isChecked),
- arch = arch,
- useBlobs = useBlobs;
+ PrecompilerCompilerConfiguration({bool isDebug, bool isChecked,
+ this.arch, this.useBlobs, this.isAndroid})
+ : super._subclass(isDebug: isDebug, isChecked: isChecked);
int computeTimeoutMultiplier() {
int multiplier = 2;
@@ -345,6 +346,9 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration {
if (useBlobs) {
args.add("--use_blobs");
}
+ if (isAndroid && arch == 'arm') {
+ args.add('--no-sim-use-hardfp');
+ }
args.addAll(arguments);
return commandBuilder.getCompilationCommand('precompiler', tempDir, !useSdk,
@@ -357,7 +361,8 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration {
CommandBuilder commandBuilder,
List arguments,
Map<String, String> environmentOverrides) {
- var cc, cc_flags, shared, libname;
+
+ var cc, shared, libname;
if (Platform.isLinux) {
cc = 'gcc';
shared = '-shared';
@@ -369,17 +374,24 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration {
} else {
throw "Platform not supported: ${Platform.operatingSystem}";
}
+ if (isAndroid) {
+ // TODO: If we're not using "--use_blobs" we need to use the arm cross
+ // compiler instead of just 'gcc' for .
+ }
+ var cc_flags;
if (arch == 'x64') {
cc_flags = "-m64";
} else if (arch == 'simarm64') {
cc_flags = "-m64";
+ } else if (arch == 'ia32') {
+ cc_flags = "-m32";
} else if (arch == 'simarm') {
cc_flags = "-m32";
} else if (arch == 'simmips') {
cc_flags = "-m32";
} else if (arch == 'arm') {
- cc_flags = "";
+ cc_flags = null;
} else if (arch == 'mips') {
cc_flags = "-EL";
} else {
@@ -387,13 +399,12 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration {
}
var exec = cc;
- var args = [
- shared,
- cc_flags,
+ var args = (cc_flags != null) ? [ shared, cc_flags ] : [ shared ];
Bill Hesse 2016/04/27 13:54:40 I like this better.
kustermann 2016/05/02 10:40:23 Acknowledged.
+ args.addAll([
'-o',
'$tempDir/$libname',
'$tempDir/precompiled.S'
- ];
+ ]);
return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk,
bootstrapDependencies(buildDir), exec, args, environmentOverrides);

Powered by Google App Engine
This is Rietveld 408576698