diff --git a/debuggerd/Android.bp b/debuggerd/Android.bp index 2529516da..3a882ea8f 100644 --- a/debuggerd/Android.bp +++ b/debuggerd/Android.bp @@ -240,11 +240,16 @@ cc_library_static { "libdebuggerd/backtrace.cpp", "libdebuggerd/gwp_asan.cpp", "libdebuggerd/open_files_list.cpp", + "libdebuggerd/scudo.cpp", "libdebuggerd/tombstone.cpp", "libdebuggerd/tombstone_proto.cpp", "libdebuggerd/utility.cpp", ], + cflags: [ + "-DUSE_SCUDO", + ], + local_include_dirs: ["libdebuggerd/include"], export_include_dirs: ["libdebuggerd/include"], @@ -256,6 +261,7 @@ cc_library_static { "bionic_libc_platform_headers", "gwp_asan_headers", "liblog_headers", + "scudo_headers", ], static_libs: [ @@ -273,6 +279,7 @@ cc_library_static { "libtombstone_proto", "libprocinfo", "libprotobuf-cpp-lite", + "libscudo", ], target: { @@ -312,11 +319,9 @@ cc_library_static { cflags: ["-DROOT_POSSIBLE"], }, - malloc_not_svelte: { - cflags: ["-DUSE_SCUDO"], - whole_static_libs: ["libscudo"], - srcs: ["libdebuggerd/scudo.cpp"], - header_libs: ["scudo_headers"], + malloc_low_memory: { + cflags: ["-UUSE_SCUDO"], + exclude_static_libs: ["libscudo"], }, }, apex_available: [ diff --git a/debuggerd/libdebuggerd/include/libdebuggerd/scudo.h b/debuggerd/libdebuggerd/include/libdebuggerd/scudo.h index a506859a4..89bf5a96d 100644 --- a/debuggerd/libdebuggerd/include/libdebuggerd/scudo.h +++ b/debuggerd/libdebuggerd/include/libdebuggerd/scudo.h @@ -16,6 +16,8 @@ #pragma once +#if defined(USE_SCUDO) + #include "types.h" #include "utility.h" @@ -49,3 +51,5 @@ class ScudoCrashData { void FillInCause(Cause* cause, const scudo_error_report* report, unwindstack::AndroidUnwinder* unwinder) const; }; + +#endif // USE_SCUDO diff --git a/debuggerd/libdebuggerd/scudo.cpp b/debuggerd/libdebuggerd/scudo.cpp index 3fa3bd032..4ee87c841 100644 --- a/debuggerd/libdebuggerd/scudo.cpp +++ b/debuggerd/libdebuggerd/scudo.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#if defined(USE_SCUDO) + #include "libdebuggerd/scudo.h" #include "libdebuggerd/tombstone.h" @@ -141,3 +143,5 @@ void ScudoCrashData::AddCauseProtos(Tombstone* tombstone, FillInCause(tombstone->add_causes(), &error_info_.reports[report_num++], unwinder); } } + +#endif // USE_SCUDO