blob: 8aa287fbd88852cfff9978f1952d8a4ddfa2969a [file] [log] [blame]
David Sehr334b9d72018-02-12 18:27:56 -08001//
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
Bob Badour9150de62021-02-26 03:22:24 -080017package {
18 // See: http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // all of the 'license_kinds' from "art_license"
21 // to get the below license kinds:
22 // SPDX-license-identifier-Apache-2.0
23 default_applicable_licenses: ["art_license"],
24}
25
David Sehr334b9d72018-02-12 18:27:56 -080026cc_defaults {
27 name: "libdexfile_defaults",
28 defaults: ["art_defaults"],
29 host_supported: true,
30 srcs: [
David Sehr1f010162018-05-15 08:59:32 -070031 "dex/art_dex_file_loader.cc",
David Sehr334b9d72018-02-12 18:27:56 -080032 "dex/compact_dex_file.cc",
Mathieu Chartier5e3cfa22018-02-20 16:53:37 -080033 "dex/compact_offset_table.cc",
David Sehr334b9d72018-02-12 18:27:56 -080034 "dex/descriptors_names.cc",
35 "dex/dex_file.cc",
36 "dex/dex_file_exception_helpers.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080037 "dex/dex_file_layout.cc",
David Sehr334b9d72018-02-12 18:27:56 -080038 "dex/dex_file_loader.cc",
39 "dex/dex_file_tracking_registrar.cc",
40 "dex/dex_file_verifier.cc",
41 "dex/dex_instruction.cc",
42 "dex/modifiers.cc",
David Sehr67bf42e2018-02-26 16:43:04 -080043 "dex/primitive.cc",
Andreas Gampead1aa632019-01-02 10:30:54 -080044 "dex/signature.cc",
David Sehr334b9d72018-02-12 18:27:56 -080045 "dex/standard_dex_file.cc",
David Sehr9c4a0152018-04-05 12:23:54 -070046 "dex/type_lookup_table.cc",
David Sehr334b9d72018-02-12 18:27:56 -080047 "dex/utf.cc",
48 ],
Orion Hodson00cb81d2020-04-03 06:47:07 +010049 header_libs: ["jni_headers"],
50 export_header_lib_headers: ["jni_headers"],
David Sehr334b9d72018-02-12 18:27:56 -080051 target: {
52 android: {
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000053 static_libs: [
54 "libziparchive",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000055 ],
David Sehr10db8fe2018-07-18 11:01:20 -070056 shared_libs: [
Jiyong Parkb1c8e162020-05-18 19:04:42 +090057 // libz provides a stub from platform, shouldn't be statically linked
58 "libz",
Andreas Gampe0dc93b12019-05-15 10:30:22 -070059 // For MemMap.
60 "libartpalette",
61 "liblog",
62 // For common macros.
63 "libbase",
David Sehr10db8fe2018-07-18 11:01:20 -070064 ],
65 export_shared_lib_headers: [
David Sehr10db8fe2018-07-18 11:01:20 -070066 "libbase",
67 ],
David Sehr334b9d72018-02-12 18:27:56 -080068 },
David Sehr10db8fe2018-07-18 11:01:20 -070069 not_windows: {
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000070 shared_libs: [
71 "libziparchive",
72 "libz",
Andreas Gampe0dc93b12019-05-15 10:30:22 -070073 // For MemMap.
74 "libartpalette",
75 "liblog",
76 // For common macros.
77 "libbase",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000078 ],
David Sehr10db8fe2018-07-18 11:01:20 -070079 export_shared_lib_headers: [
David Sehr10db8fe2018-07-18 11:01:20 -070080 "libbase",
81 ],
82 },
83 windows: {
84 static_libs: [
85 "libziparchive",
86 "libz",
Andreas Gampe0dc93b12019-05-15 10:30:22 -070087 // For MemMap.
88 "libartpalette",
89 "liblog",
90 // For common macros.
91 "libbase",
David Sehr10db8fe2018-07-18 11:01:20 -070092 ],
93 export_static_lib_headers: [
David Sehr10db8fe2018-07-18 11:01:20 -070094 "libbase",
95 ],
96 cflags: ["-Wno-thread-safety"],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000097 },
David Srbeckyd53f6062019-03-22 14:55:21 +000098 darwin: {
99 enabled: true,
100 },
David Sehr334b9d72018-02-12 18:27:56 -0800101 },
102 generated_sources: ["dexfile_operator_srcs"],
David Sehr334b9d72018-02-12 18:27:56 -0800103 export_include_dirs: ["."],
David Sehr334b9d72018-02-12 18:27:56 -0800104}
105
Andreas Gampeec5ed062018-01-26 16:20:02 -0800106cc_defaults {
107 name: "libdexfile_static_base_defaults",
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100108 whole_static_libs: [
Andreas Gampeec5ed062018-01-26 16:20:02 -0800109 "libbase",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800110 "liblog",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000111 "libz",
112 "libziparchive",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800113 ],
114}
115
116cc_defaults {
117 name: "libdexfile_static_defaults",
118 defaults: [
119 "libartbase_static_defaults",
120 "libdexfile_static_base_defaults",
121 ],
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100122 defaults_visibility: [
123 "//art:__subpackages__",
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100124 ],
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100125 whole_static_libs: ["libdexfile"],
Andreas Gampeec5ed062018-01-26 16:20:02 -0800126}
127
128cc_defaults {
129 name: "libdexfiled_static_defaults",
130 defaults: [
131 "libartbased_static_defaults",
132 "libdexfile_static_base_defaults",
133 ],
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100134 whole_static_libs: ["libdexfiled"],
Andreas Gampeec5ed062018-01-26 16:20:02 -0800135}
136
David Sehr334b9d72018-02-12 18:27:56 -0800137gensrcs {
138 name: "dexfile_operator_srcs",
Alex Lightb69d2d32018-02-21 13:37:17 -0800139 cmd: "$(location generate_operator_out) art/libdexfile $(in) > $(out)",
140 tools: ["generate_operator_out"],
David Sehr334b9d72018-02-12 18:27:56 -0800141 srcs: [
142 "dex/dex_file.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800143 "dex/dex_file_layout.h",
David Sehr334b9d72018-02-12 18:27:56 -0800144 "dex/dex_instruction.h",
145 "dex/dex_instruction_utils.h",
146 "dex/invoke_type.h",
147 ],
148 output_extension: "operator_out.cc",
149}
150
David Sehr334b9d72018-02-12 18:27:56 -0800151art_cc_library {
152 name: "libdexfile",
Christopher Ferris0d38e852019-12-11 09:37:19 -0800153 defaults: [
154 "libdexfile_defaults",
155 "libart_nativeunwind_defaults",
156 ],
David Sehr10db8fe2018-07-18 11:01:20 -0700157 target: {
David Srbecky7711c352019-04-10 17:50:12 +0100158 android: {
159 shared_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700160 "libartbase",
David Srbecky7711c352019-04-10 17:50:12 +0100161 ],
162 export_shared_lib_headers: [
163 "libartbase",
164 ],
165 },
166 not_windows: {
167 shared_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700168 "libartbase",
David Srbecky7711c352019-04-10 17:50:12 +0100169 ],
170 export_shared_lib_headers: [
171 "libartbase",
172 ],
173 },
David Sehr10db8fe2018-07-18 11:01:20 -0700174 windows: {
175 enabled: true,
176 shared: {
177 enabled: false,
178 },
David Srbecky7711c352019-04-10 17:50:12 +0100179 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700180 "libartbase",
David Srbecky7711c352019-04-10 17:50:12 +0100181 ],
182 export_static_lib_headers: [
183 "libartbase",
184 ],
David Sehr10db8fe2018-07-18 11:01:20 -0700185 },
186 },
Jiyong Park066dd9022019-12-19 02:11:59 +0000187 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100188 "com.android.art",
Jiyong Park066dd9022019-12-19 02:11:59 +0000189 "com.android.art.debug",
Jiyong Park066dd9022019-12-19 02:11:59 +0000190 ],
David Sehr334b9d72018-02-12 18:27:56 -0800191}
192
David Sehrfcbe15c2018-02-15 09:41:13 -0800193art_cc_library {
194 name: "libdexfiled",
195 defaults: [
196 "art_debug_defaults",
197 "libdexfile_defaults",
198 ],
David Sehr10db8fe2018-07-18 11:01:20 -0700199 target: {
David Srbecky7711c352019-04-10 17:50:12 +0100200 android: {
201 shared_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700202 "libartbased",
David Srbecky7711c352019-04-10 17:50:12 +0100203 ],
204 export_shared_lib_headers: [
205 "libartbased",
206 ],
207 },
208 not_windows: {
209 shared_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700210 "libartbased",
David Srbecky7711c352019-04-10 17:50:12 +0100211 ],
212 export_shared_lib_headers: [
213 "libartbased",
214 ],
215 },
David Sehr10db8fe2018-07-18 11:01:20 -0700216 windows: {
217 enabled: true,
218 shared: {
219 enabled: false,
220 },
David Srbecky7711c352019-04-10 17:50:12 +0100221 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700222 "libartbased",
David Srbecky7711c352019-04-10 17:50:12 +0100223 ],
224 export_static_lib_headers: [
225 "libartbased",
226 ],
David Sehr10db8fe2018-07-18 11:01:20 -0700227 },
228 },
Jiyong Park066dd9022019-12-19 02:11:59 +0000229 apex_available: [
230 "com.android.art.debug",
231 ],
David Sehrfcbe15c2018-02-15 09:41:13 -0800232}
233
Martin Stjernholmfdb2f602019-01-09 14:47:00 +0000234art_cc_test {
235 name: "art_libdexfile_tests",
236 defaults: [
237 "art_gtest_defaults",
238 ],
239 srcs: [
240 "dex/art_dex_file_loader_test.cc",
241 "dex/class_accessor_test.cc",
242 "dex/code_item_accessors_test.cc",
243 "dex/compact_dex_file_test.cc",
244 "dex/compact_offset_table_test.cc",
245 "dex/descriptors_names_test.cc",
246 "dex/test_dex_file_builder_test.cc",
247 "dex/dex_file_loader_test.cc",
248 "dex/dex_file_verifier_test.cc",
249 "dex/dex_instruction_test.cc",
250 "dex/primitive_test.cc",
251 "dex/string_reference_test.cc",
252 "dex/type_lookup_table_test.cc",
253 "dex/utf_test.cc",
254 ],
David Srbecky4a88a5a2020-05-05 16:21:57 +0100255 data: [
256 ":art-gtest-jars-GetMethodSignature",
257 ":art-gtest-jars-Lookup",
258 ":art-gtest-jars-Main",
259 ":art-gtest-jars-MultiDex",
260 ":art-gtest-jars-Nested",
261 ],
Orion Hodson00cb81d2020-04-03 06:47:07 +0100262 header_libs: ["jni_headers"],
Martin Stjernholmfdb2f602019-01-09 14:47:00 +0000263 shared_libs: [
264 "libbacktrace",
265 "libziparchive",
266 ],
Martin Stjernholmfdb2f602019-01-09 14:47:00 +0000267}
268
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000269cc_library_headers {
270 name: "libdexfile_external_headers",
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100271 visibility: ["//visibility:public"],
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000272 host_supported: true,
273 header_libs: ["libbase_headers"],
274 export_header_lib_headers: ["libbase_headers"],
275 export_include_dirs: ["external/include"],
276
277 target: {
278 windows: {
279 enabled: true,
280 },
281 },
Jiyong Park71f661c2020-04-28 18:20:43 +0900282
283 apex_available: [
284 "//apex_available:platform",
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100285 "com.android.art",
Jiyong Park71f661c2020-04-28 18:20:43 +0900286 "com.android.art.debug",
Martin Stjernholm694f0122020-10-30 02:23:24 +0000287 "com.android.media",
288 "com.android.runtime",
Jiyong Park71f661c2020-04-28 18:20:43 +0900289 ],
Nicolas Geoffrayec388c02021-03-03 22:09:06 +0000290 min_sdk_version: "S",
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000291}
292
Paul Duffin4345aac2019-07-17 15:51:54 +0100293// Make dex_instruction_list.h available for tools/jvmti-agents/titrace
294cc_library_headers {
295 name: "libdexfile_all_headers",
296 visibility: ["//art:__subpackages__"],
297 host_supported: true,
298 export_include_dirs: ["."],
Jiyong Park71f661c2020-04-28 18:20:43 +0900299
300 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100301 "com.android.art",
Jiyong Park71f661c2020-04-28 18:20:43 +0900302 "com.android.art.debug",
Jiyong Park71f661c2020-04-28 18:20:43 +0900303 ],
Nicolas Geoffrayec388c02021-03-03 22:09:06 +0000304 min_sdk_version: "S",
Paul Duffin4345aac2019-07-17 15:51:54 +0100305}
306
David Srbecky7711c352019-04-10 17:50:12 +0100307cc_defaults {
308 name: "libdexfile_external-defaults",
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000309 host_supported: true,
310 srcs: [
311 "external/dex_file_ext.cc",
312 ],
Orion Hodson00cb81d2020-04-03 06:47:07 +0100313 header_libs: [
314 "jni_headers",
315 "libdexfile_external_headers",
316 ],
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000317 shared_libs: [
318 "libbase",
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000319 ],
Martin Stjernholm84bf6982019-02-05 15:07:57 +0000320 stubs: {
321 symbol_file: "external/libdexfile_external.map.txt",
322 versions: ["1"],
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000323 },
Orion Hodson00cb81d2020-04-03 06:47:07 +0100324 export_header_lib_headers: [
325 "jni_headers",
326 "libdexfile_external_headers",
327 ],
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000328}
329
David Srbecky1cf46a32020-06-22 15:39:00 +0100330art_cc_library {
David Srbecky7711c352019-04-10 17:50:12 +0100331 name: "libdexfile_external",
332 defaults: [
333 "art_defaults",
334 "libdexfile_external-defaults",
335 ],
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100336 visibility: ["//visibility:public"],
David Srbecky52fc7ab2019-05-03 11:03:52 +0100337 target: {
338 darwin: {
339 enabled: true,
340 },
341 },
David Srbecky7711c352019-04-10 17:50:12 +0100342 shared_libs: [
343 "libdexfile",
344 ],
Jiyong Park066dd9022019-12-19 02:11:59 +0000345 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100346 "com.android.art",
Jiyong Park066dd9022019-12-19 02:11:59 +0000347 "com.android.art.debug",
Jiyong Park066dd9022019-12-19 02:11:59 +0000348 ],
David Srbecky7711c352019-04-10 17:50:12 +0100349}
350
David Srbecky1cf46a32020-06-22 15:39:00 +0100351art_cc_library {
David Srbecky7711c352019-04-10 17:50:12 +0100352 name: "libdexfiled_external",
353 defaults: [
354 "art_debug_defaults",
355 "libdexfile_external-defaults",
356 ],
David Srbecky52fc7ab2019-05-03 11:03:52 +0100357 target: {
358 darwin: {
359 enabled: true,
360 },
361 },
David Srbecky7711c352019-04-10 17:50:12 +0100362 shared_libs: [
363 "libdexfiled",
364 ],
Jiyong Park066dd9022019-12-19 02:11:59 +0000365 apex_available: [
366 "com.android.art.debug",
367 ],
David Srbecky7711c352019-04-10 17:50:12 +0100368}
369
Martin Stjernholmfdb2f602019-01-09 14:47:00 +0000370art_cc_test {
371 name: "art_libdexfile_external_tests",
372 host_supported: true,
Martin Stjernholm842555d2020-03-23 14:38:47 +0000373 test_suites: ["general-tests"],
Martin Stjernholmfdb2f602019-01-09 14:47:00 +0000374 srcs: [
375 "external/dex_file_ext_c_test.c",
376 ],
Orion Hodson00cb81d2020-04-03 06:47:07 +0100377 header_libs: [
378 "jni_headers",
379 "libdexfile_external_headers",
380 ],
Martin Stjernholmfdb2f602019-01-09 14:47:00 +0000381}
382
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000383// Support library with a C++ API for accessing the libdexfile API for external
Martin Stjernholmfe94b1c2019-01-31 17:40:39 +0000384// (non-ART) users.
385//
386// This library dlopens libdexfile_external on first use, so there is no build
387// time dependency on dex file logic. It is therefore safe to use from binaries
388// compiled without dex file support, given they won't encounter any dex file
389// stack frames.
David Srbecky1cf46a32020-06-22 15:39:00 +0100390art_cc_library {
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000391 name: "libdexfile_support",
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +0100392 visibility: ["//visibility:public"],
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000393 host_supported: true,
394 srcs: [
395 "external/dex_file_supp.cc",
396 ],
Martin Stjernholm80892042020-04-21 00:39:00 +0100397 runtime_libs: ["libdexfile_external"],
David Srbecky2ddb98b2021-03-09 00:37:04 +0000398 shared_libs: [
399 "liblog",
400 "libbase",
401 ],
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000402 header_libs: ["libdexfile_external_headers"],
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000403 export_header_lib_headers: ["libdexfile_external_headers"],
Jiyong Park71f661c2020-04-28 18:20:43 +0900404
405 apex_available: [
406 "//apex_available:platform",
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100407 "com.android.art",
Jiyong Park71f661c2020-04-28 18:20:43 +0900408 "com.android.art.debug",
Martin Stjernholm694f0122020-10-30 02:23:24 +0000409 "com.android.media",
410 "com.android.media.swcodec",
411 "com.android.runtime",
Jiyong Park71f661c2020-04-28 18:20:43 +0900412 ],
Nicolas Geoffrayec388c02021-03-03 22:09:06 +0000413 min_sdk_version: "S",
Martin Stjernholmb3d2e832018-11-15 18:09:35 +0000414}
Martin Stjernholm750bf042019-01-09 22:51:12 +0000415
416art_cc_test {
417 name: "art_libdexfile_support_tests",
Roland Levillain61f07162019-06-26 12:44:04 +0100418 defaults: [
419 "art_test_defaults",
420 ],
Martin Stjernholm750bf042019-01-09 22:51:12 +0000421 host_supported: true,
Martin Stjernholm842555d2020-03-23 14:38:47 +0000422 test_suites: ["general-tests"],
Martin Stjernholm750bf042019-01-09 22:51:12 +0000423 srcs: [
424 "external/dex_file_supp_test.cc",
425 ],
426 shared_libs: [
427 "libartbase",
428 "libbase",
429 "libdexfile_external",
430 "libdexfile_support",
431 ],
432}
Martin Stjernholmfe94b1c2019-01-31 17:40:39 +0000433
Martin Stjernholm68e5db52020-09-23 20:43:56 +0100434cc_library_static {
435 name: "libdexfile_support_static",
Martin Stjernholmd3ee98a2019-09-23 16:26:50 +0100436 host_supported: true,
Martin Stjernholmfe94b1c2019-01-31 17:40:39 +0000437 srcs: [
438 "external/dex_file_supp.cc",
439 ],
440 cflags: ["-DSTATIC_LIB"],
Martin Stjernholmfe94b1c2019-01-31 17:40:39 +0000441 header_libs: ["libdexfile_external_headers"],
442 export_header_lib_headers: ["libdexfile_external_headers"],
443}
444
Martin Stjernholm68e5db52020-09-23 20:43:56 +0100445cc_defaults {
446 name: "libdexfile_support_static_defaults",
Martin Stjernholm621afb42019-09-23 22:01:36 +0100447 defaults: [
448 "libdexfile_static_defaults",
Martin Stjernholm621afb42019-09-23 22:01:36 +0100449 ],
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100450 whole_static_libs: [
Martin Stjernholm621afb42019-09-23 22:01:36 +0100451 "libdexfile_external",
Martin Stjernholm68e5db52020-09-23 20:43:56 +0100452 "libdexfile_support_static",
Martin Stjernholm621afb42019-09-23 22:01:36 +0100453 ],
454}
455
Martin Stjernholm68e5db52020-09-23 20:43:56 +0100456cc_defaults {
457 name: "libdexfiled_support_static_defaults",
Martin Stjernholm621afb42019-09-23 22:01:36 +0100458 defaults: [
Martin Stjernholm621afb42019-09-23 22:01:36 +0100459 "libdexfiled_static_defaults",
460 ],
Martin Stjernholm35f765b2020-09-23 00:38:38 +0100461 whole_static_libs: [
Martin Stjernholm68e5db52020-09-23 20:43:56 +0100462 "libdexfile_support_static",
Martin Stjernholm621afb42019-09-23 22:01:36 +0100463 "libdexfiled_external",
464 ],
465}
466
Martin Stjernholmfe94b1c2019-01-31 17:40:39 +0000467art_cc_test {
468 name: "art_libdexfile_support_static_tests",
469 host_supported: true,
Martin Stjernholm842555d2020-03-23 14:38:47 +0000470 test_suites: ["general-tests"],
Martin Stjernholm68e5db52020-09-23 20:43:56 +0100471 defaults: ["libdexfile_support_static_defaults"],
Martin Stjernholmfe94b1c2019-01-31 17:40:39 +0000472 srcs: [
473 "external/dex_file_supp_test.cc",
474 ],
Martin Stjernholm68e5db52020-09-23 20:43:56 +0100475}
476
Martin Stjernholmcbbc8df2020-09-30 22:02:32 +0100477// For use by external packages allowed to link in static libdexfile_support.
478// This is not allowed in any module that may end up in an APEX or platform
479// image, so visibility is restrictive.
Martin Stjernholm68e5db52020-09-23 20:43:56 +0100480cc_library_static {
481 name: "libdexfile_external_static",
482 host_supported: true,
Martin Stjernholmcbbc8df2020-09-30 22:02:32 +0100483 visibility: [
484 // Required for simpleperf, libsimpleperf_record, and libsimpleperf_report
485 // in the NDK.
486 "//system/extras/simpleperf",
487 "//cts/tests/tests/simpleperf",
Martin Stjernholmfe94b1c2019-01-31 17:40:39 +0000488 ],
Martin Stjernholmcbbc8df2020-09-30 22:02:32 +0100489 // Using libdexfile_support_static_defaults will link in external libs like
490 // libbase and libz statically as well, which are likely to cause duplicate
491 // copies in the depending module.
492 // TODO(b/169885605): Avoid exposing symbols from those libs.
493 defaults: [
494 "art_defaults",
495 "libdexfile_support_static_defaults",
496 ],
Martin Stjernholm68e5db52020-09-23 20:43:56 +0100497}
498
499art_cc_test {
500 name: "art_libdexfile_external_static_tests",
501 host_supported: true,
502 test_suites: ["general-tests"],
Martin Stjernholm68e5db52020-09-23 20:43:56 +0100503 srcs: [
504 "external/dex_file_supp_test.cc",
505 ],
Martin Stjernholmcbbc8df2020-09-30 22:02:32 +0100506 static_libs: [
507 "libdexfile_external_static",
508 ],
Martin Stjernholm68e5db52020-09-23 20:43:56 +0100509 enabled: false,
510 target: {
511 linux: {
512 enabled: true,
513 },
514 },
Martin Stjernholm49e80cc2021-03-03 00:13:09 +0000515 // TODO(b/181740144): Enable a ubsan check to create a dependency on
516 // ubsan_minimal. It's needed to be able to link with the prebuilt
517 // libdexfile_external_static.a, which contains libziparchive.a, which is
518 // built with some ubsan checks
519 // (https://cs.android.com/android/platform/superproject/+/master:system/libziparchive/Android.bp;l=47-59;drc=c7b498fdf2002194709e40ea58ce39f43684fc14)
520 // that the SDK snapshots currently don't propagate properly for static
521 // libs.
522 sanitize: {
523 misc_undefined: ["shift"],
524 },
Martin Stjernholm68e5db52020-09-23 20:43:56 +0100525}
Colin Cross7b550652020-11-17 10:12:52 -0800526
527filegroup {
528 name: "art_libdexfile_dex_instruction_list_header",
529 srcs: ["dex/dex_instruction_list.h"],
530}