blob: 6bebf7d2da3086544c52a7663de88c185cbfef1f [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: [
36 "libart-compiler",
37 "libart-dexlayout",
38 "libbase",
39 "liblz4",
40 "liblzma",
41 ],
Andreas Gampef24dfb02017-11-01 15:41:25 -070042 include_dirs: [
43 "external/lz4/lib",
Andreas Gampe238e8fc2017-11-01 17:10:10 -070044 "external/zlib",
Andreas Gampef24dfb02017-11-01 15:41:25 -070045 ],
Vladimir Marko74527972016-11-29 15:57:32 +000046 export_include_dirs: ["."],
47
48 // For SHA-1 checksumming of build ID
49 static: {
50 whole_static_libs: ["libcrypto"],
51 },
52 shared: {
53 shared_libs: ["libcrypto"],
54 },
55}
56
57gensrcs {
58 name: "art_dex2oat_operator_srcs",
59 cmd: "$(location generate-operator-out.py) art/dex2oat $(in) > $(out)",
60 tool_files: ["generate-operator-out.py"],
61 srcs: [
62 "linker/image_writer.h",
63 ],
64 output_extension: "operator_out.cc",
65}
66
67art_cc_static_library {
68 name: "libart-dex2oat",
69 defaults: ["libart-dex2oat-defaults"],
70 shared_libs: [
71 "libart-compiler",
Dan Willemsen2ca27802017-09-27 14:57:43 -070072 "libart",
Vladimir Marko74527972016-11-29 15:57:32 +000073 ],
74}
75
76art_cc_static_library {
77 name: "libartd-dex2oat",
78 defaults: [
79 "art_debug_defaults",
80 "libart-dex2oat-defaults",
81 ],
82 shared_libs: [
83 "libartd-compiler",
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 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700132}
133
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100134art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700135 name: "dex2oatd",
136 defaults: [
137 "art_debug_defaults",
138 "dex2oat-defaults",
139 ],
140 shared_libs: [
Colin Crossc7376e02016-09-08 12:52:18 -0700141 "libartd-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000142 "libartd-dexlayout",
143 "libartd",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700144 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +0000145 "liblz4",
Colin Crossc7376e02016-09-08 12:52:18 -0700146 "libsigchain",
147 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000148 static_libs: [
149 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700150 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700151}
152
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100153art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700154 name: "dex2oats",
155 device_supported: false,
156 static_executable: true,
157 defaults: ["dex2oat-defaults"],
Colin Crossaa63aa22016-09-13 14:07:00 -0700158 target: {
159 darwin: {
160 enabled: false,
161 },
162 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700163 ldflags: [
164 // We need this because GC stress mode makes use of
165 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
166 // defined in libgcc_eh.a(unwind-dw2.o)
167 // TODO: Having this is not ideal as it might obscure errors.
168 // Try to get rid of it.
169 "-z muldefs",
170 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700171 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000172 "libart-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700173 "libart-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700174 "libart-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700175 "libart",
176 "libvixl-arm",
177 "libvixl-arm64",
178 ] + art_static_dependencies,
179}
180
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100181art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700182 name: "dex2oatds",
183 device_supported: false,
184 static_executable: true,
185 defaults: [
186 "art_debug_defaults",
187 "dex2oat-defaults",
188 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700189 target: {
190 darwin: {
191 enabled: false,
192 },
193 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700194 ldflags: [
195 // We need this because GC stress mode makes use of
196 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
197 // defined in libgcc_eh.a(unwind-dw2.o)
198 // TODO: Having this is not ideal as it might obscure errors.
199 // Try to get rid of it.
200 "-z muldefs",
201 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700202 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000203 "libartd-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700204 "libartd-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700205 "libartd-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700206 "libartd",
207 "libvixld-arm",
208 "libvixld-arm64",
209 ] + art_static_dependencies,
210}
Colin Cross6e95dd52016-09-12 15:37:10 -0700211
212art_cc_test {
213 name: "art_dex2oat_tests",
214 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700215 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700216 ],
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700217 srcs: [
218 "dex2oat_test.cc",
219 "dex2oat_image_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000220 "linker/elf_writer_test.cc",
221 "linker/image_test.cc",
222 "linker/image_write_read_test.cc",
Vladimir Markof3c52b42017-11-17 17:32:12 +0000223 "linker/index_bss_mapping_encoder_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000224 "linker/multi_oat_relative_patcher_test.cc",
225 "linker/oat_writer_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700226 ],
Andreas Gampef7882972017-03-20 16:35:24 -0700227 header_libs: ["dex2oat_headers"],
Andreas Gampe238e8fc2017-11-01 17:10:10 -0700228 include_dirs: [
229 "external/zlib",
230 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000231 shared_libs: [
232 "libartd-compiler",
233 "libartd-dexlayout",
234 "libbase",
235 "liblz4",
236 "libsigchain",
237 ],
238 static_libs: [
239 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700240 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700241}