| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 1 | // | 
|  | 2 | // Copyright (C) 2011 The Android Open Source Project | 
|  | 3 | // | 
|  | 4 | // Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 5 | // you may not use this file except in compliance with the License. | 
|  | 6 | // You may obtain a copy of the License at | 
|  | 7 | // | 
|  | 8 | //      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 9 | // | 
|  | 10 | // Unless required by applicable law or agreed to in writing, software | 
|  | 11 | // distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 13 | // See the License for the specific language governing permissions and | 
|  | 14 | // limitations under the License. | 
|  | 15 | // | 
|  | 16 |  | 
|  | 17 | cc_defaults { | 
|  | 18 | name: "dex2oat-defaults", | 
|  | 19 | host_supported: true, | 
|  | 20 | defaults: ["art_defaults"], | 
|  | 21 | srcs: ["dex2oat.cc"], | 
|  | 22 |  | 
|  | 23 | target: { | 
|  | 24 | android: { | 
|  | 25 | // Use the 32-bit version of dex2oat on devices | 
|  | 26 | compile_multilib: "prefer32", | 
|  | 27 |  | 
|  | 28 | sanitize: { | 
|  | 29 | // ASan slows down dex2oat by ~3.5x, which translates into | 
|  | 30 | // extremely slow first boot. Disabled to help speed up | 
|  | 31 | // SANITIZE_TARGET mode. | 
|  | 32 | // Bug: 22233158 | 
|  | 33 | address: false, | 
|  | 34 | }, | 
|  | 35 | }, | 
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 36 | }, | 
|  | 37 |  | 
|  | 38 |  | 
|  | 39 | include_dirs: [ | 
|  | 40 | "art/cmdline", | 
|  | 41 | ], | 
|  | 42 | } | 
|  | 43 |  | 
| Nicolas Geoffray | afa7e45 | 2016-09-14 10:26:56 +0100 | [diff] [blame] | 44 | art_cc_binary { | 
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 45 | name: "dex2oat", | 
|  | 46 | defaults: [ | 
|  | 47 | "dex2oat-defaults", | 
|  | 48 | ], | 
|  | 49 | shared_libs: [ | 
|  | 50 | "libart", | 
|  | 51 | "libart-compiler", | 
| Andreas Gampe | 3fec9ac | 2016-09-13 10:47:28 -0700 | [diff] [blame] | 52 | "libbase", | 
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 53 | "libsigchain", | 
|  | 54 | ], | 
|  | 55 | } | 
|  | 56 |  | 
| Nicolas Geoffray | afa7e45 | 2016-09-14 10:26:56 +0100 | [diff] [blame] | 57 | art_cc_binary { | 
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 58 | name: "dex2oatd", | 
|  | 59 | defaults: [ | 
|  | 60 | "art_debug_defaults", | 
|  | 61 | "dex2oat-defaults", | 
|  | 62 | ], | 
|  | 63 | shared_libs: [ | 
|  | 64 | "libartd", | 
|  | 65 | "libartd-compiler", | 
| Andreas Gampe | 3fec9ac | 2016-09-13 10:47:28 -0700 | [diff] [blame] | 66 | "libbase", | 
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 67 | "libsigchain", | 
|  | 68 | ], | 
|  | 69 | } | 
|  | 70 |  | 
| Nicolas Geoffray | afa7e45 | 2016-09-14 10:26:56 +0100 | [diff] [blame] | 71 | art_cc_binary { | 
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 72 | name: "dex2oats", | 
|  | 73 | device_supported: false, | 
|  | 74 | static_executable: true, | 
|  | 75 | defaults: ["dex2oat-defaults"], | 
| Colin Cross | aa63aa2 | 2016-09-13 14:07:00 -0700 | [diff] [blame] | 76 | target: { | 
|  | 77 | darwin: { | 
|  | 78 | enabled: false, | 
|  | 79 | }, | 
|  | 80 | }, | 
| Colin Cross | 2cfc4ba | 2016-09-13 16:55:55 -0700 | [diff] [blame] | 81 | ldflags: [ | 
|  | 82 | // We need this because GC stress mode makes use of | 
|  | 83 | // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also | 
|  | 84 | // defined in libgcc_eh.a(unwind-dw2.o) | 
|  | 85 | // TODO: Having this is not ideal as it might obscure errors. | 
|  | 86 | // Try to get rid of it. | 
|  | 87 | "-z muldefs", | 
|  | 88 | ], | 
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 89 | static_libs: [ | 
|  | 90 | "libart-compiler", | 
|  | 91 | "libart", | 
|  | 92 | "libvixl-arm", | 
|  | 93 | "libvixl-arm64", | 
|  | 94 | ] + art_static_dependencies, | 
|  | 95 | } | 
|  | 96 |  | 
| Nicolas Geoffray | afa7e45 | 2016-09-14 10:26:56 +0100 | [diff] [blame] | 97 | art_cc_binary { | 
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 98 | name: "dex2oatds", | 
|  | 99 | device_supported: false, | 
|  | 100 | static_executable: true, | 
|  | 101 | defaults: [ | 
|  | 102 | "art_debug_defaults", | 
|  | 103 | "dex2oat-defaults", | 
|  | 104 | ], | 
| Colin Cross | aa63aa2 | 2016-09-13 14:07:00 -0700 | [diff] [blame] | 105 | target: { | 
|  | 106 | darwin: { | 
|  | 107 | enabled: false, | 
|  | 108 | }, | 
|  | 109 | }, | 
| Colin Cross | 2cfc4ba | 2016-09-13 16:55:55 -0700 | [diff] [blame] | 110 | ldflags: [ | 
|  | 111 | // We need this because GC stress mode makes use of | 
|  | 112 | // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also | 
|  | 113 | // defined in libgcc_eh.a(unwind-dw2.o) | 
|  | 114 | // TODO: Having this is not ideal as it might obscure errors. | 
|  | 115 | // Try to get rid of it. | 
|  | 116 | "-z muldefs", | 
|  | 117 | ], | 
| Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 118 | static_libs: [ | 
|  | 119 | "libartd-compiler", | 
|  | 120 | "libartd", | 
|  | 121 | "libvixld-arm", | 
|  | 122 | "libvixld-arm64", | 
|  | 123 | ] + art_static_dependencies, | 
|  | 124 | } | 
| Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 125 |  | 
|  | 126 | art_cc_test { | 
|  | 127 | name: "art_dex2oat_tests", | 
|  | 128 | defaults: [ | 
| Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 129 | "art_gtest_defaults", | 
| Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 130 | ], | 
|  | 131 | srcs: ["dex2oat_test.cc"], | 
|  | 132 | } |