diff options
author | 2024-09-30 22:55:02 +0100 | |
---|---|---|
committer | 2024-10-01 13:34:38 +0000 | |
commit | 1c6c18df9ac0b2539568ccefe7245df83d24ebd4 (patch) | |
tree | 995e2e0a919fb3b0658a29bd7f550623c4f3e273 | |
parent | c4064f4d533d7808d34f275a9e4a3048a3f9f591 (diff) |
Clean up some internal libraries from the native library lists.
Replace `requires` with `runtime_libs` where possible to avoid listing
transitive deps explicitly in the APEXes. Update docs for those that
still cannot be dealt with correctly.
This CL is a nop - all ART APEXes are bit identical after this change.
Add libopenjdkjvm explicitly to test_broken_com.android.art to
accomplish that - it'll be cleaned up in a later CL.
Also clean up unused libdt_fd_forwardd debug lib.
#codehealth
Test: lunch armv8
m test_broken_com.android.art test_jitzygote_com.android.art \
test_imgdiag_com.android.art com.android.art \
com.android.art.debug com.android.art.testing
Check that the .apex files remain bit identical.
Bug: 370034097
Change-Id: I4d36d83dcd4c59f1beb57bae80c881eb7d820dde
-rw-r--r-- | adbconnection/Android.bp | 9 | ||||
-rw-r--r-- | build/apex/Android.bp | 35 | ||||
-rw-r--r-- | dt_fd_forward/Android.bp | 16 | ||||
-rw-r--r-- | runtime/Android.bp | 13 |
4 files changed, 29 insertions, 44 deletions
diff --git a/adbconnection/Android.bp b/adbconnection/Android.bp index 9763d662db..941aac5ed6 100644 --- a/adbconnection/Android.bp +++ b/adbconnection/Android.bp @@ -43,18 +43,11 @@ cc_defaults { "libbase", "libadbconnection_client", ], - target: { - host: { - }, - darwin: { - enabled: false, - }, - }, header_libs: [ "libnativehelper_header_only", "dt_fd_forward_export", ], - required: [ + runtime_libs: [ "libjdwp", "libdt_fd_forward", ], diff --git a/build/apex/Android.bp b/build/apex/Android.bp index 312d40477d..8de902bb45 100644 --- a/build/apex/Android.bp +++ b/build/apex/Android.bp @@ -49,18 +49,17 @@ art_runtime_base_native_shared_libs_minus_libart = [ "libnativehelper", "libnativeloader", "libsigchain", - // libadbconnection is internal and loaded with dlopen(), but it cannot use - // "required" because of cyclic dependency (b/124505714). + // These libraries are loaded at runtime from libart (either through + // dlopen() or by instructing the user to load with -Xplugin), but they + // cannot be runtime_lib dependencies from there because of cyclic + // dependencies (b/124505714). "libadbconnection", - // TODO(b/124476339): Clean up the following libraries once "required" - // dependencies work with APEX libraries. - "libdt_fd_forward", - "libdt_socket", - "libjdwp", - "libnpt", - "libopenjdkjvm", "libopenjdkjvmti", "libperfetto_hprof", + // Likewise libart is loaded at runtime from libnativeloader and also must + // be specified explicitly due to cyclic dependencies. However, it's not + // listed directly here since test_broken_com.android.art uses a different + // implementation. ] // Actual version of ART runtime base libs, used in non-test ART APEXes. art_runtime_base_native_shared_libs = ["libart"] + @@ -74,14 +73,8 @@ art_runtime_debug_native_shared_libs = [ "libadbconnectiond", "libartd", "libdexfiled", - "libopenjdkjvmd", "libopenjdkjvmtid", "libperfetto_hprofd", - // Libraries needed to execute ART run-tests. - // TODO(b/124476339): When bug 124476339 is fixed, add these libraries as `runtime_libs` - // dependencies of `libartd-compiler`, and remove them here. - "libart-disassembler", - "libartd-disassembler", ] // Debug binaries for which both 32- and 64-bit versions are built, if possible. @@ -136,11 +129,13 @@ java_library { libcore_native_shared_libs = [ // External API (having APEX stubs). "libandroidio", - // TODO(b/124476339): Clean up the following libraries once "required" - // dependencies work with APEX libraries. - "libexpat", - "libjavacore", + // This library is loaded at runtime from libart but cannot be a runtime_lib + // dependency from there because of cyclic dependencies (b/124505714). "libopenjdk", + // These libraries are internal dependencies in libcore, but they don't get + // pulled in automatically into apex_test modules. + "libexpat", + "libopenjdkjvm", ] libcore_debug_native_shared_libs = [ "libopenjdkd", @@ -267,7 +262,7 @@ apex_test { // unwanted_transitive_deps we can ensure `libart` gets excluded // anyway. // TODO(mast): Add back the binaries and clean this up. - native_shared_libs: art_runtime_base_broken_native_shared_libs, + native_shared_libs: art_runtime_base_broken_native_shared_libs + ["libopenjdkjvm"], unwanted_transitive_deps: ["libart"], compile_multilib: "both", diff --git a/dt_fd_forward/Android.bp b/dt_fd_forward/Android.bp index 08f52c7775..9236fd1fe4 100644 --- a/dt_fd_forward/Android.bp +++ b/dt_fd_forward/Android.bp @@ -47,8 +47,8 @@ license { ], } -cc_defaults { - name: "dt_fd_forward-defaults", +art_cc_library { + name: "libdt_fd_forward", host_supported: true, srcs: ["dt_fd_forward.cc"], defaults: ["art_defaults"], @@ -74,21 +74,9 @@ cc_defaults { "dt_fd_forward_export", "art_libartbase_headers", // For strlcpy emulation. ], -} -art_cc_library { - name: "libdt_fd_forward", - defaults: ["dt_fd_forward-defaults"], apex_available: [ "com.android.art", "com.android.art.debug", ], } - -art_cc_library { - name: "libdt_fd_forwardd", - defaults: [ - "art_debug_defaults", - "dt_fd_forward-defaults", - ], -} diff --git a/runtime/Android.bp b/runtime/Android.bp index 8e76169f6a..ff9870e908 100644 --- a/runtime/Android.bp +++ b/runtime/Android.bp @@ -216,8 +216,17 @@ cc_defaults { }, runtime_libs: [ // Libraries loaded at runtime. Exceptions: - // - libart(d)-compiler.so and libopenjdk(d).so cannot be listed here - // due to cyclic dependency. + // + // - Libraries that cannot be listed here due to cyclic dependency: + // - libopenjdk(d) + // - libadbconnection(d) + // - libopenjdkjvmti(d) + // - This one is not loaded programmatically with dlopen, but the + // user needs to specify it with -Xplugin. + // - libperfetto_hprof(d) + // All libraries above needs to be explicitly added to the ART APEX + // (cf. art/build/apex/Android.bp). + // // - libicu_jni.so is only loaded to handle dependency order in VM // startup (see Runtime::InitNativeMethods), but its API is internal // to com.android.i18n and not used by ART/libcore. Therefore it's not |