blob: c9125df8f4e5a59d6e75ad9104254ea1cc0cb542 [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 ],
42 export_include_dirs: ["."],
43
44 // For SHA-1 checksumming of build ID
45 static: {
46 whole_static_libs: ["libcrypto"],
47 },
48 shared: {
49 shared_libs: ["libcrypto"],
50 },
51}
52
53gensrcs {
54 name: "art_dex2oat_operator_srcs",
55 cmd: "$(location generate-operator-out.py) art/dex2oat $(in) > $(out)",
56 tool_files: ["generate-operator-out.py"],
57 srcs: [
58 "linker/image_writer.h",
59 ],
60 output_extension: "operator_out.cc",
61}
62
63art_cc_static_library {
64 name: "libart-dex2oat",
65 defaults: ["libart-dex2oat-defaults"],
66 shared_libs: [
67 "libart-compiler",
Dan Willemsen2ca27802017-09-27 14:57:43 -070068 "libart",
Vladimir Marko74527972016-11-29 15:57:32 +000069 ],
70}
71
72art_cc_static_library {
73 name: "libartd-dex2oat",
74 defaults: [
75 "art_debug_defaults",
76 "libart-dex2oat-defaults",
77 ],
78 shared_libs: [
79 "libartd-compiler",
Dan Willemsen2ca27802017-09-27 14:57:43 -070080 "libartd",
Vladimir Marko74527972016-11-29 15:57:32 +000081 ],
82}
83
Andreas Gampe7b565912017-03-20 15:48:52 -070084cc_library_headers {
85 name: "dex2oat_headers",
86 host_supported: true,
87 export_include_dirs: ["include"],
88}
89
Colin Crossc7376e02016-09-08 12:52:18 -070090cc_defaults {
91 name: "dex2oat-defaults",
92 host_supported: true,
93 defaults: ["art_defaults"],
94 srcs: ["dex2oat.cc"],
95
96 target: {
97 android: {
98 // Use the 32-bit version of dex2oat on devices
99 compile_multilib: "prefer32",
Colin Crossc7376e02016-09-08 12:52:18 -0700100 },
Colin Crossc7376e02016-09-08 12:52:18 -0700101 },
102
Andreas Gampe3157fc22017-08-23 09:43:46 -0700103 header_libs: [
104 "dex2oat_headers",
105 "art_cmdlineparser_headers",
Colin Crossc7376e02016-09-08 12:52:18 -0700106 ],
107}
108
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100109art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700110 name: "dex2oat",
111 defaults: [
112 "dex2oat-defaults",
113 ],
114 shared_libs: [
Colin Crossc7376e02016-09-08 12:52:18 -0700115 "libart-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000116 "libart-dexlayout",
117 "libart",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700118 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +0000119 "liblz4",
Colin Crossc7376e02016-09-08 12:52:18 -0700120 "libsigchain",
121 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000122 static_libs: [
123 "libart-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700124 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700125}
126
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100127art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700128 name: "dex2oatd",
129 defaults: [
130 "art_debug_defaults",
131 "dex2oat-defaults",
132 ],
133 shared_libs: [
Colin Crossc7376e02016-09-08 12:52:18 -0700134 "libartd-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000135 "libartd-dexlayout",
136 "libartd",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700137 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +0000138 "liblz4",
Colin Crossc7376e02016-09-08 12:52:18 -0700139 "libsigchain",
140 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000141 static_libs: [
142 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700143 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700144}
145
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100146art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700147 name: "dex2oats",
148 device_supported: false,
149 static_executable: true,
150 defaults: ["dex2oat-defaults"],
Colin Crossaa63aa22016-09-13 14:07:00 -0700151 target: {
152 darwin: {
153 enabled: false,
154 },
155 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700156 ldflags: [
157 // We need this because GC stress mode makes use of
158 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
159 // defined in libgcc_eh.a(unwind-dw2.o)
160 // TODO: Having this is not ideal as it might obscure errors.
161 // Try to get rid of it.
162 "-z muldefs",
163 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700164 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000165 "libart-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700166 "libart-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700167 "libart-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700168 "libart",
169 "libvixl-arm",
170 "libvixl-arm64",
171 ] + art_static_dependencies,
172}
173
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100174art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700175 name: "dex2oatds",
176 device_supported: false,
177 static_executable: true,
178 defaults: [
179 "art_debug_defaults",
180 "dex2oat-defaults",
181 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700182 target: {
183 darwin: {
184 enabled: false,
185 },
186 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700187 ldflags: [
188 // We need this because GC stress mode makes use of
189 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
190 // defined in libgcc_eh.a(unwind-dw2.o)
191 // TODO: Having this is not ideal as it might obscure errors.
192 // Try to get rid of it.
193 "-z muldefs",
194 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700195 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000196 "libartd-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700197 "libartd-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700198 "libartd-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700199 "libartd",
200 "libvixld-arm",
201 "libvixld-arm64",
202 ] + art_static_dependencies,
203}
Colin Cross6e95dd52016-09-12 15:37:10 -0700204
205art_cc_test {
206 name: "art_dex2oat_tests",
207 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700208 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700209 ],
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700210 srcs: [
211 "dex2oat_test.cc",
212 "dex2oat_image_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000213 "linker/elf_writer_test.cc",
214 "linker/image_test.cc",
215 "linker/image_write_read_test.cc",
216 "linker/multi_oat_relative_patcher_test.cc",
217 "linker/oat_writer_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700218 ],
Andreas Gampef7882972017-03-20 16:35:24 -0700219 header_libs: ["dex2oat_headers"],
Vladimir Marko74527972016-11-29 15:57:32 +0000220 shared_libs: [
221 "libartd-compiler",
222 "libartd-dexlayout",
223 "libbase",
224 "liblz4",
225 "libsigchain",
226 ],
227 static_libs: [
228 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700229 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700230}