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
This commit is contained in:
Evgeniy Stepanov 2012-04-05 11:44:37 +04:00
parent 883a122808
commit f50f4c5299
2 changed files with 13 additions and 1 deletions

View file

@ -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 :=

View file

@ -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)