| 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 import 'runtime_configuration.dart' show DartPrecompiledAdbRuntimeConfiguration; | 10 import 'runtime_configuration.dart' show DartPrecompiledAdbRuntimeConfiguration; |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 bootstrapDependencies(buildDir), exec, args, environmentOverrides); | 645 bootstrapDependencies(buildDir), exec, args, environmentOverrides); |
| 646 } | 646 } |
| 647 | 647 |
| 648 CompilationCommand computeAssembleCommand( | 648 CompilationCommand computeAssembleCommand( |
| 649 String tempDir, | 649 String tempDir, |
| 650 String buildDir, | 650 String buildDir, |
| 651 CommandBuilder commandBuilder, | 651 CommandBuilder commandBuilder, |
| 652 List arguments, | 652 List arguments, |
| 653 Map<String, String> environmentOverrides) { | 653 Map<String, String> environmentOverrides) { |
| 654 | 654 |
| 655 var cc, shared; | 655 var cc, shared, ld_flags; |
| 656 if (isAndroid) { | 656 if (isAndroid) { |
| 657 var ndk = "third_party/android_tools/ndk"; | 657 var ndk = "third_party/android_tools/ndk"; |
| 658 var triple; | 658 var triple; |
| 659 if (arch == "arm") { | 659 if (arch == "arm") { |
| 660 triple = "arm-linux-androideabi"; | 660 triple = "arm-linux-androideabi"; |
| 661 } else if (arch == "arm64") { | 661 } else if (arch == "arm64") { |
| 662 triple = "aarch64-linux-android"; | 662 triple = "aarch64-linux-android"; |
| 663 } | 663 } |
| 664 var host; | 664 var host; |
| 665 if (Platform.isLinux) { | 665 if (Platform.isLinux) { |
| 666 host = "linux"; | 666 host = "linux"; |
| 667 } else if (Platform.isMacOS) { | 667 } else if (Platform.isMacOS) { |
| 668 host = "darwin"; | 668 host = "darwin"; |
| 669 } | 669 } |
| 670 cc = "$ndk/toolchains/$triple-4.9/prebuilt/$host-x86_64/bin/$triple-gcc"; | 670 cc = "$ndk/toolchains/$triple-4.9/prebuilt/$host-x86_64/bin/$triple-gcc"; |
| 671 shared = '-shared'; | 671 shared = '-shared'; |
| 672 } else if (Platform.isLinux) { | 672 } else if (Platform.isLinux) { |
| 673 cc = 'gcc'; | 673 cc = 'gcc'; |
| 674 shared = '-shared'; | 674 shared = '-shared'; |
| 675 } else if (Platform.isMacOS) { | 675 } else if (Platform.isMacOS) { |
| 676 cc = 'clang'; | 676 cc = 'clang'; |
| 677 shared = '-dynamiclib'; | 677 shared = '-dynamiclib'; |
| 678 // Tell Mac linker to give up generating eh_frame from dwarf. |
| 679 ld_flags = '-Wl,-no_compact_unwind'; |
| 678 } else { | 680 } else { |
| 679 throw "Platform not supported: ${Platform.operatingSystem}"; | 681 throw "Platform not supported: ${Platform.operatingSystem}"; |
| 680 } | 682 } |
| 681 | 683 |
| 682 var cc_flags; | 684 var cc_flags; |
| 683 if (arch == 'x64') { | 685 if (arch == 'x64') { |
| 684 cc_flags = "-m64"; | 686 cc_flags = "-m64"; |
| 685 } else if (arch == 'simarm64') { | 687 } else if (arch == 'simarm64') { |
| 686 cc_flags = "-m64"; | 688 cc_flags = "-m64"; |
| 687 } else if (arch == 'ia32') { | 689 } else if (arch == 'ia32') { |
| 688 cc_flags = "-m32"; | 690 cc_flags = "-m32"; |
| 689 } else if (arch == 'simarm') { | 691 } else if (arch == 'simarm') { |
| 690 cc_flags = "-m32"; | 692 cc_flags = "-m32"; |
| 691 } else if (arch == 'simmips') { | 693 } else if (arch == 'simmips') { |
| 692 cc_flags = "-m32"; | 694 cc_flags = "-m32"; |
| 693 } else if (arch == 'arm') { | 695 } else if (arch == 'arm') { |
| 694 cc_flags = null; | 696 cc_flags = null; |
| 695 } else if (arch == 'arm64') { | 697 } else if (arch == 'arm64') { |
| 696 cc_flags = null; | 698 cc_flags = null; |
| 697 } else if (arch == 'mips') { | 699 } else if (arch == 'mips') { |
| 698 cc_flags = "-EL"; | 700 cc_flags = "-EL"; |
| 699 } else { | 701 } else { |
| 700 throw "Architecture not supported: $arch"; | 702 throw "Architecture not supported: $arch"; |
| 701 } | 703 } |
| 702 | 704 |
| 703 var exec = cc; | 705 var exec = cc; |
| 704 var args = (cc_flags != null) ? [ shared, cc_flags ] : [ shared ]; | 706 var args = []; |
| 705 args.addAll([ | 707 if (cc_flags != null) args.add(cc_flags); |
| 706 '-nostdlib', | 708 if (ld_flags != null) args.add(ld_flags); |
| 707 '-o', | 709 args.add(shared); |
| 708 '$tempDir/out.aotsnapshot', | 710 args.add('-nostdlib'); |
| 709 '$tempDir/out.S' | 711 args.add('-o'); |
| 710 ]); | 712 args.add('$tempDir/out.aotsnapshot'); |
| 713 args.add('$tempDir/out.S'); |
| 711 | 714 |
| 712 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk, | 715 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk, |
| 713 bootstrapDependencies(buildDir), exec, args, environmentOverrides); | 716 bootstrapDependencies(buildDir), exec, args, environmentOverrides); |
| 714 } | 717 } |
| 715 | 718 |
| 716 // This step reduces the amount of space needed to run the precompilation | 719 // This step reduces the amount of space needed to run the precompilation |
| 717 // tests by 60%. | 720 // tests by 60%. |
| 718 CompilationCommand computeRemoveAssemblyCommand( | 721 CompilationCommand computeRemoveAssemblyCommand( |
| 719 String tempDir, | 722 String tempDir, |
| 720 String buildDir, | 723 String buildDir, |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 RuntimeConfiguration runtimeConfiguration, | 933 RuntimeConfiguration runtimeConfiguration, |
| 931 String buildDir, | 934 String buildDir, |
| 932 TestInformation info, | 935 TestInformation info, |
| 933 List<String> vmOptions, | 936 List<String> vmOptions, |
| 934 List<String> sharedOptions, | 937 List<String> sharedOptions, |
| 935 List<String> originalArguments, | 938 List<String> originalArguments, |
| 936 CommandArtifact artifact) { | 939 CommandArtifact artifact) { |
| 937 return <String>[]; | 940 return <String>[]; |
| 938 } | 941 } |
| 939 } | 942 } |
| OLD | NEW |