summaryrefslogtreecommitdiffstats
path: root/build/Android.common.mk
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-03-06 12:13:39 -0800
committerIan Rogers <irogers@google.com>2014-03-06 19:16:01 -0800
commit719d1a33f6569864f529e5a3fff59e7bca97aad0 (patch)
treefcd84efd7b9806b93ec1a44e2317e6f882e7fe0e /build/Android.common.mk
parent5365eea9940269b662cfbe103caa348816ff1558 (diff)
downloadart-719d1a33f6569864f529e5a3fff59e7bca97aad0.zip
art-719d1a33f6569864f529e5a3fff59e7bca97aad0.tar.gz
art-719d1a33f6569864f529e5a3fff59e7bca97aad0.tar.bz2
Enable annotalysis on clang ART builds.
Fix clang build errors aswell as restructure locking/mutex code for correct thread safety analysis support. Reorder make dependencies so that host builds build first as they should provide better compilation errors than target. Remove host's use of -fno-omit-frame-pointer as it has no value with correct use of CFI, which we should have. Change-Id: I72cea8da9a3757b1a0b3acb4081feccb7c6cef90
Diffstat (limited to 'build/Android.common.mk')
-rw-r--r--build/Android.common.mk20
1 files changed, 11 insertions, 9 deletions
diff --git a/build/Android.common.mk b/build/Android.common.mk
index 0522456..f58aabc 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -173,22 +173,24 @@ $(error Required DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES is not set)
endif
ART_TARGET_CFLAGS += -DART_DEFAULT_INSTRUCTION_SET_FEATURES=$(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
-# Enable thread-safety for GCC 4.6 on the target but not for GCC 4.7 where this feature was removed.
+# Enable thread-safety for GCC 4.6, and clang, but not for GCC 4.7 or later where this feature was
+# removed. Warn when -Wthread-safety is not used.
ifneq ($(filter 4.6 4.6.%, $(TARGET_GCC_VERSION)),)
ART_TARGET_CFLAGS += -Wthread-safety
else
- # Warn if not using GCC 4.6 for target builds when not doing a top-level or 'mma' build.
- ifneq ($(ONE_SHOT_MAKEFILE),)
- # Enable target GCC 4.6 with: export TARGET_GCC_VERSION_EXP=4.6
- $(info Using target GCC $(TARGET_GCC_VERSION) disables thread-safety checks.)
+ ifeq ($(ART_TARGET_CLANG),true)
+ ART_TARGET_CFLAGS += -Wthread-safety
+ else
+ # Warn if -Wthread-safety is not suport and not doing a top-level or 'mma' build.
+ ifneq ($(ONE_SHOT_MAKEFILE),)
+ # Enable target GCC 4.6 with: export TARGET_GCC_VERSION_EXP=4.6
+ $(info Using target GCC $(TARGET_GCC_VERSION) disables thread-safety checks.)
+ endif
endif
endif
-# We build with GCC 4.6 on the host.
+# We compile with GCC 4.6 or clang on the host, both of which support -Wthread-safety.
ART_HOST_CFLAGS += -Wthread-safety
-# Make host builds easier to debug and profile by not omitting the frame pointer.
-ART_HOST_CFLAGS += -fno-omit-frame-pointer
-
# To use oprofile_android --callgraph, uncomment this and recompile with "mmm art -B -j16"
# ART_TARGET_CFLAGS += -fno-omit-frame-pointer -marm -mapcs