From 7982178b7bb877ab967f861896ab543d1002a943 Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Fri, 1 Jun 2018 11:31:38 -0700 Subject: [PATCH] Update cflags for building Windows modules with Clang Bug: http://b/69933068 - Add -Wexit-time-destructor globally after fixing one warning - Enable -Wthread-safety only for non-windows targets. The version of libstdc++ we use for Windows doesn't have the correct thread-safety annotations. Test: Run Clang-built adb_test.exe under wine Change-Id: I76a43060342e7d1dc370ce3e117f3563c82b7751 --- adb/Android.bp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/adb/Android.bp b/adb/Android.bp index 97c976203..c0e4c5758 100644 --- a/adb/Android.bp +++ b/adb/Android.bp @@ -19,17 +19,13 @@ cc_defaults { "-Wall", "-Wextra", "-Werror", + "-Wexit-time-destructors", "-Wno-unused-parameter", "-Wno-missing-field-initializers", "-Wvla", ], rtti: true, - clang_cflags: [ - "-Wexit-time-destructors", - "-Wthread-safety", - ], - use_version_lib: true, compile_multilib: "first", @@ -85,6 +81,12 @@ cc_defaults { "-luserenv", ], }, + + not_windows: { + cflags: [ + "-Wthread-safety", + ], + }, }, }