blob: 74df162d4b1833a15736363c575ca8f461c10520 [file] [log] [blame]
Colin Crossc7376e02016-09-08 12:52:18 -07001//
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 Marko74527972016-11-29 15:57:32 +000017art_cc_defaults {
18 name: "libart-dex2oat-defaults",
19 defaults: ["art_defaults"],
20 host_supported: true,
Vladimir Marko74527972016-11-29 15:57:32 +000021 srcs: [
Vladimir Marko327497e2019-03-04 12:53:20 +000022 "dex/dex_to_dex_compiler.cc",
23 "dex/quick_compiler_callbacks.cc",
24 "driver/compiler_driver.cc",
Vladimir Marko74527972016-11-29 15:57:32 +000025 "linker/elf_writer.cc",
26 "linker/elf_writer_quick.cc",
27 "linker/image_writer.cc",
28 "linker/multi_oat_relative_patcher.cc",
29 "linker/oat_writer.cc",
Vladimir Marko6d66fcf2018-04-12 13:15:27 +010030 "linker/relative_patcher.cc",
Vladimir Marko74527972016-11-29 15:57:32 +000031 ],
Vladimir Marko6d66fcf2018-04-12 13:15:27 +010032
33 codegen: {
34 arm: {
35 srcs: [
36 "linker/arm/relative_patcher_arm_base.cc",
37 "linker/arm/relative_patcher_thumb2.cc",
38 ],
39 },
40 arm64: {
41 srcs: [
42 "linker/arm64/relative_patcher_arm64.cc",
43 ],
44 },
45 mips: {
46 srcs: [
47 "linker/mips/relative_patcher_mips.cc",
48 ],
49 },
50 mips64: {
51 srcs: [
52 "linker/mips64/relative_patcher_mips64.cc",
53 ],
54 },
55 x86: {
56 srcs: [
57 "linker/x86/relative_patcher_x86.cc",
58 "linker/x86/relative_patcher_x86_base.cc",
59 ],
60 },
61 x86_64: {
62 srcs: [
63 "linker/x86_64/relative_patcher_x86_64.cc",
64 ],
65 },
66 },
67
Vladimir Marko74527972016-11-29 15:57:32 +000068 target: {
Vladimir Marko74527972016-11-29 15:57:32 +000069 android: {
Vladimir Markoc10a0c62018-11-16 11:39:22 +000070 static_libs: [
71 "libz",
72 ],
73 },
74 host: {
75 shared_libs: [
76 "libz",
77 ],
Vladimir Marko74527972016-11-29 15:57:32 +000078 },
79 },
80 generated_sources: ["art_dex2oat_operator_srcs"],
81 shared_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +000082 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +000083 ],
84 export_include_dirs: ["."],
85
86 // For SHA-1 checksumming of build ID
87 static: {
88 whole_static_libs: ["libcrypto"],
89 },
90 shared: {
91 shared_libs: ["libcrypto"],
92 },
93}
94
Andreas Gampeec5ed062018-01-26 16:20:02 -080095cc_defaults {
96 name: "libart-dex2oat_static_base_defaults",
Andreas Gampeec5ed062018-01-26 16:20:02 -080097 static_libs: [
98 "libbase",
Vladimir Markoc10a0c62018-11-16 11:39:22 +000099 "libz",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800100 ],
101}
102
Vladimir Marko74527972016-11-29 15:57:32 +0000103gensrcs {
104 name: "art_dex2oat_operator_srcs",
Alex Lightb69d2d32018-02-21 13:37:17 -0800105 cmd: "$(location generate_operator_out) art/dex2oat $(in) > $(out)",
106 tools: ["generate_operator_out"],
Vladimir Marko74527972016-11-29 15:57:32 +0000107 srcs: [
Vladimir Marko327497e2019-03-04 12:53:20 +0000108 "dex/dex_to_dex_compiler.h",
109 "driver/compiler_driver.h",
Vladimir Marko74527972016-11-29 15:57:32 +0000110 "linker/image_writer.h",
111 ],
112 output_extension: "operator_out.cc",
113}
114
Steven Moreland73030ed2019-01-03 14:23:28 -0800115art_cc_library_static {
Vladimir Marko74527972016-11-29 15:57:32 +0000116 name: "libart-dex2oat",
117 defaults: ["libart-dex2oat-defaults"],
118 shared_libs: [
119 "libart-compiler",
Andreas Gampe772bd2f2018-01-26 12:56:22 -0800120 "libart-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700121 "libart",
Vladimir Marko327497e2019-03-04 12:53:20 +0000122 "libartpalette",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700123 "libprofile",
Vladimir Marko74527972016-11-29 15:57:32 +0000124 ],
125}
126
Andreas Gampeec5ed062018-01-26 16:20:02 -0800127cc_defaults {
128 name: "libart-dex2oat_static_defaults",
129 defaults: [
130 "libart-dex2oat_static_base_defaults",
131 "libart_static_defaults",
132 "libprofile_static_defaults",
133 ],
134 static_libs: [
135 "libart-compiler",
136 "libart-dexlayout",
137 "libart-dex2oat",
138 ],
139}
140
Steven Moreland73030ed2019-01-03 14:23:28 -0800141art_cc_library_static {
Vladimir Marko74527972016-11-29 15:57:32 +0000142 name: "libartd-dex2oat",
143 defaults: [
144 "art_debug_defaults",
145 "libart-dex2oat-defaults",
146 ],
147 shared_libs: [
148 "libartd-compiler",
Andreas Gampe772bd2f2018-01-26 12:56:22 -0800149 "libartd-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700150 "libartd",
Vladimir Marko327497e2019-03-04 12:53:20 +0000151 "libartpalette",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700152 "libprofiled",
Vladimir Marko74527972016-11-29 15:57:32 +0000153 ],
154}
155
Andreas Gampeec5ed062018-01-26 16:20:02 -0800156cc_defaults {
157 name: "libartd-dex2oat_static_defaults",
158 defaults: [
159 "libart-dex2oat_static_base_defaults",
160 "libartd_static_defaults",
161 "libprofiled_static_defaults",
162 ],
163 static_libs: [
164 "libartd-compiler",
165 "libartd-dexlayout",
166 "libartd-dex2oat",
167 ],
168}
169
Andreas Gampe7b565912017-03-20 15:48:52 -0700170cc_library_headers {
171 name: "dex2oat_headers",
172 host_supported: true,
173 export_include_dirs: ["include"],
174}
175
Colin Crossc7376e02016-09-08 12:52:18 -0700176cc_defaults {
177 name: "dex2oat-defaults",
178 host_supported: true,
179 defaults: ["art_defaults"],
Andreas Gampe097f34c2017-08-23 08:57:51 -0700180 srcs: [
181 "dex2oat_options.cc",
182 "dex2oat.cc",
183 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700184
185 target: {
186 android: {
Roland Levillain38a938e2018-09-21 10:55:51 +0100187 // Use the 32-bit version of dex2oat on devices.
Colin Crossc7376e02016-09-08 12:52:18 -0700188 compile_multilib: "prefer32",
Colin Crossc7376e02016-09-08 12:52:18 -0700189 },
Colin Crossc7376e02016-09-08 12:52:18 -0700190 },
Andreas Gampe3157fc22017-08-23 09:43:46 -0700191 header_libs: [
192 "dex2oat_headers",
193 "art_cmdlineparser_headers",
Colin Crossc7376e02016-09-08 12:52:18 -0700194 ],
195}
196
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700197cc_defaults {
198 name: "dex2oat-pgo-defaults",
199 pgo: {
200 instrumentation: true,
201 benchmarks: ["dex2oat"],
202 },
203 target: {
204 android_arm64: {
205 pgo: {
206 profile_file: "art/dex2oat_arm_arm64.profdata",
207 },
208 },
209 android_arm: {
210 pgo: {
211 profile_file: "art/dex2oat_arm_arm64.profdata",
212 },
213 },
214 android_x86_64: {
215 pgo: {
216 profile_file: "art/dex2oat_x86_x86_64.profdata",
217 },
218 },
219 android_x86: {
220 pgo: {
221 profile_file: "art/dex2oat_x86_x86_64.profdata",
222 },
223 },
Pirama Arumuga Nainarfc1de872018-04-20 14:11:12 -0700224 android_mips64: {
225 pgo: {
226 profile_file: "art/dex2oat_mips_mips64.profdata",
227 },
228 },
229 android_mips: {
230 pgo: {
231 profile_file: "art/dex2oat_mips_mips64.profdata",
232 },
233 },
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700234 },
235}
236
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100237art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700238 name: "dex2oat",
239 defaults: [
240 "dex2oat-defaults",
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700241 "dex2oat-pgo-defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700242 ],
243 shared_libs: [
David Sehr82d046e2018-04-23 08:14:19 -0700244 "libprofile",
Colin Crossc7376e02016-09-08 12:52:18 -0700245 "libart-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000246 "libart-dexlayout",
247 "libart",
David Sehr0225f8e2018-01-31 08:52:24 +0000248 "libdexfile",
David Sehr1f010162018-05-15 08:59:32 -0700249 "libartbase",
Vladimir Marko327497e2019-03-04 12:53:20 +0000250 "libartpalette",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700251 "libbase",
Colin Crossc7376e02016-09-08 12:52:18 -0700252 "libsigchain",
253 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000254 static_libs: [
255 "libart-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700256 ],
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800257
258 pgo: {
Pirama Arumuga Nainar42d58052018-04-18 22:59:36 -0700259 // Additional cflags just for dex2oat during PGO instrumentation
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800260 cflags: [
261 // Ignore frame-size increase resulting from instrumentation.
262 "-Wno-frame-larger-than=",
263 "-DART_PGO_INSTRUMENTATION",
264 ],
Yi Kong1d894d92018-01-19 22:01:14 -0800265 },
266 target: {
267 android: {
268 lto: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700269 thin: true,
Yi Kong1d894d92018-01-19 22:01:14 -0800270 },
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000271 static_libs: [
272 "libz",
273 ],
274 },
275 host: {
276 shared_libs: [
277 "libz",
278 ],
Yi Kong1d894d92018-01-19 22:01:14 -0800279 },
280 },
Colin Crossc7376e02016-09-08 12:52:18 -0700281}
282
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100283art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700284 name: "dex2oatd",
285 defaults: [
286 "art_debug_defaults",
287 "dex2oat-defaults",
288 ],
289 shared_libs: [
David Sehr82d046e2018-04-23 08:14:19 -0700290 "libprofiled",
Colin Crossc7376e02016-09-08 12:52:18 -0700291 "libartd-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000292 "libartd-dexlayout",
293 "libartd",
David Sehrfcbe15c2018-02-15 09:41:13 -0800294 "libdexfiled",
David Sehr1f010162018-05-15 08:59:32 -0700295 "libartbased",
Vladimir Marko327497e2019-03-04 12:53:20 +0000296 "libartpalette",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700297 "libbase",
Colin Crossc7376e02016-09-08 12:52:18 -0700298 "libsigchain",
299 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000300 static_libs: [
301 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700302 ],
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000303 target: {
304 android: {
305 static_libs: [
306 "libz",
307 ],
308 },
309 host: {
310 shared_libs: [
311 "libz",
312 ],
Alex Light907001d2019-01-17 00:16:04 +0000313 compile_multilib: "both",
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000314 },
315 },
Alex Light907001d2019-01-17 00:16:04 +0000316
317 multilib: {
318 lib32: {
319 suffix: "32",
320 },
321 lib64: {
322 suffix: "64",
323 },
324 },
325
326 symlink_preferred_arch: true,
Colin Crossc7376e02016-09-08 12:52:18 -0700327}
328
Andreas Gampe11bf2652018-07-10 14:21:15 -0700329cc_defaults {
330 name: "dex2oats-defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700331 device_supported: false,
332 static_executable: true,
Andreas Gampeec5ed062018-01-26 16:20:02 -0800333 defaults: [
334 "dex2oat-defaults",
335 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700336 target: {
337 darwin: {
338 enabled: false,
339 },
340 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700341 ldflags: [
342 // We need this because GC stress mode makes use of
343 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
344 // defined in libgcc_eh.a(unwind-dw2.o)
345 // TODO: Having this is not ideal as it might obscure errors.
346 // Try to get rid of it.
347 "-z muldefs",
348 ],
Andreas Gampeec5ed062018-01-26 16:20:02 -0800349 static_libs: [
350 "libbase",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800351 "libsigchain_dummy",
Vladimir Markoc10a0c62018-11-16 11:39:22 +0000352 "libz",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800353 ],
Andreas Gampe11bf2652018-07-10 14:21:15 -0700354}
355
356art_cc_binary {
357 name: "dex2oats",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800358 defaults: [
359 "dex2oats-defaults",
360 "libart_static_defaults",
361 "libart-compiler_static_defaults",
362 "libart-dexlayout_static_defaults",
363 "libartbase_static_defaults",
364 "libdexfile_static_defaults",
365 "libprofile_static_defaults",
366 "libart-dex2oat_static_defaults",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700367 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700368}
369
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100370art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700371 name: "dex2oatds",
Colin Crossc7376e02016-09-08 12:52:18 -0700372 defaults: [
373 "art_debug_defaults",
Andreas Gampe11bf2652018-07-10 14:21:15 -0700374 "dex2oats-defaults",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800375 "libartd_static_defaults",
376 "libartd-compiler_static_defaults",
377 "libartd-dexlayout_static_defaults",
378 "libartbased_static_defaults",
379 "libdexfiled_static_defaults",
380 "libprofiled_static_defaults",
381 "libartd-dex2oat_static_defaults",
Colin Crossc7376e02016-09-08 12:52:18 -0700382 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700383 target: {
Pirama Arumuga Nainar6f5b4d22018-04-20 12:02:02 -0700384 linux_glibc_x86_64: {
385 use_clang_lld: true,
386 },
Colin Crossaa63aa22016-09-13 14:07:00 -0700387 },
Colin Crossc7376e02016-09-08 12:52:18 -0700388}
Colin Cross6e95dd52016-09-12 15:37:10 -0700389
Vladimir Marko327497e2019-03-04 12:53:20 +0000390art_cc_library_static {
391 name: "libart-dex2oat-gtest",
392 defaults: ["libart-gtest-defaults"],
393 srcs: [
394 "common_compiler_driver_test.cc",
395 ],
396 shared_libs: [
397 "libartd-compiler",
398 "libartd-disassembler",
399 "libart-compiler-gtest",
400 "libart-runtime-gtest",
401 "libbase",
402 ],
403 static_libs: [
404 "libartd-dex2oat",
405 ],
406}
407
Colin Cross6e95dd52016-09-12 15:37:10 -0700408art_cc_test {
409 name: "art_dex2oat_tests",
410 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700411 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700412 ],
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700413 srcs: [
414 "dex2oat_test.cc",
415 "dex2oat_image_test.cc",
Vladimir Marko327497e2019-03-04 12:53:20 +0000416 "dex/dex_to_dex_decompiler_test.cc",
417 "driver/compiler_driver_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000418 "linker/elf_writer_test.cc",
419 "linker/image_test.cc",
420 "linker/image_write_read_test.cc",
Vladimir Markof3c52b42017-11-17 17:32:12 +0000421 "linker/index_bss_mapping_encoder_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000422 "linker/multi_oat_relative_patcher_test.cc",
423 "linker/oat_writer_test.cc",
Vladimir Marko327497e2019-03-04 12:53:20 +0000424 "verifier_deps_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700425 ],
Vladimir Marko6d66fcf2018-04-12 13:15:27 +0100426
427 codegen: {
428 arm: {
429 srcs: [
430 "linker/arm/relative_patcher_thumb2_test.cc",
431 ],
432 },
433 arm64: {
434 srcs: [
435 "linker/arm64/relative_patcher_arm64_test.cc",
436 ],
437 },
438 mips: {
439 srcs: [
440 "linker/mips/relative_patcher_mips_test.cc",
441 "linker/mips/relative_patcher_mips32r6_test.cc",
442 ],
443 },
444 mips64: {
445 srcs: [
446 "linker/mips64/relative_patcher_mips64_test.cc",
447 ],
448 },
449 x86: {
450 srcs: [
451 "linker/x86/relative_patcher_x86_test.cc",
452 ],
453 },
454 x86_64: {
455 srcs: [
456 "linker/x86_64/relative_patcher_x86_64_test.cc",
457 ],
458 },
459 },
460
Andreas Gampef7882972017-03-20 16:35:24 -0700461 header_libs: ["dex2oat_headers"],
Vladimir Marko74527972016-11-29 15:57:32 +0000462 shared_libs: [
Martin Stjernholm43551622018-11-09 15:14:54 +0000463 "libartbased",
Vladimir Marko74527972016-11-29 15:57:32 +0000464 "libartd-compiler",
465 "libartd-dexlayout",
Vladimir Marko327497e2019-03-04 12:53:20 +0000466 "libartpalette",
Vladimir Marko74527972016-11-29 15:57:32 +0000467 "libbase",
Martin Stjernholm43551622018-11-09 15:14:54 +0000468 "libprofiled",
Vladimir Marko74527972016-11-29 15:57:32 +0000469 "libsigchain",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000470 "libziparchive",
Vladimir Marko74527972016-11-29 15:57:32 +0000471 ],
472 static_libs: [
Vladimir Marko327497e2019-03-04 12:53:20 +0000473 "libart-dex2oat-gtest",
Vladimir Marko74527972016-11-29 15:57:32 +0000474 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700475 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700476}