summaryrefslogtreecommitdiffstats
path: root/libbacktrace/Android.bp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2018-06-29 16:05:35 -0700
committerChristopher Ferris <cferris@google.com>2018-10-03 12:42:38 -0700
commit50d81acdc9ae3ed4b9482536751b49586d47087e (patch)
tree346e1c90cb96073e2f1f202292de7cc2223dedb5 /libbacktrace/Android.bp
parent4eb864bf7dc98d8efb61ef3236e62942ca9d87c7 (diff)
downloadsystem_core-50d81acdc9ae3ed4b9482536751b49586d47087e.tar.gz
system_core-50d81acdc9ae3ed4b9482536751b49586d47087e.tar.bz2
system_core-50d81acdc9ae3ed4b9482536751b49586d47087e.zip
Load libbacktrace_test.so explicitly.
This guarantees that the shared library is loaded separately. It allows this test to be run without depending on the shared library being somewhere in the system path since the library is now treated as a file to be dlopen'd. This also fixes some bugs in the deleted shared library test code. The previous test was passing when it was really failing. This new test no longer passes incorrectly. Specifically, the original testlib library only had a debug_frame on 32 bit host, which is not mapped into memory. Adding the exceptions option causes a full eh_frame to be generated. Due to the new dlopen code, also, switching to the new isolated test runner. Also, changing the memory leak checker to use mallinfo since the new unwinder allocates everything using the normal allocator. The use of the isolated runner causes the PSS checker to fail because processes come and go which changes the PSS distribution to the process doing the PSS check. Bug: 109876814 Test: All unit tests pass. Change-Id: I1b77a783979a8beaae0c0b12823267f363e07977
Diffstat (limited to 'libbacktrace/Android.bp')
-rw-r--r--libbacktrace/Android.bp44
1 files changed, 21 insertions, 23 deletions
diff --git a/libbacktrace/Android.bp b/libbacktrace/Android.bp
index c42ae4980..43bcd9823 100644
--- a/libbacktrace/Android.bp
+++ b/libbacktrace/Android.bp
@@ -27,15 +27,6 @@ cc_defaults {
enabled: false,
},
},
-
- multilib: {
- lib32: {
- suffix: "32",
- },
- lib64: {
- suffix: "64",
- },
- },
}
libbacktrace_sources = [
@@ -108,7 +99,7 @@ cc_library {
whole_static_libs: ["libdemangle"],
}
-cc_library_shared {
+cc_test_library {
name: "libbacktrace_test",
defaults: ["libbacktrace_common"],
host_supported: true,
@@ -121,6 +112,21 @@ cc_library_shared {
shared_libs: [
"libunwindstack",
],
+ relative_install_path: "backtrace_test_libs",
+
+ target: {
+ linux_glibc: {
+ // The host uses rosegment, which isn't supported yet.
+ ldflags: [
+ "-Wl,--no-rosegment",
+ ],
+ // This forces the creation of eh_frame with unwind information
+ // for host.
+ cflags: [
+ "-fcxx-exceptions"
+ ],
+ },
+ },
}
//-------------------------------------------------------------------------
@@ -128,12 +134,12 @@ cc_library_shared {
//-------------------------------------------------------------------------
cc_test {
name: "backtrace_test",
+ isolated: true,
defaults: ["libbacktrace_common"],
host_supported: true,
srcs: [
"backtrace_offline_test.cpp",
"backtrace_test.cpp",
- "GetPss.cpp",
],
cflags: [
@@ -143,7 +149,6 @@ cc_test {
],
shared_libs: [
- "libbacktrace_test",
"libbacktrace",
"libbase",
"liblog",
@@ -152,17 +157,10 @@ cc_test {
group_static_libs: true,
- target: {
- android: {
- cflags: ["-DENABLE_PSS_TESTS"],
- shared_libs: [
- "libutils",
- ],
- },
- linux_glibc: {
- static_libs: ["libutils"],
- },
- },
+ // So that the dlopen can find the libbacktrace_test.so.
+ ldflags: [
+ "-Wl,--rpath,${ORIGIN}/../backtrace_test_libs",
+ ],
test_suites: ["device-tests"],
data: [