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, |
| 30 | srcs: [ |
David Sehr | 1f01016 | 2018-05-15 08:59:32 -0700 | [diff] [blame] | 31 | "dex/art_dex_file_loader.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 32 | "dex/compact_dex_file.cc", |
Mathieu Chartier | 5e3cfa2 | 2018-02-20 16:53:37 -0800 | [diff] [blame] | 33 | "dex/compact_offset_table.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 34 | "dex/descriptors_names.cc", |
| 35 | "dex/dex_file.cc", |
| 36 | "dex/dex_file_exception_helpers.cc", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 37 | "dex/dex_file_layout.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 38 | "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 Sehr | 67bf42e | 2018-02-26 16:43:04 -0800 | [diff] [blame] | 43 | "dex/primitive.cc", |
Andreas Gampe | ad1aa63 | 2019-01-02 10:30:54 -0800 | [diff] [blame] | 44 | "dex/signature.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 45 | "dex/standard_dex_file.cc", |
David Sehr | 9c4a015 | 2018-04-05 12:23:54 -0700 | [diff] [blame] | 46 | "dex/type_lookup_table.cc", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 47 | "dex/utf.cc", |
| 48 | ], |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame^] | 49 | header_libs: [ |
| 50 | "jni_headers", |
| 51 | "libdexfile_external_headers", |
| 52 | ], |
| 53 | export_header_lib_headers: [ |
| 54 | "jni_headers", |
| 55 | "libdexfile_external_headers", |
| 56 | ], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 57 | target: { |
| 58 | android: { |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame^] | 59 | srcs: [ |
| 60 | "external/dex_file_ext.cc", |
| 61 | ], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 62 | static_libs: [ |
| 63 | "libziparchive", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 64 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 65 | shared_libs: [ |
Jiyong Park | b1c8e16 | 2020-05-18 19:04:42 +0900 | [diff] [blame] | 66 | // libz provides a stub from platform, shouldn't be statically linked |
| 67 | "libz", |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 68 | // For MemMap. |
| 69 | "libartpalette", |
| 70 | "liblog", |
| 71 | // For common macros. |
| 72 | "libbase", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 73 | ], |
| 74 | export_shared_lib_headers: [ |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 75 | "libbase", |
| 76 | ], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 77 | }, |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 78 | not_windows: { |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame^] | 79 | srcs: [ |
| 80 | "external/dex_file_ext.cc", |
| 81 | ], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 82 | shared_libs: [ |
| 83 | "libziparchive", |
| 84 | "libz", |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 85 | // For MemMap. |
| 86 | "libartpalette", |
| 87 | "liblog", |
| 88 | // For common macros. |
| 89 | "libbase", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 90 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 91 | export_shared_lib_headers: [ |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 92 | "libbase", |
| 93 | ], |
| 94 | }, |
| 95 | windows: { |
| 96 | static_libs: [ |
| 97 | "libziparchive", |
| 98 | "libz", |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 99 | // For MemMap. |
| 100 | "libartpalette", |
| 101 | "liblog", |
| 102 | // For common macros. |
| 103 | "libbase", |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 104 | ], |
| 105 | export_static_lib_headers: [ |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 106 | "libbase", |
| 107 | ], |
| 108 | cflags: ["-Wno-thread-safety"], |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 109 | }, |
David Srbecky | d53f606 | 2019-03-22 14:55:21 +0000 | [diff] [blame] | 110 | darwin: { |
| 111 | enabled: true, |
| 112 | }, |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 113 | }, |
| 114 | generated_sources: ["dexfile_operator_srcs"], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 115 | export_include_dirs: ["."], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 116 | } |
| 117 | |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 118 | cc_defaults { |
| 119 | name: "libdexfile_static_base_defaults", |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 120 | whole_static_libs: [ |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 121 | "libbase", |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 122 | "liblog", |
Nicolas Geoffray | 65ed42a | 2018-10-30 12:33:04 +0000 | [diff] [blame] | 123 | "libz", |
| 124 | "libziparchive", |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 125 | ], |
| 126 | } |
| 127 | |
| 128 | cc_defaults { |
| 129 | name: "libdexfile_static_defaults", |
| 130 | defaults: [ |
| 131 | "libartbase_static_defaults", |
| 132 | "libdexfile_static_base_defaults", |
| 133 | ], |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 134 | defaults_visibility: [ |
| 135 | "//art:__subpackages__", |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 136 | ], |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 137 | whole_static_libs: ["libdexfile"], |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | cc_defaults { |
| 141 | name: "libdexfiled_static_defaults", |
| 142 | defaults: [ |
| 143 | "libartbased_static_defaults", |
| 144 | "libdexfile_static_base_defaults", |
| 145 | ], |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 146 | whole_static_libs: ["libdexfiled"], |
Andreas Gampe | ec5ed06 | 2018-01-26 16:20:02 -0800 | [diff] [blame] | 147 | } |
| 148 | |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 149 | gensrcs { |
| 150 | name: "dexfile_operator_srcs", |
Alex Light | b69d2d3 | 2018-02-21 13:37:17 -0800 | [diff] [blame] | 151 | cmd: "$(location generate_operator_out) art/libdexfile $(in) > $(out)", |
| 152 | tools: ["generate_operator_out"], |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 153 | srcs: [ |
| 154 | "dex/dex_file.h", |
David Sehr | c431b9d | 2018-03-02 12:01:51 -0800 | [diff] [blame] | 155 | "dex/dex_file_layout.h", |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 156 | "dex/dex_instruction.h", |
| 157 | "dex/dex_instruction_utils.h", |
| 158 | "dex/invoke_type.h", |
| 159 | ], |
| 160 | output_extension: "operator_out.cc", |
| 161 | } |
| 162 | |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 163 | art_cc_library { |
| 164 | name: "libdexfile", |
Christopher Ferris | 0d38e85 | 2019-12-11 09:37:19 -0800 | [diff] [blame] | 165 | defaults: [ |
| 166 | "libdexfile_defaults", |
| 167 | "libart_nativeunwind_defaults", |
| 168 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 169 | target: { |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 170 | android: { |
| 171 | shared_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 172 | "libartbase", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 173 | ], |
| 174 | export_shared_lib_headers: [ |
| 175 | "libartbase", |
| 176 | ], |
| 177 | }, |
| 178 | not_windows: { |
| 179 | shared_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 180 | "libartbase", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 181 | ], |
| 182 | export_shared_lib_headers: [ |
| 183 | "libartbase", |
| 184 | ], |
| 185 | }, |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 186 | windows: { |
| 187 | enabled: true, |
| 188 | shared: { |
| 189 | enabled: false, |
| 190 | }, |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 191 | static_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_static_lib_headers: [ |
| 195 | "libartbase", |
| 196 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 197 | }, |
| 198 | }, |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 199 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 200 | "com.android.art", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 201 | "com.android.art.debug", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 202 | ], |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame^] | 203 | stubs: { |
| 204 | // TODO(b/143978909): Rename and move this file to this directory. |
| 205 | symbol_file: "external/libdexfile_external.map.txt", |
| 206 | versions: ["1"], |
| 207 | }, |
David Sehr | 334b9d7 | 2018-02-12 18:27:56 -0800 | [diff] [blame] | 208 | } |
| 209 | |
David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 210 | art_cc_library { |
| 211 | name: "libdexfiled", |
| 212 | defaults: [ |
| 213 | "art_debug_defaults", |
| 214 | "libdexfile_defaults", |
| 215 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 216 | target: { |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 217 | android: { |
| 218 | shared_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 219 | "libartbased", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 220 | ], |
| 221 | export_shared_lib_headers: [ |
| 222 | "libartbased", |
| 223 | ], |
| 224 | }, |
| 225 | not_windows: { |
| 226 | shared_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 227 | "libartbased", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 228 | ], |
| 229 | export_shared_lib_headers: [ |
| 230 | "libartbased", |
| 231 | ], |
| 232 | }, |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 233 | windows: { |
| 234 | enabled: true, |
| 235 | shared: { |
| 236 | enabled: false, |
| 237 | }, |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 238 | static_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 239 | "libartbased", |
David Srbecky | 7711c35 | 2019-04-10 17:50:12 +0100 | [diff] [blame] | 240 | ], |
| 241 | export_static_lib_headers: [ |
| 242 | "libartbased", |
| 243 | ], |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 244 | }, |
| 245 | }, |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 246 | apex_available: [ |
| 247 | "com.android.art.debug", |
Martin Stjernholm | a2f48a4 | 2021-04-09 13:23:21 +0100 | [diff] [blame] | 248 | // TODO(b/183882457): This lib doesn't go into com.android.art, but |
| 249 | // apex_available lists need to be the same for internal libs to avoid |
| 250 | // stubs, and libartd depends on this. |
| 251 | "com.android.art", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 252 | ], |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame^] | 253 | stubs: { |
| 254 | // TODO(b/143978909): Rename and move this file to this directory. |
| 255 | symbol_file: "external/libdexfile_external.map.txt", |
| 256 | versions: ["1"], |
| 257 | }, |
David Sehr | fcbe15c | 2018-02-15 09:41:13 -0800 | [diff] [blame] | 258 | } |
| 259 | |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 260 | art_cc_test { |
| 261 | name: "art_libdexfile_tests", |
| 262 | defaults: [ |
| 263 | "art_gtest_defaults", |
| 264 | ], |
| 265 | srcs: [ |
| 266 | "dex/art_dex_file_loader_test.cc", |
| 267 | "dex/class_accessor_test.cc", |
| 268 | "dex/code_item_accessors_test.cc", |
| 269 | "dex/compact_dex_file_test.cc", |
| 270 | "dex/compact_offset_table_test.cc", |
| 271 | "dex/descriptors_names_test.cc", |
| 272 | "dex/test_dex_file_builder_test.cc", |
| 273 | "dex/dex_file_loader_test.cc", |
| 274 | "dex/dex_file_verifier_test.cc", |
| 275 | "dex/dex_instruction_test.cc", |
| 276 | "dex/primitive_test.cc", |
| 277 | "dex/string_reference_test.cc", |
| 278 | "dex/type_lookup_table_test.cc", |
| 279 | "dex/utf_test.cc", |
| 280 | ], |
David Srbecky | 4a88a5a | 2020-05-05 16:21:57 +0100 | [diff] [blame] | 281 | data: [ |
| 282 | ":art-gtest-jars-GetMethodSignature", |
| 283 | ":art-gtest-jars-Lookup", |
| 284 | ":art-gtest-jars-Main", |
| 285 | ":art-gtest-jars-MultiDex", |
| 286 | ":art-gtest-jars-Nested", |
| 287 | ], |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 288 | header_libs: ["jni_headers"], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 289 | shared_libs: [ |
| 290 | "libbacktrace", |
| 291 | "libziparchive", |
| 292 | ], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 293 | } |
| 294 | |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 295 | cc_library_headers { |
| 296 | name: "libdexfile_external_headers", |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 297 | visibility: ["//visibility:public"], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 298 | host_supported: true, |
| 299 | header_libs: ["libbase_headers"], |
| 300 | export_header_lib_headers: ["libbase_headers"], |
| 301 | export_include_dirs: ["external/include"], |
| 302 | |
| 303 | target: { |
| 304 | windows: { |
| 305 | enabled: true, |
| 306 | }, |
| 307 | }, |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 308 | |
| 309 | apex_available: [ |
| 310 | "//apex_available:platform", |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 311 | "com.android.art", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 312 | "com.android.art.debug", |
Martin Stjernholm | 694f012 | 2020-10-30 02:23:24 +0000 | [diff] [blame] | 313 | "com.android.media", |
| 314 | "com.android.runtime", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 315 | ], |
Nicolas Geoffray | ec388c0 | 2021-03-03 22:09:06 +0000 | [diff] [blame] | 316 | min_sdk_version: "S", |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 317 | } |
| 318 | |
Paul Duffin | 4345aac | 2019-07-17 15:51:54 +0100 | [diff] [blame] | 319 | // Make dex_instruction_list.h available for tools/jvmti-agents/titrace |
| 320 | cc_library_headers { |
| 321 | name: "libdexfile_all_headers", |
| 322 | visibility: ["//art:__subpackages__"], |
| 323 | host_supported: true, |
| 324 | export_include_dirs: ["."], |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 325 | |
| 326 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 327 | "com.android.art", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 328 | "com.android.art.debug", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 329 | ], |
Nicolas Geoffray | ec388c0 | 2021-03-03 22:09:06 +0000 | [diff] [blame] | 330 | min_sdk_version: "S", |
Paul Duffin | 4345aac | 2019-07-17 15:51:54 +0100 | [diff] [blame] | 331 | } |
| 332 | |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 333 | art_cc_test { |
| 334 | name: "art_libdexfile_external_tests", |
| 335 | host_supported: true, |
Martin Stjernholm | 842555d | 2020-03-23 14:38:47 +0000 | [diff] [blame] | 336 | test_suites: ["general-tests"], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 337 | srcs: [ |
| 338 | "external/dex_file_ext_c_test.c", |
| 339 | ], |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 340 | header_libs: [ |
| 341 | "jni_headers", |
| 342 | "libdexfile_external_headers", |
| 343 | ], |
Martin Stjernholm | fdb2f60 | 2019-01-09 14:47:00 +0000 | [diff] [blame] | 344 | } |
| 345 | |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 346 | // 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] | 347 | // (non-ART) users. |
| 348 | // |
| 349 | // This library dlopens libdexfile_external on first use, so there is no build |
| 350 | // time dependency on dex file logic. It is therefore safe to use from binaries |
| 351 | // compiled without dex file support, given they won't encounter any dex file |
| 352 | // stack frames. |
David Srbecky | 1cf46a3 | 2020-06-22 15:39:00 +0100 | [diff] [blame] | 353 | art_cc_library { |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 354 | name: "libdexfile_support", |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 355 | visibility: ["//visibility:public"], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 356 | host_supported: true, |
| 357 | srcs: [ |
| 358 | "external/dex_file_supp.cc", |
| 359 | ], |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame^] | 360 | runtime_libs: ["libdexfile"], |
David Srbecky | 2ddb98b | 2021-03-09 00:37:04 +0000 | [diff] [blame] | 361 | shared_libs: [ |
| 362 | "liblog", |
| 363 | "libbase", |
| 364 | ], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 365 | header_libs: ["libdexfile_external_headers"], |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 366 | export_header_lib_headers: ["libdexfile_external_headers"], |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 367 | |
| 368 | apex_available: [ |
| 369 | "//apex_available:platform", |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 370 | "com.android.art", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 371 | "com.android.art.debug", |
Martin Stjernholm | 694f012 | 2020-10-30 02:23:24 +0000 | [diff] [blame] | 372 | "com.android.media", |
| 373 | "com.android.media.swcodec", |
| 374 | "com.android.runtime", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 375 | ], |
Nicolas Geoffray | ec388c0 | 2021-03-03 22:09:06 +0000 | [diff] [blame] | 376 | min_sdk_version: "S", |
Martin Stjernholm | b3d2e83 | 2018-11-15 18:09:35 +0000 | [diff] [blame] | 377 | } |
Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 378 | |
| 379 | art_cc_test { |
| 380 | name: "art_libdexfile_support_tests", |
Roland Levillain | 61f0716 | 2019-06-26 12:44:04 +0100 | [diff] [blame] | 381 | defaults: [ |
| 382 | "art_test_defaults", |
| 383 | ], |
Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 384 | host_supported: true, |
Martin Stjernholm | 842555d | 2020-03-23 14:38:47 +0000 | [diff] [blame] | 385 | test_suites: ["general-tests"], |
Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 386 | srcs: [ |
| 387 | "external/dex_file_supp_test.cc", |
| 388 | ], |
| 389 | shared_libs: [ |
| 390 | "libartbase", |
| 391 | "libbase", |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame^] | 392 | "libdexfile", |
Martin Stjernholm | 750bf04 | 2019-01-09 22:51:12 +0000 | [diff] [blame] | 393 | "libdexfile_support", |
| 394 | ], |
| 395 | } |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 396 | |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 397 | cc_library_static { |
| 398 | name: "libdexfile_support_static", |
Martin Stjernholm | d3ee98a | 2019-09-23 16:26:50 +0100 | [diff] [blame] | 399 | host_supported: true, |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 400 | srcs: [ |
| 401 | "external/dex_file_supp.cc", |
| 402 | ], |
| 403 | cflags: ["-DSTATIC_LIB"], |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 404 | header_libs: ["libdexfile_external_headers"], |
| 405 | export_header_lib_headers: ["libdexfile_external_headers"], |
| 406 | } |
| 407 | |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 408 | cc_defaults { |
| 409 | name: "libdexfile_support_static_defaults", |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 410 | defaults: [ |
| 411 | "libdexfile_static_defaults", |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 412 | ], |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 413 | whole_static_libs: [ |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame^] | 414 | "libdexfile", |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 415 | "libdexfile_support_static", |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 416 | ], |
| 417 | } |
| 418 | |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 419 | cc_defaults { |
| 420 | name: "libdexfiled_support_static_defaults", |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 421 | defaults: [ |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 422 | "libdexfiled_static_defaults", |
| 423 | ], |
Martin Stjernholm | 35f765b | 2020-09-23 00:38:38 +0100 | [diff] [blame] | 424 | whole_static_libs: [ |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame^] | 425 | "libdexfiled", |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 426 | "libdexfile_support_static", |
Martin Stjernholm | 621afb4 | 2019-09-23 22:01:36 +0100 | [diff] [blame] | 427 | ], |
| 428 | } |
| 429 | |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 430 | art_cc_test { |
| 431 | name: "art_libdexfile_support_static_tests", |
| 432 | host_supported: true, |
Martin Stjernholm | 842555d | 2020-03-23 14:38:47 +0000 | [diff] [blame] | 433 | test_suites: ["general-tests"], |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 434 | defaults: ["libdexfile_support_static_defaults"], |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 435 | srcs: [ |
| 436 | "external/dex_file_supp_test.cc", |
| 437 | ], |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 438 | } |
| 439 | |
Martin Stjernholm | cbbc8df | 2020-09-30 22:02:32 +0100 | [diff] [blame] | 440 | // For use by external packages allowed to link in static libdexfile_support. |
| 441 | // This is not allowed in any module that may end up in an APEX or platform |
| 442 | // image, so visibility is restrictive. |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 443 | cc_library_static { |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame^] | 444 | name: "libdexfile_static", |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 445 | host_supported: true, |
Martin Stjernholm | cbbc8df | 2020-09-30 22:02:32 +0100 | [diff] [blame] | 446 | visibility: [ |
| 447 | // Required for simpleperf, libsimpleperf_record, and libsimpleperf_report |
| 448 | // in the NDK. |
| 449 | "//system/extras/simpleperf", |
| 450 | "//cts/tests/tests/simpleperf", |
Martin Stjernholm | fe94b1c | 2019-01-31 17:40:39 +0000 | [diff] [blame] | 451 | ], |
Martin Stjernholm | cbbc8df | 2020-09-30 22:02:32 +0100 | [diff] [blame] | 452 | // Using libdexfile_support_static_defaults will link in external libs like |
| 453 | // libbase and libz statically as well, which are likely to cause duplicate |
| 454 | // copies in the depending module. |
| 455 | // TODO(b/169885605): Avoid exposing symbols from those libs. |
| 456 | defaults: [ |
| 457 | "art_defaults", |
| 458 | "libdexfile_support_static_defaults", |
| 459 | ], |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 460 | } |
| 461 | |
| 462 | art_cc_test { |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame^] | 463 | name: "art_libdexfile_static_tests", |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 464 | host_supported: true, |
| 465 | test_suites: ["general-tests"], |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 466 | srcs: [ |
| 467 | "external/dex_file_supp_test.cc", |
| 468 | ], |
Martin Stjernholm | cbbc8df | 2020-09-30 22:02:32 +0100 | [diff] [blame] | 469 | static_libs: [ |
Martin Stjernholm | d3e9ff3 | 2021-03-16 00:44:25 +0000 | [diff] [blame^] | 470 | "libdexfile_static", |
Martin Stjernholm | cbbc8df | 2020-09-30 22:02:32 +0100 | [diff] [blame] | 471 | ], |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 472 | enabled: false, |
| 473 | target: { |
| 474 | linux: { |
| 475 | enabled: true, |
| 476 | }, |
| 477 | }, |
Martin Stjernholm | 49e80cc | 2021-03-03 00:13:09 +0000 | [diff] [blame] | 478 | // TODO(b/181740144): Enable a ubsan check to create a dependency on |
| 479 | // 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^] | 480 | // libdexfile_static.a, which contains libziparchive.a, which is |
Martin Stjernholm | 49e80cc | 2021-03-03 00:13:09 +0000 | [diff] [blame] | 481 | // built with some ubsan checks |
| 482 | // (https://cs.android.com/android/platform/superproject/+/master:system/libziparchive/Android.bp;l=47-59;drc=c7b498fdf2002194709e40ea58ce39f43684fc14) |
| 483 | // that the SDK snapshots currently don't propagate properly for static |
| 484 | // libs. |
| 485 | sanitize: { |
| 486 | misc_undefined: ["shift"], |
| 487 | }, |
Martin Stjernholm | 68e5db5 | 2020-09-23 20:43:56 +0100 | [diff] [blame] | 488 | } |
Colin Cross | 7b55065 | 2020-11-17 10:12:52 -0800 | [diff] [blame] | 489 | |
| 490 | filegroup { |
| 491 | name: "art_libdexfile_dex_instruction_list_header", |
| 492 | srcs: ["dex/dex_instruction_list.h"], |
| 493 | } |