From f50f4c529919ac4acefd2fb05fb5d47743f6e2c3 Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Thu, 5 Apr 2012 11:44:37 +0400 Subject: [PATCH] More Clang tweaks to the build system. Adds arm_neon.h to the include path when building with Clang. Filters out 3 additional compiler flags when building with Clang. Filters out unsupported flags from TARGET_(arm|thumb)_CFLAGS, as well. Change-Id: I5e23a95356e0b10c31c9aa3cb4905f6a674709e4 --- core/binary.mk | 6 ++++++ core/llvm_config.mk | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/core/binary.mk b/core/binary.mk index 00a9073fa4..5cb17bcd42 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -239,8 +239,14 @@ normal_objects_mode := $(if $(LOCAL_ARM_MODE),$(LOCAL_ARM_MODE),thumb) # Read the values from something like TARGET_arm_CFLAGS or # TARGET_thumb_CFLAGS. HOST_(arm|thumb)_CFLAGS values aren't # actually used (although they are usually empty). +ifeq ($(strip $(LOCAL_CLANG)),true) +arm_objects_cflags := $($(my_prefix)$(arm_objects_mode)_CLANG_CFLAGS) +normal_objects_cflags := $($(my_prefix)$(normal_objects_mode)_CLANG_CFLAGS) +else arm_objects_cflags := $($(my_prefix)$(arm_objects_mode)_CFLAGS) normal_objects_cflags := $($(my_prefix)$(normal_objects_mode)_CFLAGS) +endif + else arm_objects_mode := normal_objects_mode := diff --git a/core/llvm_config.mk b/core/llvm_config.mk index bebc08c844..966924e0f1 100644 --- a/core/llvm_config.mk +++ b/core/llvm_config.mk @@ -33,6 +33,9 @@ ifeq ($(TARGET_ARCH),arm) -fgcse-after-reload \ -frerun-cse-after-loop \ -frename-registers \ + -fno-builtin-sin \ + -fno-strict-volatile-bitfields \ + -fno-align-jumps \ -Wa,--noexecstack endif ifeq ($(TARGET_ARCH),x86) @@ -50,12 +53,15 @@ ifeq ($(TARGET_ARCH),x86) -mbionic endif -CLANG_CONFIG_EXTRA_TARGET_C_INCLUDES := external/clang/lib/include +CLANG_CONFIG_EXTRA_TARGET_C_INCLUDES := external/clang/lib/include $(TARGET_OUT_HEADERS)/clang # remove unknown flags to define CLANG_FLAGS TARGET_GLOBAL_CLANG_FLAGS += $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(TARGET_GLOBAL_CFLAGS)) HOST_GLOBAL_CLANG_FLAGS += $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(HOST_GLOBAL_CFLAGS)) +TARGET_arm_CLANG_CFLAGS += $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(TARGET_arm_CFLAGS)) +TARGET_thumb_CLANG_CFLAGS += $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(TARGET_thumb_CFLAGS)) + # llvm does not yet support -march=armv5e nor -march=armv5te, fall back to armv5 or armv5t $(call clang-flags-subst,-march=armv5te,-march=armv5t) $(call clang-flags-subst,-march=armv5e,-march=armv5)