blob: dd16ba4909a717c69b5c5c9247fbbaa15630905e [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: [
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 Marko74527972016-11-29 15:57:32 +000029 android: {
30 // For atrace.
31 shared_libs: ["libcutils"],
32 },
33 },
34 generated_sources: ["art_dex2oat_operator_srcs"],
35 shared_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +000036 "libbase",
37 "liblz4",
38 "liblzma",
39 ],
Andreas Gampef24dfb02017-11-01 15:41:25 -070040 include_dirs: [
41 "external/lz4/lib",
Andreas Gampe238e8fc2017-11-01 17:10:10 -070042 "external/zlib",
Andreas Gampef24dfb02017-11-01 15:41:25 -070043 ],
Vladimir Marko74527972016-11-29 15:57:32 +000044 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
55gensrcs {
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
65art_cc_static_library {
66 name: "libart-dex2oat",
67 defaults: ["libart-dex2oat-defaults"],
68 shared_libs: [
69 "libart-compiler",
Andreas Gampe772bd2f2018-01-26 12:56:22 -080070 "libart-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -070071 "libart",
Vladimir Marko74527972016-11-29 15:57:32 +000072 ],
73}
74
75art_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 Gampe772bd2f2018-01-26 12:56:22 -080083 "libartd-dexlayout",
Dan Willemsen2ca27802017-09-27 14:57:43 -070084 "libartd",
Vladimir Marko74527972016-11-29 15:57:32 +000085 ],
86}
87
Andreas Gampe7b565912017-03-20 15:48:52 -070088cc_library_headers {
89 name: "dex2oat_headers",
90 host_supported: true,
91 export_include_dirs: ["include"],
92}
93
Colin Crossc7376e02016-09-08 12:52:18 -070094cc_defaults {
95 name: "dex2oat-defaults",
96 host_supported: true,
97 defaults: ["art_defaults"],
Andreas Gampe097f34c2017-08-23 08:57:51 -070098 srcs: [
99 "dex2oat_options.cc",
100 "dex2oat.cc",
101 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700102
103 target: {
104 android: {
105 // Use the 32-bit version of dex2oat on devices
106 compile_multilib: "prefer32",
Colin Crossc7376e02016-09-08 12:52:18 -0700107 },
Colin Crossc7376e02016-09-08 12:52:18 -0700108 },
Andreas Gampe3157fc22017-08-23 09:43:46 -0700109 header_libs: [
110 "dex2oat_headers",
111 "art_cmdlineparser_headers",
Colin Crossc7376e02016-09-08 12:52:18 -0700112 ],
113}
114
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100115art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700116 name: "dex2oat",
117 defaults: [
118 "dex2oat-defaults",
119 ],
120 shared_libs: [
Colin Crossc7376e02016-09-08 12:52:18 -0700121 "libart-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000122 "libart-dexlayout",
123 "libart",
David Sehr0225f8e2018-01-31 08:52:24 +0000124 "libdexfile",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700125 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +0000126 "liblz4",
Colin Crossc7376e02016-09-08 12:52:18 -0700127 "libsigchain",
128 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000129 static_libs: [
130 "libart-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700131 ],
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800132
133 pgo: {
134 instrumentation: true,
Pirama Arumuga Nainarc89013c2018-01-18 12:35:40 -0800135 profile_file: "art/dex2oat.profdata",
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800136 benchmarks: ["dex2oat"],
Pirama Arumuga Nainar02f6ed62018-01-04 10:52:42 -0800137 cflags: [
138 // Ignore frame-size increase resulting from instrumentation.
139 "-Wno-frame-larger-than=",
140 "-DART_PGO_INSTRUMENTATION",
141 ],
142 }
Colin Crossc7376e02016-09-08 12:52:18 -0700143}
144
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100145art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700146 name: "dex2oatd",
147 defaults: [
148 "art_debug_defaults",
149 "dex2oat-defaults",
150 ],
151 shared_libs: [
Colin Crossc7376e02016-09-08 12:52:18 -0700152 "libartd-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000153 "libartd-dexlayout",
154 "libartd",
David Sehrfcbe15c2018-02-15 09:41:13 -0800155 "libdexfiled",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700156 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +0000157 "liblz4",
Colin Crossc7376e02016-09-08 12:52:18 -0700158 "libsigchain",
159 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000160 static_libs: [
161 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700162 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700163}
164
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100165art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700166 name: "dex2oats",
167 device_supported: false,
168 static_executable: true,
169 defaults: ["dex2oat-defaults"],
Colin Crossaa63aa22016-09-13 14:07:00 -0700170 target: {
171 darwin: {
172 enabled: false,
173 },
174 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700175 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 Crossc7376e02016-09-08 12:52:18 -0700183 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000184 "libart-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700185 "libart-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700186 "libart-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700187 "libart",
David Sehrfcbe15c2018-02-15 09:41:13 -0800188 "libdexfile",
Colin Crossc7376e02016-09-08 12:52:18 -0700189 "libvixl-arm",
190 "libvixl-arm64",
191 ] + art_static_dependencies,
192}
193
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100194art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700195 name: "dex2oatds",
196 device_supported: false,
197 static_executable: true,
198 defaults: [
199 "art_debug_defaults",
200 "dex2oat-defaults",
201 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700202 target: {
203 darwin: {
204 enabled: false,
205 },
206 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700207 ldflags: [
208 // We need this because GC stress mode makes use of
209 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
210 // defined in libgcc_eh.a(unwind-dw2.o)
211 // TODO: Having this is not ideal as it might obscure errors.
212 // Try to get rid of it.
213 "-z muldefs",
214 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700215 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000216 "libartd-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700217 "libartd-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700218 "libartd-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700219 "libartd",
David Sehrfcbe15c2018-02-15 09:41:13 -0800220 "libdexfiled",
Colin Crossc7376e02016-09-08 12:52:18 -0700221 "libvixld-arm",
222 "libvixld-arm64",
223 ] + art_static_dependencies,
224}
Colin Cross6e95dd52016-09-12 15:37:10 -0700225
226art_cc_test {
227 name: "art_dex2oat_tests",
228 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700229 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700230 ],
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700231 srcs: [
232 "dex2oat_test.cc",
233 "dex2oat_image_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000234 "linker/elf_writer_test.cc",
235 "linker/image_test.cc",
236 "linker/image_write_read_test.cc",
Vladimir Markof3c52b42017-11-17 17:32:12 +0000237 "linker/index_bss_mapping_encoder_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000238 "linker/multi_oat_relative_patcher_test.cc",
239 "linker/oat_writer_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700240 ],
Andreas Gampef7882972017-03-20 16:35:24 -0700241 header_libs: ["dex2oat_headers"],
Andreas Gampe238e8fc2017-11-01 17:10:10 -0700242 include_dirs: [
243 "external/zlib",
244 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000245 shared_libs: [
246 "libartd-compiler",
247 "libartd-dexlayout",
248 "libbase",
249 "liblz4",
250 "libsigchain",
251 ],
252 static_libs: [
253 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700254 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700255}