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", |
Vladimir Marko | 6d66fcf | 2018-04-12 13:15:27 +0100 | [diff] [blame^] | 27 | "linker/relative_patcher.cc", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 28 | ], |
Vladimir Marko | 6d66fcf | 2018-04-12 13:15:27 +0100 | [diff] [blame^] | 29 | |
| 30 | codegen: { |
| 31 | arm: { |
| 32 | srcs: [ |
| 33 | "linker/arm/relative_patcher_arm_base.cc", |
| 34 | "linker/arm/relative_patcher_thumb2.cc", |
| 35 | ], |
| 36 | }, |
| 37 | arm64: { |
| 38 | srcs: [ |
| 39 | "linker/arm64/relative_patcher_arm64.cc", |
| 40 | ], |
| 41 | }, |
| 42 | mips: { |
| 43 | srcs: [ |
| 44 | "linker/mips/relative_patcher_mips.cc", |
| 45 | ], |
| 46 | }, |
| 47 | mips64: { |
| 48 | srcs: [ |
| 49 | "linker/mips64/relative_patcher_mips64.cc", |
| 50 | ], |
| 51 | }, |
| 52 | x86: { |
| 53 | srcs: [ |
| 54 | "linker/x86/relative_patcher_x86.cc", |
| 55 | "linker/x86/relative_patcher_x86_base.cc", |
| 56 | ], |
| 57 | }, |
| 58 | x86_64: { |
| 59 | srcs: [ |
| 60 | "linker/x86_64/relative_patcher_x86_64.cc", |
| 61 | ], |
| 62 | }, |
| 63 | }, |
| 64 | |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 65 | target: { |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 66 | android: { |
| 67 | // For atrace. |
| 68 | shared_libs: ["libcutils"], |
| 69 | }, |
| 70 | }, |
| 71 | generated_sources: ["art_dex2oat_operator_srcs"], |
| 72 | shared_libs: [ |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 73 | "libbase", |
| 74 | "liblz4", |
| 75 | "liblzma", |
| 76 | ], |
Andreas Gampe | f24dfb0 | 2017-11-01 15:41:25 -0700 | [diff] [blame] | 77 | include_dirs: [ |
| 78 | "external/lz4/lib", |
Andreas Gampe | 238e8fc | 2017-11-01 17:10:10 -0700 | [diff] [blame] | 79 | "external/zlib", |
Andreas Gampe | f24dfb0 | 2017-11-01 15:41:25 -0700 | [diff] [blame] | 80 | ], |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 81 | export_include_dirs: ["."], |
| 82 | |
| 83 | // For SHA-1 checksumming of build ID |
| 84 | static: { |
| 85 | whole_static_libs: ["libcrypto"], |
| 86 | }, |
| 87 | shared: { |
| 88 | shared_libs: ["libcrypto"], |
| 89 | }, |
| 90 | } |
| 91 | |
| 92 | gensrcs { |
| 93 | name: "art_dex2oat_operator_srcs", |
Alex Light | b69d2d3 | 2018-02-21 13:37:17 -0800 | [diff] [blame] | 94 | cmd: "$(location generate_operator_out) art/dex2oat $(in) > $(out)", |
| 95 | tools: ["generate_operator_out"], |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 96 | srcs: [ |
| 97 | "linker/image_writer.h", |
| 98 | ], |
| 99 | output_extension: "operator_out.cc", |
| 100 | } |
| 101 | |
| 102 | art_cc_static_library { |
| 103 | name: "libart-dex2oat", |
| 104 | defaults: ["libart-dex2oat-defaults"], |
| 105 | shared_libs: [ |
| 106 | "libart-compiler", |
Andreas Gampe | 772bd2f | 2018-01-26 12:56:22 -0800 | [diff] [blame] | 107 | "libart-dexlayout", |
Dan Willemsen | 2ca2780 | 2017-09-27 14:57:43 -0700 | [diff] [blame] | 108 | "libart", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 109 | ], |
| 110 | } |
| 111 | |
| 112 | art_cc_static_library { |
| 113 | name: "libartd-dex2oat", |
| 114 | defaults: [ |
| 115 | "art_debug_defaults", |
| 116 | "libart-dex2oat-defaults", |
| 117 | ], |
| 118 | shared_libs: [ |
| 119 | "libartd-compiler", |
Andreas Gampe | 772bd2f | 2018-01-26 12:56:22 -0800 | [diff] [blame] | 120 | "libartd-dexlayout", |
Dan Willemsen | 2ca2780 | 2017-09-27 14:57:43 -0700 | [diff] [blame] | 121 | "libartd", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 122 | ], |
| 123 | } |
| 124 | |
Andreas Gampe | 7b56591 | 2017-03-20 15:48:52 -0700 | [diff] [blame] | 125 | cc_library_headers { |
| 126 | name: "dex2oat_headers", |
| 127 | host_supported: true, |
| 128 | export_include_dirs: ["include"], |
| 129 | } |
| 130 | |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 131 | cc_defaults { |
| 132 | name: "dex2oat-defaults", |
| 133 | host_supported: true, |
| 134 | defaults: ["art_defaults"], |
Andreas Gampe | 097f34c | 2017-08-23 08:57:51 -0700 | [diff] [blame] | 135 | srcs: [ |
| 136 | "dex2oat_options.cc", |
| 137 | "dex2oat.cc", |
| 138 | ], |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 139 | |
| 140 | target: { |
| 141 | android: { |
| 142 | // Use the 32-bit version of dex2oat on devices |
| 143 | compile_multilib: "prefer32", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 144 | }, |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 145 | }, |
Andreas Gampe | 3157fc2 | 2017-08-23 09:43:46 -0700 | [diff] [blame] | 146 | header_libs: [ |
| 147 | "dex2oat_headers", |
| 148 | "art_cmdlineparser_headers", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 149 | ], |
| 150 | } |
| 151 | |
Nicolas Geoffray | afa7e45 | 2016-09-14 10:26:56 +0100 | [diff] [blame] | 152 | art_cc_binary { |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 153 | name: "dex2oat", |
| 154 | defaults: [ |
| 155 | "dex2oat-defaults", |
| 156 | ], |
| 157 | shared_libs: [ |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 158 | "libart-compiler", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 159 | "libart-dexlayout", |
| 160 | "libart", |
David Sehr | 0225f8e | 2018-01-31 08:52:24 +0000 | [diff] [blame] | 161 | "libdexfile", |
Andreas Gampe | 3fec9ac | 2016-09-13 10:47:28 -0700 | [diff] [blame] | 162 | "libbase", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 163 | "liblz4", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 164 | "libsigchain", |
| 165 | ], |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 166 | static_libs: [ |
| 167 | "libart-dex2oat", |
Dan Willemsen | 2ca2780 | 2017-09-27 14:57:43 -0700 | [diff] [blame] | 168 | ], |
Pirama Arumuga Nainar | 02f6ed6 | 2018-01-04 10:52:42 -0800 | [diff] [blame] | 169 | |
| 170 | pgo: { |
| 171 | instrumentation: true, |
Pirama Arumuga Nainar | c89013c | 2018-01-18 12:35:40 -0800 | [diff] [blame] | 172 | profile_file: "art/dex2oat.profdata", |
Pirama Arumuga Nainar | 02f6ed6 | 2018-01-04 10:52:42 -0800 | [diff] [blame] | 173 | benchmarks: ["dex2oat"], |
Pirama Arumuga Nainar | 02f6ed6 | 2018-01-04 10:52:42 -0800 | [diff] [blame] | 174 | cflags: [ |
| 175 | // Ignore frame-size increase resulting from instrumentation. |
| 176 | "-Wno-frame-larger-than=", |
| 177 | "-DART_PGO_INSTRUMENTATION", |
| 178 | ], |
Yi Kong | 1d894d9 | 2018-01-19 22:01:14 -0800 | [diff] [blame] | 179 | }, |
| 180 | target: { |
| 181 | android: { |
| 182 | lto: { |
| 183 | thin: true, |
| 184 | }, |
| 185 | }, |
| 186 | }, |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 187 | } |
| 188 | |
Nicolas Geoffray | afa7e45 | 2016-09-14 10:26:56 +0100 | [diff] [blame] | 189 | art_cc_binary { |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 190 | name: "dex2oatd", |
| 191 | defaults: [ |
| 192 | "art_debug_defaults", |
| 193 | "dex2oat-defaults", |
| 194 | ], |
| 195 | shared_libs: [ |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 196 | "libartd-compiler", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 197 | "libartd-dexlayout", |
| 198 | "libartd", |
David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 199 | "libdexfiled", |
Andreas Gampe | 3fec9ac | 2016-09-13 10:47:28 -0700 | [diff] [blame] | 200 | "libbase", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 201 | "liblz4", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 202 | "libsigchain", |
| 203 | ], |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 204 | static_libs: [ |
| 205 | "libartd-dex2oat", |
Dan Willemsen | 2ca2780 | 2017-09-27 14:57:43 -0700 | [diff] [blame] | 206 | ], |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 207 | } |
| 208 | |
Nicolas Geoffray | afa7e45 | 2016-09-14 10:26:56 +0100 | [diff] [blame] | 209 | art_cc_binary { |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 210 | name: "dex2oats", |
| 211 | device_supported: false, |
| 212 | static_executable: true, |
| 213 | defaults: ["dex2oat-defaults"], |
Colin Cross | aa63aa2 | 2016-09-13 14:07:00 -0700 | [diff] [blame] | 214 | target: { |
| 215 | darwin: { |
| 216 | enabled: false, |
| 217 | }, |
| 218 | }, |
Colin Cross | 2cfc4ba | 2016-09-13 16:55:55 -0700 | [diff] [blame] | 219 | ldflags: [ |
| 220 | // We need this because GC stress mode makes use of |
| 221 | // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also |
| 222 | // defined in libgcc_eh.a(unwind-dw2.o) |
| 223 | // TODO: Having this is not ideal as it might obscure errors. |
| 224 | // Try to get rid of it. |
| 225 | "-z muldefs", |
| 226 | ], |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 227 | static_libs: [ |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 228 | "libart-dex2oat", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 229 | "libart-compiler", |
Jeff Hao | 608f2ce | 2016-10-19 11:17:11 -0700 | [diff] [blame] | 230 | "libart-dexlayout", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 231 | "libart", |
David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 232 | "libdexfile", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 233 | "libvixl-arm", |
| 234 | "libvixl-arm64", |
| 235 | ] + art_static_dependencies, |
| 236 | } |
| 237 | |
Nicolas Geoffray | afa7e45 | 2016-09-14 10:26:56 +0100 | [diff] [blame] | 238 | art_cc_binary { |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 239 | name: "dex2oatds", |
| 240 | device_supported: false, |
| 241 | static_executable: true, |
| 242 | defaults: [ |
| 243 | "art_debug_defaults", |
| 244 | "dex2oat-defaults", |
| 245 | ], |
Colin Cross | aa63aa2 | 2016-09-13 14:07:00 -0700 | [diff] [blame] | 246 | target: { |
| 247 | darwin: { |
| 248 | enabled: false, |
| 249 | }, |
| 250 | }, |
Colin Cross | 2cfc4ba | 2016-09-13 16:55:55 -0700 | [diff] [blame] | 251 | ldflags: [ |
| 252 | // We need this because GC stress mode makes use of |
| 253 | // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also |
| 254 | // defined in libgcc_eh.a(unwind-dw2.o) |
| 255 | // TODO: Having this is not ideal as it might obscure errors. |
| 256 | // Try to get rid of it. |
| 257 | "-z muldefs", |
| 258 | ], |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 259 | static_libs: [ |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 260 | "libartd-dex2oat", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 261 | "libartd-compiler", |
Jeff Hao | 608f2ce | 2016-10-19 11:17:11 -0700 | [diff] [blame] | 262 | "libartd-dexlayout", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 263 | "libartd", |
David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 264 | "libdexfiled", |
Colin Cross | c7376e0 | 2016-09-08 12:52:18 -0700 | [diff] [blame] | 265 | "libvixld-arm", |
| 266 | "libvixld-arm64", |
| 267 | ] + art_static_dependencies, |
| 268 | } |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 269 | |
| 270 | art_cc_test { |
| 271 | name: "art_dex2oat_tests", |
| 272 | defaults: [ |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 273 | "art_gtest_defaults", |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 274 | ], |
Mathieu Chartier | f70fe3d | 2017-06-21 15:24:02 -0700 | [diff] [blame] | 275 | srcs: [ |
| 276 | "dex2oat_test.cc", |
| 277 | "dex2oat_image_test.cc", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 278 | "linker/elf_writer_test.cc", |
| 279 | "linker/image_test.cc", |
| 280 | "linker/image_write_read_test.cc", |
Vladimir Marko | f3c52b4 | 2017-11-17 17:32:12 +0000 | [diff] [blame] | 281 | "linker/index_bss_mapping_encoder_test.cc", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 282 | "linker/multi_oat_relative_patcher_test.cc", |
| 283 | "linker/oat_writer_test.cc", |
Mathieu Chartier | f70fe3d | 2017-06-21 15:24:02 -0700 | [diff] [blame] | 284 | ], |
Vladimir Marko | 6d66fcf | 2018-04-12 13:15:27 +0100 | [diff] [blame^] | 285 | |
| 286 | codegen: { |
| 287 | arm: { |
| 288 | srcs: [ |
| 289 | "linker/arm/relative_patcher_thumb2_test.cc", |
| 290 | ], |
| 291 | }, |
| 292 | arm64: { |
| 293 | srcs: [ |
| 294 | "linker/arm64/relative_patcher_arm64_test.cc", |
| 295 | ], |
| 296 | }, |
| 297 | mips: { |
| 298 | srcs: [ |
| 299 | "linker/mips/relative_patcher_mips_test.cc", |
| 300 | "linker/mips/relative_patcher_mips32r6_test.cc", |
| 301 | ], |
| 302 | }, |
| 303 | mips64: { |
| 304 | srcs: [ |
| 305 | "linker/mips64/relative_patcher_mips64_test.cc", |
| 306 | ], |
| 307 | }, |
| 308 | x86: { |
| 309 | srcs: [ |
| 310 | "linker/x86/relative_patcher_x86_test.cc", |
| 311 | ], |
| 312 | }, |
| 313 | x86_64: { |
| 314 | srcs: [ |
| 315 | "linker/x86_64/relative_patcher_x86_64_test.cc", |
| 316 | ], |
| 317 | }, |
| 318 | }, |
| 319 | |
Andreas Gampe | f788297 | 2017-03-20 16:35:24 -0700 | [diff] [blame] | 320 | header_libs: ["dex2oat_headers"], |
Andreas Gampe | 238e8fc | 2017-11-01 17:10:10 -0700 | [diff] [blame] | 321 | include_dirs: [ |
| 322 | "external/zlib", |
| 323 | ], |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 324 | shared_libs: [ |
| 325 | "libartd-compiler", |
| 326 | "libartd-dexlayout", |
| 327 | "libbase", |
| 328 | "liblz4", |
| 329 | "libsigchain", |
Mathieu Chartier | 792111c | 2018-02-15 13:02:15 -0800 | [diff] [blame] | 330 | "libziparchive", |
Vladimir Marko | 7452797 | 2016-11-29 15:57:32 +0000 | [diff] [blame] | 331 | ], |
| 332 | static_libs: [ |
| 333 | "libartd-dex2oat", |
Dan Willemsen | 2ca2780 | 2017-09-27 14:57:43 -0700 | [diff] [blame] | 334 | ], |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 335 | } |