OLD | NEW |
---|---|
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library compiler_configuration; | 5 library compiler_configuration; |
6 | 6 |
7 import 'dart:io' show Platform; | 7 import 'dart:io' show Platform; |
8 | 8 |
9 import 'runtime_configuration.dart' show RuntimeConfiguration; | 9 import 'runtime_configuration.dart' show RuntimeConfiguration; |
10 | 10 |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
338 String buildDir, | 338 String buildDir, |
339 CommandBuilder commandBuilder, | 339 CommandBuilder commandBuilder, |
340 List arguments, | 340 List arguments, |
341 Map<String, String> environmentOverrides) { | 341 Map<String, String> environmentOverrides) { |
342 var exec = "$buildDir/dart_bootstrap"; | 342 var exec = "$buildDir/dart_bootstrap"; |
343 var args = new List(); | 343 var args = new List(); |
344 args.add("--gen-precompiled-snapshot=$tempDir"); | 344 args.add("--gen-precompiled-snapshot=$tempDir"); |
345 if (useBlobs) { | 345 if (useBlobs) { |
346 args.add("--use_blobs"); | 346 args.add("--use_blobs"); |
347 } | 347 } |
348 args.addAll(arguments); | 348 args.addAll(arguments); |
rmacnak
2016/04/26 17:18:07
if (targeting 32 bit ARM Android) {
args.add("--
kustermann
2016/04/27 10:36:00
Good catch, thanks.
| |
349 | 349 |
350 return commandBuilder.getCompilationCommand('precompiler', tempDir, !useSdk, | 350 return commandBuilder.getCompilationCommand('precompiler', tempDir, !useSdk, |
351 bootstrapDependencies(buildDir), exec, args, environmentOverrides); | 351 bootstrapDependencies(buildDir), exec, args, environmentOverrides); |
352 } | 352 } |
353 | 353 |
354 CompilationCommand computeAssembleCommand( | 354 CompilationCommand computeAssembleCommand( |
355 String tempDir, | 355 String tempDir, |
356 String buildDir, | 356 String buildDir, |
357 CommandBuilder commandBuilder, | 357 CommandBuilder commandBuilder, |
358 List arguments, | 358 List arguments, |
359 Map<String, String> environmentOverrides) { | 359 Map<String, String> environmentOverrides) { |
360 var cc, cc_flags, shared, libname; | 360 var cc, cc_flags, shared, libname; |
361 if (Platform.isLinux) { | 361 if (Platform.isLinux) { |
362 cc = 'gcc'; | 362 cc = 'gcc'; |
363 shared = '-shared'; | 363 shared = '-shared'; |
364 libname = 'libprecompiled.so'; | 364 libname = 'libprecompiled.so'; |
365 } else if (Platform.isMacOS) { | 365 } else if (Platform.isMacOS) { |
366 cc = 'clang'; | 366 cc = 'clang'; |
367 shared = '-dynamiclib'; | 367 shared = '-dynamiclib'; |
368 libname = 'libprecompiled.dylib'; | 368 libname = 'libprecompiled.dylib'; |
369 } else { | 369 } else { |
370 throw "Platform not supported: ${Platform.operatingSystem}"; | 370 throw "Platform not supported: ${Platform.operatingSystem}"; |
371 } | 371 } |
372 | 372 |
373 if (arch == 'x64') { | 373 if (arch == 'x64') { |
374 cc_flags = "-m64"; | 374 cc_flags = "-m64"; |
375 } else if (arch == 'simarm64') { | 375 } else if (arch == 'simarm64') { |
376 cc_flags = "-m64"; | 376 cc_flags = "-m64"; |
377 } else if (arch == 'ia32') { | |
378 cc_flags = "-m32"; | |
377 } else if (arch == 'simarm') { | 379 } else if (arch == 'simarm') { |
378 cc_flags = "-m32"; | 380 cc_flags = "-m32"; |
379 } else if (arch == 'simmips') { | 381 } else if (arch == 'simmips') { |
380 cc_flags = "-m32"; | 382 cc_flags = "-m32"; |
381 } else if (arch == 'arm') { | 383 } else if (arch == 'arm') { |
384 // TODO: If we're not using "--use_blobs" we need to use the arm cross | |
385 // compiler instead of just 'gcc'. | |
382 cc_flags = ""; | 386 cc_flags = ""; |
383 } else if (arch == 'mips') { | 387 } else if (arch == 'mips') { |
384 cc_flags = "-EL"; | 388 cc_flags = "-EL"; |
385 } else { | 389 } else { |
386 throw "Architecture not supported: $arch"; | 390 throw "Architecture not supported: $arch"; |
387 } | 391 } |
388 | 392 |
389 var exec = cc; | 393 var exec = cc; |
390 var args = [ | 394 var args = [ shared ]; |
391 shared, | 395 if (cc_flags != null && cc_flags.length > 0) args.add(cc_flags); |
392 cc_flags, | 396 args.addAll([ |
393 '-o', | 397 '-o', |
394 '$tempDir/$libname', | 398 '$tempDir/$libname', |
395 '$tempDir/precompiled.S' | 399 '$tempDir/precompiled.S' |
396 ]; | 400 ]); |
397 | 401 |
398 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk, | 402 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk, |
399 bootstrapDependencies(buildDir), exec, args, environmentOverrides); | 403 bootstrapDependencies(buildDir), exec, args, environmentOverrides); |
400 } | 404 } |
401 | 405 |
402 // This step reduces the amount of space needed to run the precompilation | 406 // This step reduces the amount of space needed to run the precompilation |
403 // tests by 60%. | 407 // tests by 60%. |
404 CompilationCommand computeRemoveAssemblyCommand( | 408 CompilationCommand computeRemoveAssemblyCommand( |
405 String tempDir, | 409 String tempDir, |
406 String buildDir, | 410 String buildDir, |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
598 RuntimeConfiguration runtimeConfiguration, | 602 RuntimeConfiguration runtimeConfiguration, |
599 String buildDir, | 603 String buildDir, |
600 TestInformation info, | 604 TestInformation info, |
601 List<String> vmOptions, | 605 List<String> vmOptions, |
602 List<String> sharedOptions, | 606 List<String> sharedOptions, |
603 List<String> originalArguments, | 607 List<String> originalArguments, |
604 CommandArtifact artifact) { | 608 CommandArtifact artifact) { |
605 return <String>[]; | 609 return <String>[]; |
606 } | 610 } |
607 } | 611 } |
OLD | NEW |