OSDN Git Service

Perfprofd: Enable sanitizers in debug build
authorAndreas Gampe <agampe@google.com>
Tue, 27 Mar 2018 18:33:25 +0000 (11:33 -0700)
committerAndreas Gampe <agampe@google.com>
Tue, 27 Mar 2018 18:33:25 +0000 (11:33 -0700)
Test enable sanitizers for debug build to aid in bug diagnostics.

Bug: 73175642
Test: mmma system/extras/perfprofd
Test: perfprofd_test
Change-Id: Iba9351e11592940e3ceff06d5cad32f5aed38388

perfprofd/Android.bp
perfprofd/tests/Android.bp

index 351c7aa..b92277d 100644 (file)
@@ -49,6 +49,22 @@ cc_defaults {
         "-g",
         "-UNDEBUG",
     ],
+
+    // Add sanitizers that work w/o extra libraries. This is important
+    // for atest etc to work.
+    sanitize: {
+        integer_overflow: true,
+        undefined: true,
+    },
+
+    target: {
+        // On the host add ASAN.
+        host: {
+            sanitize: {
+                address: true,
+            },
+        },
+    }
 }
 
 //
index 7d0b706..9fa0d73 100644 (file)
@@ -30,8 +30,6 @@ cc_test {
         "libbase",
         "libutils",
         "libz",
-    ],
-    shared_libs: [
         "libprotobuf-cpp-lite",
         "liblog",
     ],