Allow visibility on libdexfile for all libdexfile_support users.
Also add a note that libdexfile_support users also need to depend on
libdexfile.
Test: m droid
Bug: 197856821
Bug: 169779783
Change-Id: I80162942a6557b0309ccde28c058cdf66c1fa250
diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp
index 5825ead..47f2e29 100644
--- a/libdexfile/Android.bp
+++ b/libdexfile/Android.bp
@@ -163,7 +163,12 @@
art_cc_library {
name: "libdexfile",
visibility: [
- // Allow libunwindstack to list this as a runtime library.
+ // Allow libdexfile_support users to list this as a runtime_libs
+ // dependency - see comment for libdexfile_support. It shouldn't be used
+ // for any other purpose.
+ "//external/perfetto",
+ "//system/core/debuggerd",
+ "//system/extras/simpleperf",
"//system/unwinding/libunwindstack",
],
defaults: [
@@ -373,6 +378,14 @@
// dependency on dex file logic. It is therefore safe to use from binaries
// compiled without dex file support, given they won't encounter any dex file
// stack frames.
+//
+// IMPORTANT: When adding a static_libs dependency on this library, please
+// remember to also add a corresponding
+//
+// runtime_libs: ["libdexfile"],
+//
+// That is necessary since Soong doesn't propagate dependencies transitively for
+// static libraries (b/169779783).
art_cc_library_static {
name: "libdexfile_support",
visibility: ["//visibility:public"],