1diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
2index 303d05f084a..946aa9bb754 100644
3--- a/libs/hwui/Android.bp
4+++ b/libs/hwui/Android.bp
5@@ -17,6 +17,7 @@ cc_defaults {
6         "-Wunreachable-code",
7         "-Werror",
8         "-fvisibility=hidden",
9+	CFLAGS_FOR_BENCH_SUITE
10 
11         // GCC false-positives on this warning, and since we -Werror that's
12         // a problem
13@@ -30,6 +31,8 @@ cc_defaults {
14         //"-DANDROID_ENABLE_LINEAR_BLENDING",
15     ],
16 
17+    ldflags: [LDFLAGS_FOR_BENCH_SUITE],
18+
19     include_dirs: [
20         "external/skia/include/private",
21         "external/skia/src/core",
22@@ -231,6 +234,9 @@ cc_defaults {
23         export_proto_headers: true,
24     },
25 
26+    cflags: [CFLAGS_FOR_BENCH_SUITE],
27+    ldflags: [LDFLAGS_FOR_BENCH_SUITE],
28+
29     export_include_dirs: ["."],
30     export_shared_lib_headers: ["libRScpp"],
31 }
32@@ -240,7 +246,7 @@ cc_library {
33     defaults: [
34         "libhwui_defaults",
35 
36-        // Enables fine-grained GLES error checking
37+	// Enables fine-grained GLES error checking
38         // If enabled, every GLES call is wrapped & error checked
39         // Has moderate overhead
40         "hwui_enable_opengl_validation",
41@@ -257,7 +263,8 @@ cc_library_static {
42         "libhwui_defaults",
43         "hwui_debug",
44     ],
45-    cflags: ["-DHWUI_NULL_GPU"],
46+    cflags: ["-DHWUI_NULL_GPU", CFLAGS_FOR_BENCH_SUITE],
47+    ldflags: [LDFLAGS_FOR_BENCH_SUITE],
48     srcs: [
49         "debug/nullegl.cpp",
50     ],
51@@ -354,6 +361,9 @@ cc_benchmark {
52     whole_static_libs: ["libhwui"],
53     shared_libs: ["libmemunreachable"],
54 
55+    cflags: [CFLAGS_FOR_BENCH_SUITE],
56+    ldflags: [LDFLAGS_FOR_BENCH_SUITE],
57+
58     srcs: [
59         "tests/macrobench/TestSceneRunner.cpp",
60         "tests/macrobench/main.cpp",
61@@ -371,8 +381,11 @@ cc_benchmark {
62     cflags: [
63         "-include debug/wrap_gles.h",
64         "-DHWUI_NULL_GPU",
65+	CFLAGS_FOR_BENCH_SUITE
66     ],
67 
68+    ldflags: [LDFLAGS_FOR_BENCH_SUITE],
69+
70     whole_static_libs: ["libhwui_static_debug"],
71     shared_libs: ["libmemunreachable"],
72 
73