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 | |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 17 | art_cc_defaults { |
| 18 | name: "libart-dex2oat-defaults", |
| 19 | defaults: ["art_defaults"], |
| 20 | host_supported: true, |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 21 | srcs: [ |
| 22 | "linker/elf_writer.cc", |
| 23 | "linker/elf_writer_quick.cc", |
| 24 | "linker/image_writer.cc", |
| 25 | "linker/multi_oat_relative_patcher.cc", |
| 26 | "linker/oat_writer.cc", |
| 27 | ], |
| 28 | target: { |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 29 | android: { |
| 30 | // For atrace. |
| 31 | shared_libs: ["libcutils"], |
| 32 | }, |
| 33 | }, |
| 34 | generated_sources: ["art_dex2oat_operator_srcs"], |
| 35 | shared_libs: [ |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 36 | "libbase", |
| 37 | "liblz4", |
| 38 | "liblzma", |
| 39 | ], |
Andreas Gampe | f24dfb0 | 2017-11-01 15:41:25 -0700 | [diff] [blame] | 40 | include_dirs: [ |
| 41 | "external/lz4/lib", |
Andreas Gampe | 238e8fc | 2017-11-01 17:10:10 -0700 | [diff] [blame] | 42 | "external/zlib", |
Andreas Gampe | f24dfb0 | 2017-11-01 15:41:25 -0700 | [diff] [blame] | 43 | ], |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 44 | export_include_dirs: ["."], |
| 45 | |
| 46 | // For SHA-1 checksumming of build ID |
| 47 | static: { |
| 48 | whole_static_libs: ["libcrypto"], |
| 49 | }, |
| 50 | shared: { |
| 51 | shared_libs: ["libcrypto"], |
| 52 | }, |
| 53 | } |
| 54 | |
| 55 | gensrcs { |
| 56 | name: "art_dex2oat_operator_srcs", |
| 57 | cmd: "$(location generate-operator-out.py) art/dex2oat $(in) > $(out)", |
| 58 | tool_files: ["generate-operator-out.py"], |
| 59 | srcs: [ |
| 60 | "linker/image_writer.h", |
| 61 | ], |
| 62 | output_extension: "operator_out.cc", |
| 63 | } |
| 64 | |
| 65 | art_cc_static_library { |
| 66 | name: "libart-dex2oat", |
| 67 | defaults: ["libart-dex2oat-defaults"], |
| 68 | shared_libs: [ |
| 69 | "libart-compiler", |
Andreas Gampe | 772bd2f | 2018-01-26 12:56:22 -0800 | [diff] [blame] | 70 | "libart-dexlayout", |
Dan Willemsen | 2ca2780 | 2017-09-27 14:57:43 -0700 | [diff] [blame] | 71 | "libart", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 72 | ], |
| 73 | } |
| 74 | |
| 75 | art_cc_static_library { |
| 76 | name: "libartd-dex2oat", |
| 77 | defaults: [ |
| 78 | "art_debug_defaults", |
| 79 | "libart-dex2oat-defaults", |
| 80 | ], |
| 81 | shared_libs: [ |
| 82 | "libartd-compiler", |
Andreas Gampe | 772bd2f | 2018-01-26 12:56:22 -0800 | [diff] [blame] | 83 | "libartd-dexlayout", |
Dan Willemsen | 2ca2780 | 2017-09-27 14:57:43 -0700 | [diff] [blame] | 84 | "libartd", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 85 | ], |
| 86 | } |
| 87 | |
Andreas Gampe | 7b56591 | 2017-03-20 15:48:52 -0700 | [diff] [blame] | 88 | cc_library_headers { |
| 89 | name: "dex2oat_headers", |
| 90 | host_supported: true, |
| 91 | export_include_dirs: ["include"], |
| 92 | } |
| 93 | |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 94 | cc_defaults { |
| 95 | name: "dex2oat-defaults", |
| 96 | host_supported: true, |
| 97 | defaults: ["art_defaults"], |
Andreas Gampe | 097f34c | 2017-08-23 08:57:51 -0700 | [diff] [blame] | 98 | srcs: [ |
| 99 | "dex2oat_options.cc", |
| 100 | "dex2oat.cc", |
| 101 | ], |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 102 | |
| 103 | target: { |
| 104 | android: { |
| 105 | // Use the 32-bit version of dex2oat on devices |
| 106 | compile_multilib: "prefer32", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 107 | }, |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 108 | }, |
Andreas Gampe | 3157fc2 | 2017-08-23 09:43:46 -0700 | [diff] [blame] | 109 | header_libs: [ |
| 110 | "dex2oat_headers", |
| 111 | "art_cmdlineparser_headers", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 112 | ], |
| 113 | } |
| 114 | |
Nicolas Geoffray | afa7e45 | 2016-09-14 10:26:56 +0100 | [diff] [blame] | 115 | art_cc_binary { |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 116 | name: "dex2oat", |
| 117 | defaults: [ |
| 118 | "dex2oat-defaults", |
| 119 | ], |
| 120 | shared_libs: [ |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 121 | "libart-compiler", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 122 | "libart-dexlayout", |
| 123 | "libart", |
David Sehr | 0225f8e | 2018-01-31 08:52:24 +0000 | [diff] [blame^] | 124 | "libdexfile", |
Andreas Gampe | 3fec9ac | 2016-09-13 10:47:28 -0700 | [diff] [blame] | 125 | "libbase", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 126 | "liblz4", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 127 | "libsigchain", |
| 128 | ], |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 129 | static_libs: [ |
| 130 | "libart-dex2oat", |
Dan Willemsen | 2ca2780 | 2017-09-27 14:57:43 -0700 | [diff] [blame] | 131 | ], |
Pirama Arumuga Nainar | 02f6ed6 | 2018-01-04 10:52:42 -0800 | [diff] [blame] | 132 | |
| 133 | pgo: { |
| 134 | instrumentation: true, |
Pirama Arumuga Nainar | c89013c | 2018-01-18 12:35:40 -0800 | [diff] [blame] | 135 | profile_file: "art/dex2oat.profdata", |
Pirama Arumuga Nainar | 02f6ed6 | 2018-01-04 10:52:42 -0800 | [diff] [blame] | 136 | benchmarks: ["dex2oat"], |
Pirama Arumuga Nainar | 02f6ed6 | 2018-01-04 10:52:42 -0800 | [diff] [blame] | 137 | cflags: [ |
| 138 | // Ignore frame-size increase resulting from instrumentation. |
| 139 | "-Wno-frame-larger-than=", |
| 140 | "-DART_PGO_INSTRUMENTATION", |
| 141 | ], |
| 142 | } |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 143 | } |
| 144 | |
Nicolas Geoffray | afa7e45 | 2016-09-14 10:26:56 +0100 | [diff] [blame] | 145 | art_cc_binary { |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 146 | name: "dex2oatd", |
| 147 | defaults: [ |
| 148 | "art_debug_defaults", |
| 149 | "dex2oat-defaults", |
| 150 | ], |
| 151 | shared_libs: [ |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 152 | "libartd-compiler", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 153 | "libartd-dexlayout", |
| 154 | "libartd", |
David Sehr | 0225f8e | 2018-01-31 08:52:24 +0000 | [diff] [blame^] | 155 | "libdexfile", |
Andreas Gampe | 3fec9ac | 2016-09-13 10:47:28 -0700 | [diff] [blame] | 156 | "libbase", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 157 | "liblz4", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 158 | "libsigchain", |
| 159 | ], |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 160 | static_libs: [ |
| 161 | "libartd-dex2oat", |
Dan Willemsen | 2ca2780 | 2017-09-27 14:57:43 -0700 | [diff] [blame] | 162 | ], |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 163 | } |
| 164 | |
Nicolas Geoffray | afa7e45 | 2016-09-14 10:26:56 +0100 | [diff] [blame] | 165 | art_cc_binary { |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 166 | name: "dex2oats", |
| 167 | device_supported: false, |
| 168 | static_executable: true, |
| 169 | defaults: ["dex2oat-defaults"], |
Colin Cross | aa63aa2 | 2016-09-13 14:07:00 -0700 | [diff] [blame] | 170 | target: { |
| 171 | darwin: { |
| 172 | enabled: false, |
| 173 | }, |
| 174 | }, |
Colin Cross | 2cfc4ba | 2016-09-13 16:55:55 -0700 | [diff] [blame] | 175 | ldflags: [ |
| 176 | // We need this because GC stress mode makes use of |
| 177 | // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also |
| 178 | // defined in libgcc_eh.a(unwind-dw2.o) |
| 179 | // TODO: Having this is not ideal as it might obscure errors. |
| 180 | // Try to get rid of it. |
| 181 | "-z muldefs", |
| 182 | ], |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 183 | static_libs: [ |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 184 | "libart-dex2oat", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 185 | "libart-compiler", |
Jeff Hao | 608f2ce | 2016-10-19 11:17:11 -0700 | [diff] [blame] | 186 | "libart-dexlayout", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 187 | "libart", |
| 188 | "libvixl-arm", |
| 189 | "libvixl-arm64", |
| 190 | ] + art_static_dependencies, |
| 191 | } |
| 192 | |
Nicolas Geoffray | afa7e45 | 2016-09-14 10:26:56 +0100 | [diff] [blame] | 193 | art_cc_binary { |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 194 | name: "dex2oatds", |
| 195 | device_supported: false, |
| 196 | static_executable: true, |
| 197 | defaults: [ |
| 198 | "art_debug_defaults", |
| 199 | "dex2oat-defaults", |
| 200 | ], |
Colin Cross | aa63aa2 | 2016-09-13 14:07:00 -0700 | [diff] [blame] | 201 | target: { |
| 202 | darwin: { |
| 203 | enabled: false, |
| 204 | }, |
| 205 | }, |
Colin Cross | 2cfc4ba | 2016-09-13 16:55:55 -0700 | [diff] [blame] | 206 | ldflags: [ |
| 207 | // We need this because GC stress mode makes use of |
| 208 | // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also |
| 209 | // defined in libgcc_eh.a(unwind-dw2.o) |
| 210 | // TODO: Having this is not ideal as it might obscure errors. |
| 211 | // Try to get rid of it. |
| 212 | "-z muldefs", |
| 213 | ], |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 214 | static_libs: [ |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 215 | "libartd-dex2oat", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 216 | "libartd-compiler", |
Jeff Hao | 608f2ce | 2016-10-19 11:17:11 -0700 | [diff] [blame] | 217 | "libartd-dexlayout", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 218 | "libartd", |
| 219 | "libvixld-arm", |
| 220 | "libvixld-arm64", |
| 221 | ] + art_static_dependencies, |
| 222 | } |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 223 | |
| 224 | art_cc_test { |
| 225 | name: "art_dex2oat_tests", |
| 226 | defaults: [ |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 227 | "art_gtest_defaults", |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 228 | ], |
Mathieu Chartier | f70fe3d | 2017-06-21 15:24:02 -0700 | [diff] [blame] | 229 | srcs: [ |
| 230 | "dex2oat_test.cc", |
| 231 | "dex2oat_image_test.cc", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 232 | "linker/elf_writer_test.cc", |
| 233 | "linker/image_test.cc", |
| 234 | "linker/image_write_read_test.cc", |
Vladimir Marko | f3c52b4 | 2017-11-17 17:32:12 +0000 | [diff] [blame] | 235 | "linker/index_bss_mapping_encoder_test.cc", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 236 | "linker/multi_oat_relative_patcher_test.cc", |
| 237 | "linker/oat_writer_test.cc", |
Mathieu Chartier | f70fe3d | 2017-06-21 15:24:02 -0700 | [diff] [blame] | 238 | ], |
Andreas Gampe | f788297 | 2017-03-20 16:35:24 -0700 | [diff] [blame] | 239 | header_libs: ["dex2oat_headers"], |
Andreas Gampe | 238e8fc | 2017-11-01 17:10:10 -0700 | [diff] [blame] | 240 | include_dirs: [ |
| 241 | "external/zlib", |
| 242 | ], |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 243 | shared_libs: [ |
| 244 | "libartd-compiler", |
| 245 | "libartd-dexlayout", |
| 246 | "libbase", |
| 247 | "liblz4", |
| 248 | "libsigchain", |
| 249 | ], |
| 250 | static_libs: [ |
| 251 | "libartd-dex2oat", |
Dan Willemsen | 2ca2780 | 2017-09-27 14:57:43 -0700 | [diff] [blame] | 252 | ], |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 253 | } |