summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2013-05-17 15:54:01 -0700
committerIan Rogers <irogers@google.com>2013-05-17 15:54:01 -0700
commitcd5d0422ac07b03220970a3606f8b402a3636528 (patch)
tree6879c685081ce4e4f53eb33bb2a8ad60d55cdc9b
parente606010a5e5ea803736576b47740a2551e5d0dfc (diff)
downloadart-cd5d0422ac07b03220970a3606f8b402a3636528.zip
art-cd5d0422ac07b03220970a3606f8b402a3636528.tar.gz
art-cd5d0422ac07b03220970a3606f8b402a3636528.tar.bz2
Clang build support, -Wthread-safety with GCC 4.6.
Change-Id: Idccb4daa012c66a6ece3f7a037c9c2c029beba64
-rw-r--r--build/Android.common.mk11
-rw-r--r--build/Android.executable.mk2
-rw-r--r--build/Android.gtest.mk2
-rw-r--r--build/Android.libart-compiler.mk2
-rw-r--r--build/Android.libart.mk2
-rw-r--r--build/Android.libarttest.mk2
6 files changed, 21 insertions, 0 deletions
diff --git a/build/Android.common.mk b/build/Android.common.mk
index 7ba2e4f..508ff1b 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -33,6 +33,10 @@ endif
LLVM_ROOT_PATH := external/llvm
include $(LLVM_ROOT_PATH)/llvm.mk
+# Clang build.
+# ART_TARGET_CLANG := true
+# ART_HOST_CLANG := true
+
# directory used for gtests on device
ART_NATIVETEST_DIR := /data/nativetest/art
ART_NATIVETEST_OUT := $(TARGET_OUT_DATA_NATIVE_TESTS)/art
@@ -58,6 +62,13 @@ art_cflags := \
-Wstrict-aliasing=3 \
-fstrict-aliasing
+# Enable thread-safety for GCC 4.6 but not for GCC 4.7 where this feature was removed.
+# Enable GCC 4.6 builds with 'export TARGET_GCC_VERSION_EXP=4.6'
+ifneq ($(filter 4.6 4.6.%, $(TARGET_GCC_VERSION)),)
+ $(info Enabling thread-safety for GCC $(TARGET_GCC_VERSION))
+ art_cflags += -Wthread-safety
+endif
+
ifeq ($(ART_SMALL_MODE),true)
art_cflags += -DART_SMALL_MODE=1
endif
diff --git a/build/Android.executable.mk b/build/Android.executable.mk
index b30e27b..ee968a7 100644
--- a/build/Android.executable.mk
+++ b/build/Android.executable.mk
@@ -62,6 +62,7 @@ define build-art-executable
LOCAL_CFLAGS := $(ART_EXECUTABLES_CFLAGS)
ifeq ($$(art_target_or_host),target)
+ LOCAL_CLANG := $(ART_TARGET_CLANG)
LOCAL_CFLAGS += $(ART_TARGET_CFLAGS)
ifeq ($$(art_ndebug_or_debug),debug)
LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS)
@@ -69,6 +70,7 @@ define build-art-executable
LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS)
endif
else # host
+ LOCAL_CLANG := $(ART_HOST_CLANG)
LOCAL_CFLAGS += $(ART_HOST_CFLAGS)
ifeq ($$(art_ndebug_or_debug),debug)
LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS)
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index c8aded5..f13c47e 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -60,6 +60,7 @@ define build-art-test
LOCAL_CFLAGS := $(ART_TEST_CFLAGS)
ifeq ($$(art_target_or_host),target)
+ LOCAL_CLANG := $(ART_TARGET_CLANG)
LOCAL_CFLAGS += $(ART_TARGET_CFLAGS) $(ART_TARGET_DEBUG_CFLAGS)
LOCAL_SHARED_LIBRARIES += libdl libicuuc libicui18n libnativehelper libstlport libz libcutils
LOCAL_STATIC_LIBRARIES += libgtest
@@ -69,6 +70,7 @@ define build-art-test
art_gtest_exe := $$(LOCAL_MODULE_PATH)/$$(LOCAL_MODULE)
ART_TARGET_TEST_EXECUTABLES += $$(art_gtest_exe)
else # host
+ LOCAL_CLANG := $(ART_HOST_CLANG)
LOCAL_CFLAGS += $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS)
LOCAL_SHARED_LIBRARIES += libicuuc-host libicui18n-host libnativehelper libz-host
LOCAL_STATIC_LIBRARIES += libcutils
diff --git a/build/Android.libart-compiler.mk b/build/Android.libart-compiler.mk
index b9235d8..5e34573 100644
--- a/build/Android.libart-compiler.mk
+++ b/build/Android.libart-compiler.mk
@@ -113,8 +113,10 @@ define build-libart-compiler
LOCAL_CFLAGS := $$(LIBART_COMPILER_CFLAGS)
ifeq ($$(art_target_or_host),target)
+ LOCAL_CLANG := $(ART_TARGET_CLANG)
LOCAL_CFLAGS += $(ART_TARGET_CFLAGS)
else # host
+ LOCAL_CLANG := $(ART_HOST_CLANG)
LOCAL_CFLAGS += $(ART_HOST_CFLAGS)
endif
diff --git a/build/Android.libart.mk b/build/Android.libart.mk
index cbc78b2..74e9b21 100644
--- a/build/Android.libart.mk
+++ b/build/Android.libart.mk
@@ -70,8 +70,10 @@ $$(ENUM_OPERATOR_OUT_GEN): $$(GENERATED_SRC_DIR)/%_operator_out.cc : art/%.h
LOCAL_CFLAGS := $(LIBART_CFLAGS)
ifeq ($$(art_target_or_host),target)
+ LOCAL_CLANG := $(ART_TARGET_CLANG)
LOCAL_CFLAGS += $(ART_TARGET_CFLAGS)
else # host
+ LOCAL_CLANG := $(ART_HOST_CLANG)
LOCAL_CFLAGS += $(ART_HOST_CFLAGS)
endif
ifeq ($$(art_ndebug_or_debug),debug)
diff --git a/build/Android.libarttest.mk b/build/Android.libarttest.mk
index 855523b..50b9a10 100644
--- a/build/Android.libarttest.mk
+++ b/build/Android.libarttest.mk
@@ -38,12 +38,14 @@ define build-libarttest
LOCAL_SHARED_LIBRARIES := libartd
LOCAL_C_INCLUDES += $(ART_C_INCLUDES)
ifeq ($$(art_target_or_host),target)
+ LOCAL_CLANG := $(ART_TARGET_CLANG)
LOCAL_CFLAGS := $(ART_TARGET_CFLAGS) $(ART_TARGET_DEBUG_CFLAGS)
LOCAL_SHARED_LIBRARIES += libdl libstlport
LOCAL_STATIC_LIBRARIES := libgtest
LOCAL_MODULE_PATH := $(ART_TEST_OUT)
include $(BUILD_SHARED_LIBRARY)
else # host
+ LOCAL_CLANG := $(ART_HOST_CLANG)
LOCAL_CFLAGS := $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS)
LOCAL_LDLIBS := -ldl -lpthread
ifeq ($(HOST_OS),linux)