blob: ab06ddda2d18339a15aaebd00aea4fd5c9d229a6 [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 Sehr0225f8e2018-01-31 08:52:24 +0000155 "libdexfile",
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",
188 "libvixl-arm",
189 "libvixl-arm64",
190 ] + art_static_dependencies,
191}
192
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100193art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700194 name: "dex2oatds",
195 device_supported: false,
196 static_executable: true,
197 defaults: [
198 "art_debug_defaults",
199 "dex2oat-defaults",
200 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700201 target: {
202 darwin: {
203 enabled: false,
204 },
205 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700206 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 Crossc7376e02016-09-08 12:52:18 -0700214 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000215 "libartd-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700216 "libartd-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700217 "libartd-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700218 "libartd",
219 "libvixld-arm",
220 "libvixld-arm64",
221 ] + art_static_dependencies,
222}
Colin Cross6e95dd52016-09-12 15:37:10 -0700223
224art_cc_test {
225 name: "art_dex2oat_tests",
226 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700227 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700228 ],
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700229 srcs: [
230 "dex2oat_test.cc",
231 "dex2oat_image_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000232 "linker/elf_writer_test.cc",
233 "linker/image_test.cc",
234 "linker/image_write_read_test.cc",
Vladimir Markof3c52b42017-11-17 17:32:12 +0000235 "linker/index_bss_mapping_encoder_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000236 "linker/multi_oat_relative_patcher_test.cc",
237 "linker/oat_writer_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700238 ],
Andreas Gampef7882972017-03-20 16:35:24 -0700239 header_libs: ["dex2oat_headers"],
Andreas Gampe238e8fc2017-11-01 17:10:10 -0700240 include_dirs: [
241 "external/zlib",
242 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000243 shared_libs: [
244 "libartd-compiler",
245 "libartd-dexlayout",
246 "libbase",
247 "liblz4",
248 "libsigchain",
249 ],
250 static_libs: [
251 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700252 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700253}