blob: 9876febfc54b4b5225d3ed466ba77a5629205ae9 [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 },
109
Andreas Gampe3157fc22017-08-23 09:43:46 -0700110 header_libs: [
111 "dex2oat_headers",
112 "art_cmdlineparser_headers",
Colin Crossc7376e02016-09-08 12:52:18 -0700113 ],
114}
115
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100116art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700117 name: "dex2oat",
118 defaults: [
119 "dex2oat-defaults",
120 ],
121 shared_libs: [
Colin Crossc7376e02016-09-08 12:52:18 -0700122 "libart-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000123 "libart-dexlayout",
124 "libart",
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",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700155 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +0000156 "liblz4",
Colin Crossc7376e02016-09-08 12:52:18 -0700157 "libsigchain",
158 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000159 static_libs: [
160 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700161 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700162}
163
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100164art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700165 name: "dex2oats",
166 device_supported: false,
167 static_executable: true,
168 defaults: ["dex2oat-defaults"],
Colin Crossaa63aa22016-09-13 14:07:00 -0700169 target: {
170 darwin: {
171 enabled: false,
172 },
173 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700174 ldflags: [
175 // We need this because GC stress mode makes use of
176 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
177 // defined in libgcc_eh.a(unwind-dw2.o)
178 // TODO: Having this is not ideal as it might obscure errors.
179 // Try to get rid of it.
180 "-z muldefs",
181 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700182 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000183 "libart-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700184 "libart-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700185 "libart-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700186 "libart",
187 "libvixl-arm",
188 "libvixl-arm64",
189 ] + art_static_dependencies,
190}
191
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100192art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700193 name: "dex2oatds",
194 device_supported: false,
195 static_executable: true,
196 defaults: [
197 "art_debug_defaults",
198 "dex2oat-defaults",
199 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700200 target: {
201 darwin: {
202 enabled: false,
203 },
204 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700205 ldflags: [
206 // We need this because GC stress mode makes use of
207 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
208 // defined in libgcc_eh.a(unwind-dw2.o)
209 // TODO: Having this is not ideal as it might obscure errors.
210 // Try to get rid of it.
211 "-z muldefs",
212 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700213 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000214 "libartd-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700215 "libartd-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700216 "libartd-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700217 "libartd",
218 "libvixld-arm",
219 "libvixld-arm64",
220 ] + art_static_dependencies,
221}
Colin Cross6e95dd52016-09-12 15:37:10 -0700222
223art_cc_test {
224 name: "art_dex2oat_tests",
225 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700226 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700227 ],
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700228 srcs: [
229 "dex2oat_test.cc",
230 "dex2oat_image_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000231 "linker/elf_writer_test.cc",
232 "linker/image_test.cc",
233 "linker/image_write_read_test.cc",
Vladimir Markof3c52b42017-11-17 17:32:12 +0000234 "linker/index_bss_mapping_encoder_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000235 "linker/multi_oat_relative_patcher_test.cc",
236 "linker/oat_writer_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700237 ],
Andreas Gampef7882972017-03-20 16:35:24 -0700238 header_libs: ["dex2oat_headers"],
Andreas Gampe238e8fc2017-11-01 17:10:10 -0700239 include_dirs: [
240 "external/zlib",
241 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000242 shared_libs: [
243 "libartd-compiler",
244 "libartd-dexlayout",
245 "libbase",
246 "liblz4",
247 "libsigchain",
248 ],
249 static_libs: [
250 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700251 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700252}