David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 1 | // |
| 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 Badour | 9150de6 | 2021-02-26 03:22:24 -0800 | [diff] [blame] | 17 | package { |
| 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 Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 26 | cc_defaults { |
| 27 | name: "libdexfile_defaults", |
| 28 | defaults: ["art_defaults"], |
| 29 | host_supported: true, |
Chih-Hung Hsieh | a0a5f00 | 2022-02-17 21:14:37 -0800 | [diff] [blame] | 30 | tidy_timeout_srcs: [ |
| 31 | "dex/dex_file_verifier.cc", |
| 32 | ], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 33 | srcs: [ |
David Sehr | 1f01016 | 2018-05-15 08:59:32 -0700 | [diff] [blame] | 34 | "dex/art_dex_file_loader.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 35 | "dex/compact_dex_file.cc", |
Mathieu Chartier | 5e3cfa2 | 2018-02-20 16:53:37 -0800 | [diff] [blame] | 36 | "dex/compact_offset_table.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 37 | "dex/descriptors_names.cc", |
| 38 | "dex/dex_file.cc", |
| 39 | "dex/dex_file_exception_helpers.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 40 | "dex/dex_file_layout.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 41 | "dex/dex_file_loader.cc", |
| 42 | "dex/dex_file_tracking_registrar.cc", |
| 43 | "dex/dex_file_verifier.cc", |
| 44 | "dex/dex_instruction.cc", |
| 45 | "dex/modifiers.cc", |
David Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 46 | "dex/primitive.cc", |
Andreas Gampe | ad1aa63 | 2019-01-02 10:30:54 -0800 | [diff] [blame] | 47 | "dex/signature.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 48 | "dex/standard_dex_file.cc", |
David Sehr | 9c4a015 | 2018-04-05 12:23:54 -0700 | [diff] [blame] | 49 | "dex/type_lookup_table.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 50 | "dex/utf.cc", |
| 51 | ], |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 52 | header_libs: [ |
| 53 | "jni_headers", |
| 54 | "libdexfile_external_headers", |
| 55 | ], |
| 56 | export_header_lib_headers: [ |
| 57 | "jni_headers", |
| 58 | "libdexfile_external_headers", |
| 59 | ], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 60 | target: { |
| 61 | android: { |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 62 | srcs: [ |
| 63 | "external/dex_file_ext.cc", |
| 64 | ], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 65 | static_libs: [ |
| 66 | "libziparchive", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 67 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 68 | shared_libs: [ |
Jiyong Park | b1c8e16 | 2020-05-18 19:04:42 +0900 | [diff] [blame] | 69 | // libz provides a stub from platform, shouldn't be statically linked |
| 70 | "libz", |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 71 | // For MemMap. |
| 72 | "libartpalette", |
| 73 | "liblog", |
| 74 | // For common macros. |
| 75 | "libbase", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 76 | ], |
| 77 | export_shared_lib_headers: [ |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 78 | "libbase", |
| 79 | ], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 80 | }, |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 81 | not_windows: { |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 82 | srcs: [ |
| 83 | "external/dex_file_ext.cc", |
| 84 | ], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 85 | shared_libs: [ |
| 86 | "libziparchive", |
| 87 | "libz", |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 88 | // For MemMap. |
| 89 | "libartpalette", |
| 90 | "liblog", |
| 91 | // For common macros. |
| 92 | "libbase", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 93 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 94 | export_shared_lib_headers: [ |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 95 | "libbase", |
| 96 | ], |
| 97 | }, |
| 98 | windows: { |
| 99 | static_libs: [ |
| 100 | "libziparchive", |
| 101 | "libz", |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 102 | // For MemMap. |
| 103 | "libartpalette", |
| 104 | "liblog", |
| 105 | // For common macros. |
| 106 | "libbase", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 107 | ], |
| 108 | export_static_lib_headers: [ |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 109 | "libbase", |
| 110 | ], |
| 111 | cflags: ["-Wno-thread-safety"], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 112 | }, |
David Srbecky | d53f606 | 2019-03-22 14:55:21 +0000 | [diff] [blame] | 113 | darwin: { |
| 114 | enabled: true, |
| 115 | }, |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 116 | }, |
| 117 | generated_sources: ["dexfile_operator_srcs"], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 118 | export_include_dirs: ["."], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 119 | } |
| 120 | |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 121 | cc_defaults { |
| 122 | name: "libdexfile_static_base_defaults", |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 123 | whole_static_libs: [ |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 124 | "libbase", |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 125 | "liblog", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 126 | "libz", |
| 127 | "libziparchive", |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 128 | ], |
| 129 | } |
| 130 | |
| 131 | cc_defaults { |
| 132 | name: "libdexfile_static_defaults", |
| 133 | defaults: [ |
| 134 | "libartbase_static_defaults", |
| 135 | "libdexfile_static_base_defaults", |
| 136 | ], |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 137 | defaults_visibility: [ |
| 138 | "//art:__subpackages__", |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 139 | ], |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 140 | whole_static_libs: ["libdexfile"], |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | cc_defaults { |
| 144 | name: "libdexfiled_static_defaults", |
| 145 | defaults: [ |
| 146 | "libartbased_static_defaults", |
| 147 | "libdexfile_static_base_defaults", |
| 148 | ], |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 149 | whole_static_libs: ["libdexfiled"], |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 150 | } |
| 151 | |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 152 | gensrcs { |
| 153 | name: "dexfile_operator_srcs", |
Alex Light | b69d2d3 | 2018-02-21 13:37:17 -0800 | [diff] [blame] | 154 | cmd: "$(location generate_operator_out) art/libdexfile $(in) > $(out)", |
| 155 | tools: ["generate_operator_out"], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 156 | srcs: [ |
| 157 | "dex/dex_file.h", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 158 | "dex/dex_file_layout.h", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 159 | "dex/dex_instruction.h", |
| 160 | "dex/dex_instruction_utils.h", |
| 161 | "dex/invoke_type.h", |
| 162 | ], |
| 163 | output_extension: "operator_out.cc", |
| 164 | } |
| 165 | |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 166 | art_cc_library { |
| 167 | name: "libdexfile", |
Christopher Ferris | ac97f3e | 2021-06-17 20:59:10 +0000 | [diff] [blame] | 168 | visibility: [ |
Martin Stjernholm | 315cf0c | 2021-08-26 21:34:52 +0100 | [diff] [blame] | 169 | // Allow libdexfile_support users to list this as a runtime_libs |
| 170 | // dependency - see comment for libdexfile_support. It shouldn't be used |
| 171 | // for any other purpose. |
| 172 | "//external/perfetto", |
| 173 | "//system/core/debuggerd", |
| 174 | "//system/extras/simpleperf", |
Christopher Ferris | ac97f3e | 2021-06-17 20:59:10 +0000 | [diff] [blame] | 175 | "//system/unwinding/libunwindstack", |
| 176 | ], |
Christopher Ferris | 0d38e85 | 2019-12-11 09:37:19 -0800 | [diff] [blame] | 177 | defaults: [ |
| 178 | "libdexfile_defaults", |
| 179 | "libart_nativeunwind_defaults", |
| 180 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 181 | target: { |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 182 | android: { |
| 183 | shared_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 184 | "libartbase", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 185 | ], |
| 186 | export_shared_lib_headers: [ |
| 187 | "libartbase", |
| 188 | ], |
| 189 | }, |
| 190 | not_windows: { |
| 191 | shared_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 192 | "libartbase", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 193 | ], |
| 194 | export_shared_lib_headers: [ |
| 195 | "libartbase", |
| 196 | ], |
| 197 | }, |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 198 | windows: { |
| 199 | enabled: true, |
| 200 | shared: { |
| 201 | enabled: false, |
| 202 | }, |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 203 | static_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 204 | "libartbase", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 205 | ], |
| 206 | export_static_lib_headers: [ |
| 207 | "libartbase", |
| 208 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 209 | }, |
| 210 | }, |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 211 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 212 | "com.android.art", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 213 | "com.android.art.debug", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 214 | ], |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 215 | stubs: { |
David Srbecky | 30d4d2f | 2021-03-24 16:11:49 +0000 | [diff] [blame] | 216 | symbol_file: "libdexfile.map.txt", |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 217 | versions: ["1"], |
| 218 | }, |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 219 | } |
| 220 | |
David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 221 | art_cc_library { |
| 222 | name: "libdexfiled", |
| 223 | defaults: [ |
| 224 | "art_debug_defaults", |
| 225 | "libdexfile_defaults", |
| 226 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 227 | target: { |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 228 | android: { |
| 229 | shared_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 230 | "libartbased", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 231 | ], |
| 232 | export_shared_lib_headers: [ |
| 233 | "libartbased", |
| 234 | ], |
| 235 | }, |
| 236 | not_windows: { |
| 237 | shared_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 238 | "libartbased", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 239 | ], |
| 240 | export_shared_lib_headers: [ |
| 241 | "libartbased", |
| 242 | ], |
| 243 | }, |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 244 | windows: { |
| 245 | enabled: true, |
| 246 | shared: { |
| 247 | enabled: false, |
| 248 | }, |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 249 | static_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 250 | "libartbased", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 251 | ], |
| 252 | export_static_lib_headers: [ |
| 253 | "libartbased", |
| 254 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 255 | }, |
| 256 | }, |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 257 | apex_available: [ |
| 258 | "com.android.art.debug", |
Martin Stjernholm | a2f48a4 | 2021-04-09 13:23:21 +0100 | [diff] [blame] | 259 | // TODO(b/183882457): This lib doesn't go into com.android.art, but |
| 260 | // apex_available lists need to be the same for internal libs to avoid |
| 261 | // stubs, and libartd depends on this. |
| 262 | "com.android.art", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 263 | ], |
David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 264 | } |
| 265 | |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 266 | art_cc_defaults { |
| 267 | name: "art_libdexfile_tests_defaults", |
Chih-Hung Hsieh | a0a5f00 | 2022-02-17 21:14:37 -0800 | [diff] [blame] | 268 | tidy_timeout_srcs: [ |
| 269 | "dex/dex_file_verifier_test.cc", |
| 270 | ], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 271 | srcs: [ |
| 272 | "dex/art_dex_file_loader_test.cc", |
| 273 | "dex/class_accessor_test.cc", |
| 274 | "dex/code_item_accessors_test.cc", |
| 275 | "dex/compact_dex_file_test.cc", |
| 276 | "dex/compact_offset_table_test.cc", |
| 277 | "dex/descriptors_names_test.cc", |
| 278 | "dex/test_dex_file_builder_test.cc", |
| 279 | "dex/dex_file_loader_test.cc", |
| 280 | "dex/dex_file_verifier_test.cc", |
| 281 | "dex/dex_instruction_test.cc", |
| 282 | "dex/primitive_test.cc", |
| 283 | "dex/string_reference_test.cc", |
| 284 | "dex/type_lookup_table_test.cc", |
| 285 | "dex/utf_test.cc", |
| 286 | ], |
David Srbecky | 4a88a5a | 2020-05-05 16:21:57 +0100 | [diff] [blame] | 287 | data: [ |
| 288 | ":art-gtest-jars-GetMethodSignature", |
| 289 | ":art-gtest-jars-Lookup", |
| 290 | ":art-gtest-jars-Main", |
| 291 | ":art-gtest-jars-MultiDex", |
| 292 | ":art-gtest-jars-Nested", |
| 293 | ], |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 294 | header_libs: ["jni_headers"], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 295 | shared_libs: [ |
| 296 | "libbacktrace", |
| 297 | "libziparchive", |
| 298 | ], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 299 | } |
| 300 | |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 301 | // Version of ART gtest `art_libdexfile_tests` bundled with the ART APEX on target. |
| 302 | // TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. |
| 303 | art_cc_test { |
| 304 | name: "art_libdexfile_tests", |
| 305 | defaults: [ |
| 306 | "art_gtest_defaults", |
| 307 | "art_libdexfile_tests_defaults", |
| 308 | ], |
| 309 | } |
| 310 | |
| 311 | // Standalone version of ART gtest `art_libdexfile_tests`, not bundled with the ART APEX on target. |
| 312 | art_cc_test { |
| 313 | name: "art_standalone_libdexfile_tests", |
| 314 | defaults: [ |
| 315 | "art_standalone_gtest_defaults", |
| 316 | "art_libdexfile_tests_defaults", |
| 317 | ], |
| 318 | test_config: "art_standalone_libdexfile_tests.xml", |
| 319 | } |
| 320 | |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 321 | cc_library_headers { |
| 322 | name: "libdexfile_external_headers", |
Martin Stjernholm | e10abe7 | 2021-10-28 03:49:55 +0100 | [diff] [blame] | 323 | defaults: ["art_defaults"], |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 324 | visibility: ["//visibility:public"], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 325 | host_supported: true, |
| 326 | header_libs: ["libbase_headers"], |
| 327 | export_header_lib_headers: ["libbase_headers"], |
| 328 | export_include_dirs: ["external/include"], |
| 329 | |
| 330 | target: { |
| 331 | windows: { |
| 332 | enabled: true, |
| 333 | }, |
Martin Stjernholm | 7eba377 | 2021-11-10 11:22:58 +0000 | [diff] [blame] | 334 | darwin: { |
| 335 | enabled: true, |
| 336 | }, |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 337 | }, |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 338 | |
| 339 | apex_available: [ |
| 340 | "//apex_available:platform", |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 341 | "com.android.art", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 342 | "com.android.art.debug", |
Martin Stjernholm | 694f012 | 2020-10-30 02:23:24 +0000 | [diff] [blame] | 343 | "com.android.media", |
| 344 | "com.android.runtime", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 345 | ], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 346 | } |
| 347 | |
Paul Duffin | 4345aac | 2019-07-17 15:51:54 +0100 | [diff] [blame] | 348 | // Make dex_instruction_list.h available for tools/jvmti-agents/titrace |
| 349 | cc_library_headers { |
| 350 | name: "libdexfile_all_headers", |
Martin Stjernholm | e10abe7 | 2021-10-28 03:49:55 +0100 | [diff] [blame] | 351 | defaults: ["art_defaults"], |
Paul Duffin | 4345aac | 2019-07-17 15:51:54 +0100 | [diff] [blame] | 352 | visibility: ["//art:__subpackages__"], |
| 353 | host_supported: true, |
| 354 | export_include_dirs: ["."], |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 355 | |
| 356 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 357 | "com.android.art", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 358 | "com.android.art.debug", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 359 | ], |
Paul Duffin | 4345aac | 2019-07-17 15:51:54 +0100 | [diff] [blame] | 360 | } |
| 361 | |
Martin Stjernholm | 34aa3ae | 2022-01-19 23:05:20 +0000 | [diff] [blame] | 362 | art_cc_defaults { |
| 363 | name: "art_libdexfile_external_tests_defaults", |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 364 | defaults: [ |
| 365 | "art_module_source_build_defaults", |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 366 | ], |
Martin Stjernholm | 842555d | 2020-03-23 14:38:47 +0000 | [diff] [blame] | 367 | test_suites: ["general-tests"], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 368 | srcs: [ |
| 369 | "external/dex_file_ext_c_test.c", |
David Srbecky | 30d4d2f | 2021-03-24 16:11:49 +0000 | [diff] [blame] | 370 | "external/dex_file_ext_test.cc", |
| 371 | ], |
| 372 | shared_libs: [ |
| 373 | "libartbase", |
| 374 | "libdexfile", |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 375 | ], |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 376 | header_libs: [ |
| 377 | "jni_headers", |
| 378 | "libdexfile_external_headers", |
| 379 | ], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 380 | } |
| 381 | |
Martin Stjernholm | 34aa3ae | 2022-01-19 23:05:20 +0000 | [diff] [blame] | 382 | // Version of ART gtest `art_libdexfile_external_tests` bundled with the ART APEX on target. |
| 383 | // TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. |
| 384 | art_cc_test { |
| 385 | name: "art_libdexfile_external_tests", |
| 386 | defaults: [ |
| 387 | "art_test_defaults", |
| 388 | "art_libdexfile_external_tests_defaults", |
| 389 | ], |
| 390 | } |
| 391 | |
| 392 | // Standalone version of ART gtest `art_libdexfile_external_tests`, not bundled with the ART APEX on |
| 393 | // target. |
| 394 | art_cc_test { |
| 395 | name: "art_standalone_libdexfile_external_tests", |
| 396 | defaults: [ |
| 397 | "art_standalone_test_defaults", |
| 398 | "art_libdexfile_external_tests_defaults", |
| 399 | ], |
| 400 | |
| 401 | // Support multilib variants (using different suffix per sub-architecture), which is needed on |
| 402 | // build targets with secondary architectures, as the CTS test suite packaging logic flattens |
| 403 | // all test artifacts into a single `testcases` directory. |
| 404 | compile_multilib: "both", |
| 405 | multilib: { |
| 406 | lib32: { |
| 407 | suffix: "32", |
| 408 | }, |
| 409 | lib64: { |
| 410 | suffix: "64", |
| 411 | }, |
| 412 | }, |
| 413 | |
| 414 | test_config_template: ":art-gtests-target-standalone-cts-template", |
| 415 | test_suites: ["cts"], // For backed-by API coverage. |
| 416 | } |
| 417 | |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 418 | // Support library with a C++ API for accessing the libdexfile API for external |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 419 | // (non-ART) users. |
| 420 | // |
Martin Stjernholm | 34b00fb | 2021-05-14 18:15:56 +0100 | [diff] [blame] | 421 | // This library dlopens libdexfile(d).so on first use, so there is no build time |
| 422 | // dependency on dex file logic. It is therefore safe to use from binaries |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 423 | // compiled without dex file support, given they won't encounter any dex file |
| 424 | // stack frames. |
Martin Stjernholm | 315cf0c | 2021-08-26 21:34:52 +0100 | [diff] [blame] | 425 | // |
| 426 | // IMPORTANT: When adding a static_libs dependency on this library, please |
| 427 | // remember to also add a corresponding |
| 428 | // |
| 429 | // runtime_libs: ["libdexfile"], |
| 430 | // |
| 431 | // That is necessary since Soong doesn't propagate dependencies transitively for |
| 432 | // static libraries (b/169779783). |
Martin Stjernholm | 34b00fb | 2021-05-14 18:15:56 +0100 | [diff] [blame] | 433 | art_cc_library_static { |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 434 | name: "libdexfile_support", |
Martin Stjernholm | f726d20 | 2021-10-28 03:52:25 +0100 | [diff] [blame] | 435 | defaults: ["art_defaults"], |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 436 | visibility: ["//visibility:public"], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 437 | host_supported: true, |
| 438 | srcs: [ |
| 439 | "external/dex_file_supp.cc", |
| 440 | ], |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 441 | runtime_libs: ["libdexfile"], |
David Srbecky | 2ddb98b | 2021-03-09 00:37:04 +0000 | [diff] [blame] | 442 | shared_libs: [ |
| 443 | "liblog", |
| 444 | "libbase", |
| 445 | ], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 446 | header_libs: ["libdexfile_external_headers"], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 447 | export_header_lib_headers: ["libdexfile_external_headers"], |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 448 | |
| 449 | apex_available: [ |
| 450 | "//apex_available:platform", |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 451 | "com.android.art", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 452 | "com.android.art.debug", |
Martin Stjernholm | 694f012 | 2020-10-30 02:23:24 +0000 | [diff] [blame] | 453 | "com.android.media", |
| 454 | "com.android.media.swcodec", |
| 455 | "com.android.runtime", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 456 | ], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 457 | } |
Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 458 | |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 459 | art_cc_defaults { |
| 460 | name: "art_libdexfile_support_tests_defaults", |
Roland Levillain | 61f0716 | 2019-06-26 12:44:04 +0100 | [diff] [blame] | 461 | defaults: [ |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 462 | "art_module_source_build_defaults", |
Roland Levillain | 61f0716 | 2019-06-26 12:44:04 +0100 | [diff] [blame] | 463 | ], |
Martin Stjernholm | 842555d | 2020-03-23 14:38:47 +0000 | [diff] [blame] | 464 | test_suites: ["general-tests"], |
Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 465 | srcs: [ |
| 466 | "external/dex_file_supp_test.cc", |
| 467 | ], |
| 468 | shared_libs: [ |
| 469 | "libartbase", |
| 470 | "libbase", |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 471 | "libdexfile", |
Martin Stjernholm | 34b00fb | 2021-05-14 18:15:56 +0100 | [diff] [blame] | 472 | "liblog", |
| 473 | ], |
| 474 | static_libs: [ |
Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 475 | "libdexfile_support", |
| 476 | ], |
| 477 | } |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 478 | |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 479 | // Version of ART gtest `art_libdexfile_support_tests` bundled with the ART APEX on target. |
| 480 | // TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. |
| 481 | art_cc_test { |
| 482 | name: "art_libdexfile_support_tests", |
| 483 | host_supported: true, |
| 484 | defaults: [ |
| 485 | "art_test_defaults", |
| 486 | "art_libdexfile_support_tests_defaults", |
| 487 | ], |
| 488 | } |
| 489 | |
| 490 | // Standalone version of ART gtest `art_libdexfile_support_tests`, not bundled with the ART APEX on |
| 491 | // target. |
| 492 | art_cc_test { |
| 493 | name: "art_standalone_libdexfile_support_tests", |
| 494 | defaults: [ |
| 495 | "art_standalone_test_defaults", |
| 496 | "art_libdexfile_support_tests_defaults", |
| 497 | ], |
| 498 | |
| 499 | // Support multilib variants (using different suffix per sub-architecture), which is needed on |
| 500 | // build targets with secondary architectures, as the MTS test suite packaging logic flattens |
| 501 | // all test artifacts into a single `testcases` directory. |
| 502 | compile_multilib: "both", |
| 503 | multilib: { |
| 504 | lib32: { |
| 505 | suffix: "32", |
| 506 | }, |
| 507 | lib64: { |
| 508 | suffix: "64", |
| 509 | }, |
| 510 | }, |
Roland Levillain | 6a2e689 | 2021-07-04 14:21:07 +0100 | [diff] [blame] | 511 | |
| 512 | test_suites: [ |
| 513 | "mts-art", |
| 514 | ], |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 515 | } |
| 516 | |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 517 | cc_library_static { |
| 518 | name: "libdexfile_support_static", |
Martin Stjernholm | e387802 | 2021-11-23 16:29:52 +0000 | [diff] [blame] | 519 | defaults: ["art_defaults"], |
Martin Stjernholm | d3ee98a | 2019-09-23 16:26:50 +0100 | [diff] [blame] | 520 | host_supported: true, |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 521 | srcs: [ |
| 522 | "external/dex_file_supp.cc", |
| 523 | ], |
| 524 | cflags: ["-DSTATIC_LIB"], |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 525 | header_libs: ["libdexfile_external_headers"], |
| 526 | export_header_lib_headers: ["libdexfile_external_headers"], |
| 527 | } |
| 528 | |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 529 | cc_defaults { |
| 530 | name: "libdexfile_support_static_defaults", |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 531 | defaults: [ |
| 532 | "libdexfile_static_defaults", |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 533 | ], |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 534 | whole_static_libs: [ |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 535 | "libdexfile", |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 536 | "libdexfile_support_static", |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 537 | ], |
| 538 | } |
| 539 | |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 540 | cc_defaults { |
| 541 | name: "libdexfiled_support_static_defaults", |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 542 | defaults: [ |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 543 | "libdexfiled_static_defaults", |
| 544 | ], |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 545 | whole_static_libs: [ |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 546 | "libdexfiled", |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 547 | "libdexfile_support_static", |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 548 | ], |
| 549 | } |
| 550 | |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 551 | art_cc_test { |
| 552 | name: "art_libdexfile_support_static_tests", |
Martin Stjernholm | 842555d | 2020-03-23 14:38:47 +0000 | [diff] [blame] | 553 | test_suites: ["general-tests"], |
Martin Stjernholm | 0da7dfc | 2021-05-12 00:38:05 +0100 | [diff] [blame] | 554 | defaults: [ |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 555 | "art_module_source_build_defaults", |
Martin Stjernholm | 0da7dfc | 2021-05-12 00:38:05 +0100 | [diff] [blame] | 556 | "art_test_defaults", |
| 557 | "libdexfile_support_static_defaults", |
| 558 | ], |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 559 | srcs: [ |
| 560 | "external/dex_file_supp_test.cc", |
| 561 | ], |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 562 | } |
| 563 | |
Martin Stjernholm | cbbc8df | 2020-09-30 22:02:32 +0100 | [diff] [blame] | 564 | // For use by external packages allowed to link in static libdexfile_support. |
| 565 | // This is not allowed in any module that may end up in an APEX or platform |
| 566 | // image, so visibility is restrictive. |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 567 | cc_library_static { |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 568 | name: "libdexfile_static", |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 569 | host_supported: true, |
Martin Stjernholm | cbbc8df | 2020-09-30 22:02:32 +0100 | [diff] [blame] | 570 | visibility: [ |
| 571 | // Required for simpleperf, libsimpleperf_record, and libsimpleperf_report |
| 572 | // in the NDK. |
| 573 | "//system/extras/simpleperf", |
| 574 | "//cts/tests/tests/simpleperf", |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 575 | ], |
Martin Stjernholm | cbbc8df | 2020-09-30 22:02:32 +0100 | [diff] [blame] | 576 | // Using libdexfile_support_static_defaults will link in external libs like |
| 577 | // libbase and libz statically as well, which are likely to cause duplicate |
| 578 | // copies in the depending module. |
| 579 | // TODO(b/169885605): Avoid exposing symbols from those libs. |
| 580 | defaults: [ |
| 581 | "art_defaults", |
| 582 | "libdexfile_support_static_defaults", |
| 583 | ], |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 584 | } |
| 585 | |
| 586 | art_cc_test { |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 587 | name: "art_libdexfile_static_tests", |
Martin Stjernholm | 0da7dfc | 2021-05-12 00:38:05 +0100 | [diff] [blame] | 588 | defaults: ["art_test_defaults"], |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 589 | test_suites: ["general-tests"], |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 590 | srcs: [ |
| 591 | "external/dex_file_supp_test.cc", |
| 592 | ], |
Martin Stjernholm | cbbc8df | 2020-09-30 22:02:32 +0100 | [diff] [blame] | 593 | static_libs: [ |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 594 | "libdexfile_static", |
Martin Stjernholm | cbbc8df | 2020-09-30 22:02:32 +0100 | [diff] [blame] | 595 | ], |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 596 | enabled: false, |
| 597 | target: { |
| 598 | linux: { |
| 599 | enabled: true, |
| 600 | }, |
| 601 | }, |
Martin Stjernholm | 49e80cc | 2021-03-03 00:13:09 +0000 | [diff] [blame] | 602 | // TODO(b/181740144): Enable a ubsan check to create a dependency on |
| 603 | // ubsan_minimal. It's needed to be able to link with the prebuilt |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame] | 604 | // libdexfile_static.a, which contains libziparchive.a, which is |
Martin Stjernholm | 49e80cc | 2021-03-03 00:13:09 +0000 | [diff] [blame] | 605 | // built with some ubsan checks |
| 606 | // (https://cs.android.com/android/platform/superproject/+/master:system/libziparchive/Android.bp;l=47-59;drc=c7b498fdf2002194709e40ea58ce39f43684fc14) |
| 607 | // that the SDK snapshots currently don't propagate properly for static |
| 608 | // libs. |
| 609 | sanitize: { |
| 610 | misc_undefined: ["shift"], |
| 611 | }, |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 612 | } |
Colin Cross | 7b55065 | 2020-11-17 10:12:52 -0800 | [diff] [blame] | 613 | |
| 614 | filegroup { |
| 615 | name: "art_libdexfile_dex_instruction_list_header", |
| 616 | srcs: ["dex/dex_instruction_list.h"], |
| 617 | } |