summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorMartin Stjernholm <mast@google.com>2021-06-21 23:33:33 +0100
committerMartin Stjernholm <mast@google.com>2021-06-24 12:31:36 +0100
commit306a39ffe4b75c98e262c481c49c672fa33ccbc6 (patch)
tree7fb7960b837ace7012c62e708a19d2732cb96de6 /runtime
parente7e4a967a88d84987e23f0b1f42deb0c440334ec (diff)
Clean up ART APEX manifests.
manifest-art.json: Rely on the build system to populate all required libs. Besides some duplicate entries, this drops libicuuc.so, libicui18n.so, and libneuralnetworks.so from the required list. None of those libraries are dependencies of the ART module itself, and hence don't get loaded from the ART namespace. They used to be necessary before linkerconfig supported creating links for JNI libs and from public.libraries.txt, and when libnativeloader still defaulted to the ART namespace for loading such libs. test_apex_manifest.json: Used by test_com.android.art and should be identical to manifest-art.json except for the version number. Besides the above, this file contained several stale libraries. Also try to configure proper runtime_libs dependencies for libart(d) for the things it dlopen's from the ART namespace, although most libraries cannot be listed there for various reasons. Cherry-picked from https://r.android.com/1742176. Test: m droid deapexer deapexer info \ out/target/product/vsoc_x86_64/system/apex/com.android.art.capex Compare the output before and after this CL. Test: m test_com.android.art deapexer deapexer info \ out/target/product/vsoc_x86_64/obj/ETC/test_com.android.art_intermediates/test_com.android.art.apex Compare the output before and after this CL. Bug: 184148353 Change-Id: I0d9c2a090702a95551208aad4be97ea867004a3c Merged-In: I0d9c2a090702a95551208aad4be97ea867004a3c
Diffstat (limited to 'runtime')
-rw-r--r--runtime/Android.bp17
-rw-r--r--runtime/runtime.cc4
2 files changed, 21 insertions, 0 deletions
diff --git a/runtime/Android.bp b/runtime/Android.bp
index 1434fc8725..ed714bebd3 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -367,6 +367,7 @@ libart_cc_defaults {
},
},
},
+
target: {
android: {
srcs: [
@@ -419,6 +420,7 @@ libart_cc_defaults {
],
},
},
+
generated_sources: [
"art_operator_srcs",
],
@@ -426,6 +428,7 @@ libart_cc_defaults {
generated_headers: ["cpp-define-generator-asm-support"],
// export our headers so the libart-gtest targets can use it as well.
export_generated_headers: ["cpp-define-generator-asm-support"],
+
header_libs: [
"art_cmdlineparser_headers",
"cpp-define-generator-definitions",
@@ -448,6 +451,20 @@ libart_cc_defaults {
"libunwindstack",
],
static_libs: ["libodrstatslog"],
+
+ runtime_libs: [
+ // Libraries loaded at runtime. Exceptions:
+ // - libart(d)-compiler.so and libopenjdk(d).so cannot be listed here
+ // due to cyclic dependency.
+ // - 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
+ // listed here to avoid visibility issues. Instead it's linked from
+ // the ART module namespace through an entry in requireNativeLibs in
+ // manifest-art.json.
+ "libjavacore",
+ ],
+
export_include_dirs: ["."],
// ART's macros.h depends on libbase's macros.h.
// Note: runtime_options.h depends on cmdline. But we don't really want to export this
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 370ee02790..3235eea3ab 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -2037,6 +2037,10 @@ void Runtime::InitNativeMethods() {
// a regular JNI libraries with a regular JNI_OnLoad. Most JNI libraries can
// just use System.loadLibrary, but libcore can't because it's the library
// that implements System.loadLibrary!
+ //
+ // By setting calling class to java.lang.Object, the caller location for these
+ // JNI libs is core-oj.jar in the ART APEX, and hence they are loaded from the
+ // com_android_art linker namespace.
// libicu_jni has to be initialized before libopenjdk{d} due to runtime dependency from
// libopenjdk{d} to Icu4cMetadata native methods in libicu_jni. See http://b/143888405