blob: 6b6387817cc9153d1e5a2eba680cfc32e80c2ca9 [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",
44 ],
Vladimir Marko74527972016-11-29 15:57:32 +000045 export_include_dirs: ["."],
46
47 // For SHA-1 checksumming of build ID
48 static: {
49 whole_static_libs: ["libcrypto"],
50 },
51 shared: {
52 shared_libs: ["libcrypto"],
53 },
54}
55
56gensrcs {
57 name: "art_dex2oat_operator_srcs",
58 cmd: "$(location generate-operator-out.py) art/dex2oat $(in) > $(out)",
59 tool_files: ["generate-operator-out.py"],
60 srcs: [
61 "linker/image_writer.h",
62 ],
63 output_extension: "operator_out.cc",
64}
65
66art_cc_static_library {
67 name: "libart-dex2oat",
68 defaults: ["libart-dex2oat-defaults"],
69 shared_libs: [
70 "libart-compiler",
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",
Dan Willemsen2ca27802017-09-27 14:57:43 -070083 "libartd",
Vladimir Marko74527972016-11-29 15:57:32 +000084 ],
85}
86
Andreas Gampe7b565912017-03-20 15:48:52 -070087cc_library_headers {
88 name: "dex2oat_headers",
89 host_supported: true,
90 export_include_dirs: ["include"],
91}
92
Colin Crossc7376e02016-09-08 12:52:18 -070093cc_defaults {
94 name: "dex2oat-defaults",
95 host_supported: true,
96 defaults: ["art_defaults"],
Andreas Gampe097f34c2017-08-23 08:57:51 -070097 srcs: [
98 "dex2oat_options.cc",
99 "dex2oat.cc",
100 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700101
102 target: {
103 android: {
104 // Use the 32-bit version of dex2oat on devices
105 compile_multilib: "prefer32",
Colin Crossc7376e02016-09-08 12:52:18 -0700106 },
Colin Crossc7376e02016-09-08 12:52:18 -0700107 },
108
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",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700124 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +0000125 "liblz4",
Colin Crossc7376e02016-09-08 12:52:18 -0700126 "libsigchain",
127 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000128 static_libs: [
129 "libart-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700130 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700131}
132
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100133art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700134 name: "dex2oatd",
135 defaults: [
136 "art_debug_defaults",
137 "dex2oat-defaults",
138 ],
139 shared_libs: [
Colin Crossc7376e02016-09-08 12:52:18 -0700140 "libartd-compiler",
Vladimir Marko74527972016-11-29 15:57:32 +0000141 "libartd-dexlayout",
142 "libartd",
Andreas Gampe3fec9ac2016-09-13 10:47:28 -0700143 "libbase",
Vladimir Marko74527972016-11-29 15:57:32 +0000144 "liblz4",
Colin Crossc7376e02016-09-08 12:52:18 -0700145 "libsigchain",
146 ],
Vladimir Marko74527972016-11-29 15:57:32 +0000147 static_libs: [
148 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700149 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700150}
151
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100152art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700153 name: "dex2oats",
154 device_supported: false,
155 static_executable: true,
156 defaults: ["dex2oat-defaults"],
Colin Crossaa63aa22016-09-13 14:07:00 -0700157 target: {
158 darwin: {
159 enabled: false,
160 },
161 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700162 ldflags: [
163 // We need this because GC stress mode makes use of
164 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
165 // defined in libgcc_eh.a(unwind-dw2.o)
166 // TODO: Having this is not ideal as it might obscure errors.
167 // Try to get rid of it.
168 "-z muldefs",
169 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700170 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000171 "libart-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700172 "libart-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700173 "libart-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700174 "libart",
175 "libvixl-arm",
176 "libvixl-arm64",
177 ] + art_static_dependencies,
178}
179
Nicolas Geoffrayafa7e452016-09-14 10:26:56 +0100180art_cc_binary {
Colin Crossc7376e02016-09-08 12:52:18 -0700181 name: "dex2oatds",
182 device_supported: false,
183 static_executable: true,
184 defaults: [
185 "art_debug_defaults",
186 "dex2oat-defaults",
187 ],
Colin Crossaa63aa22016-09-13 14:07:00 -0700188 target: {
189 darwin: {
190 enabled: false,
191 },
192 },
Colin Cross2cfc4ba2016-09-13 16:55:55 -0700193 ldflags: [
194 // We need this because GC stress mode makes use of
195 // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
196 // defined in libgcc_eh.a(unwind-dw2.o)
197 // TODO: Having this is not ideal as it might obscure errors.
198 // Try to get rid of it.
199 "-z muldefs",
200 ],
Colin Crossc7376e02016-09-08 12:52:18 -0700201 static_libs: [
Vladimir Marko74527972016-11-29 15:57:32 +0000202 "libartd-dex2oat",
Colin Crossc7376e02016-09-08 12:52:18 -0700203 "libartd-compiler",
Jeff Hao608f2ce2016-10-19 11:17:11 -0700204 "libartd-dexlayout",
Colin Crossc7376e02016-09-08 12:52:18 -0700205 "libartd",
206 "libvixld-arm",
207 "libvixld-arm64",
208 ] + art_static_dependencies,
209}
Colin Cross6e95dd52016-09-12 15:37:10 -0700210
211art_cc_test {
212 name: "art_dex2oat_tests",
213 defaults: [
Colin Crossafd3c9e2016-09-16 13:47:21 -0700214 "art_gtest_defaults",
Colin Cross6e95dd52016-09-12 15:37:10 -0700215 ],
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700216 srcs: [
217 "dex2oat_test.cc",
218 "dex2oat_image_test.cc",
Vladimir Marko74527972016-11-29 15:57:32 +0000219 "linker/elf_writer_test.cc",
220 "linker/image_test.cc",
221 "linker/image_write_read_test.cc",
222 "linker/multi_oat_relative_patcher_test.cc",
223 "linker/oat_writer_test.cc",
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700224 ],
Andreas Gampef7882972017-03-20 16:35:24 -0700225 header_libs: ["dex2oat_headers"],
Vladimir Marko74527972016-11-29 15:57:32 +0000226 shared_libs: [
227 "libartd-compiler",
228 "libartd-dexlayout",
229 "libbase",
230 "liblz4",
231 "libsigchain",
232 ],
233 static_libs: [
234 "libartd-dex2oat",
Dan Willemsen2ca27802017-09-27 14:57:43 -0700235 ],
Colin Cross6e95dd52016-09-12 15:37:10 -0700236}