summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Stjernholm <mast@google.com>2020-03-18 01:15:51 +0000
committerMartin Stjernholm <mast@google.com>2020-03-23 20:59:57 +0000
commit5f3abbbbbbd2edd39f507c7b1ec5c1df912f1814 (patch)
treed8267dadb7793857f2935c4959d48a3f04a423e1
parentc9b55de1ba20b64dac3ae690cf15ffa062cb9de4 (diff)
downloadextras-5f3abbbbbbd2edd39f507c7b1ec5c1df912f1814.tar.gz
Use libdexfile_support_static only for the simpleperf NDK binary.
It contains the full ART dex support which is part of the ART APEX and hence shouldn't go into the system image when ART is updatable. For some libraries that are only used for testing or on host this matters less, but for the sake of simplicity we limit the use of libdexfile_support_static as much as possible. Test: Build and boot Test: mmm system/extras/simpleperf/ Test: atest simpleperf_unit_test Bug: 142944931 Bug: 151466650 Change-Id: Iae9b57aded398e6f3b56329e3e056f7bfd8ed0b5 Merged-In: Iae9b57aded398e6f3b56329e3e056f7bfd8ed0b5
-rw-r--r--simpleperf/Android.bp23
1 files changed, 22 insertions, 1 deletions
diff --git a/simpleperf/Android.bp b/simpleperf/Android.bp
index 089a71ad..f1f2d6bc 100644
--- a/simpleperf/Android.bp
+++ b/simpleperf/Android.bp
@@ -166,7 +166,6 @@ cc_defaults {
linux: {
static_libs: [
"libunwindstack",
- "libdexfile_support_static",
"libcutils",
"libprocinfo",
"libevent",
@@ -327,6 +326,13 @@ cc_library_static {
"libbuildversion",
],
use_version_lib: false,
+
+ target: {
+ linux: {
+ // See note for libdexfile_support_static in simpleperf_ndk.
+ static_libs: ["libdexfile_support"],
+ },
+ },
}
// simpleperf shipped in system image
@@ -406,6 +412,14 @@ cc_binary {
dir: "simpleperf/darwin/x86_64",
},
},
+ linux: {
+ // In the NDK we need libdexfile_support_static which links
+ // libdexfile_external and its ART dependencies statically. However
+ // in other libraries we must use libdexfile_support, which dlopen's
+ // libdexfile_external.so from the ART APEX, to avoid getting ART
+ // internals in the system image.
+ static_libs: ["libdexfile_support_static"],
+ },
linux_glibc_x86: {
dist: {
dir: "simpleperf/linux/x86",
@@ -450,6 +464,10 @@ cc_library {
windows: {
enabled: false,
},
+ linux: {
+ // See note for libdexfile_support_static in simpleperf_ndk.
+ static_libs: ["libdexfile_support"],
+ },
},
}
@@ -473,6 +491,9 @@ cc_library_shared {
},
linux: {
ldflags: ["-Wl,--exclude-libs,ALL"],
+ // See note for libdexfile_support_static in simpleperf_ndk. This is
+ // part of the NDK, so use libdexfile_support_static.
+ static_libs: ["libdexfile_support_static"],
},
darwin: {
dist: {