Merge "Move to a single clang unknown flags list"

am: 06935290ac

* commit '06935290ac12d03a5a4f287f4743ada996305235':
  Move to a single clang unknown flags list

Change-Id: Ia02030229a089e531c7258780fb7837240e2b47f
This commit is contained in:
Dan Willemsen
2016-05-23 17:40:42 +00:00
committed by android-build-merger
16 changed files with 30 additions and 160 deletions

View File

@@ -517,8 +517,8 @@ normal_objects_mode := $(if $(LOCAL_ARM_MODE),$(LOCAL_ARM_MODE),thumb)
arm_objects_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)$(arm_objects_mode)_CFLAGS) arm_objects_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)$(arm_objects_mode)_CFLAGS)
normal_objects_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)$(normal_objects_mode)_CFLAGS) normal_objects_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)$(normal_objects_mode)_CFLAGS)
ifeq ($(my_clang),true) ifeq ($(my_clang),true)
arm_objects_cflags := $(call $(LOCAL_2ND_ARCH_VAR_PREFIX)convert-to-$(my_host)clang-flags,$(arm_objects_cflags)) arm_objects_cflags := $(call convert-to-clang-flags,$(arm_objects_cflags))
normal_objects_cflags := $(call $(LOCAL_2ND_ARCH_VAR_PREFIX)convert-to-$(my_host)clang-flags,$(normal_objects_cflags)) normal_objects_cflags := $(call convert-to-clang-flags,$(normal_objects_cflags))
endif endif
else else
@@ -1344,10 +1344,10 @@ my_conlyflags += $(LOCAL_CLANG_CONLYFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PRE
my_cppflags += $(LOCAL_CLANG_CPPFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_CLANG_CPPFLAGS_$(my_32_64_bit_suffix)) my_cppflags += $(LOCAL_CLANG_CPPFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_CLANG_CPPFLAGS_$(my_32_64_bit_suffix))
my_ldflags += $(LOCAL_CLANG_LDFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_CLANG_LDFLAGS_$(my_32_64_bit_suffix)) my_ldflags += $(LOCAL_CLANG_LDFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_CLANG_LDFLAGS_$(my_32_64_bit_suffix))
my_asflags += $(LOCAL_CLANG_ASFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_CLANG_ASFLAGS_$(my_32_64_bit_suffix)) my_asflags += $(LOCAL_CLANG_ASFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_CLANG_ASFLAGS_$(my_32_64_bit_suffix))
my_cflags := $(call $(LOCAL_2ND_ARCH_VAR_PREFIX)convert-to-$(my_host)clang-flags,$(my_cflags)) my_cflags := $(call convert-to-clang-flags,$(my_cflags))
my_cppflags := $(call $(LOCAL_2ND_ARCH_VAR_PREFIX)convert-to-$(my_host)clang-flags,$(my_cppflags)) my_cppflags := $(call convert-to-clang-flags,$(my_cppflags))
my_asflags := $(call $(LOCAL_2ND_ARCH_VAR_PREFIX)convert-to-$(my_host)clang-flags,$(my_asflags)) my_asflags := $(call convert-to-clang-flags,$(my_asflags))
my_ldflags := $(call $(LOCAL_2ND_ARCH_VAR_PREFIX)convert-to-$(my_host)clang-flags,$(my_ldflags)) my_ldflags := $(call convert-to-clang-flags,$(my_ldflags))
else else
# gcc does not handle hidden functions in a manner compatible with LLVM libcxx # gcc does not handle hidden functions in a manner compatible with LLVM libcxx
# see b/27908145 # see b/27908145

View File

@@ -50,11 +50,4 @@ CLANG_CONFIG_x86_HOST_EXTRA_LDFLAGS := \
$(CLANG_CONFIG_x86_HOST_COMBO_EXTRA_LDFLAGS) \ $(CLANG_CONFIG_x86_HOST_COMBO_EXTRA_LDFLAGS) \
-target $(CLANG_CONFIG_x86_HOST_TRIPLE) -target $(CLANG_CONFIG_x86_HOST_TRIPLE)
define $(clang_2nd_arch_prefix)convert-to-host-clang-flags
$(strip \
$(call subst-clang-incompatible-x86-flags,\
$(filter-out $(CLANG_CONFIG_x86_UNKNOWN_CFLAGS),\
$(1))))
endef
$(clang_2nd_arch_prefix)HOST_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-i686.a $(clang_2nd_arch_prefix)HOST_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-i686.a

View File

@@ -50,11 +50,4 @@ CLANG_CONFIG_x86_64_HOST_EXTRA_LDFLAGS := \
$(CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_LDFLAGS) \ $(CLANG_CONFIG_x86_64_HOST_COMBO_EXTRA_LDFLAGS) \
-target $(CLANG_CONFIG_x86_64_HOST_TRIPLE) -target $(CLANG_CONFIG_x86_64_HOST_TRIPLE)
define convert-to-host-clang-flags
$(strip \
$(call subst-clang-incompatible-x86_64-flags,\
$(filter-out $(CLANG_CONFIG_x86_64_UNKNOWN_CFLAGS),\
$(1))))
endef
HOST_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-x86_64.a HOST_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-x86_64.a

View File

@@ -37,13 +37,6 @@ CLANG_CONFIG_arm_TARGET_EXTRA_LDFLAGS := \
-B$(CLANG_CONFIG_arm_TARGET_TOOLCHAIN_PREFIX) -B$(CLANG_CONFIG_arm_TARGET_TOOLCHAIN_PREFIX)
define $(clang_2nd_arch_prefix)convert-to-clang-flags
$(strip \
$(call subst-clang-incompatible-arm-flags,\
$(filter-out $(CLANG_CONFIG_arm_UNKNOWN_CFLAGS),\
$(1))))
endef
$(clang_2nd_arch_prefix)RS_TRIPLE := armv7-linux-androideabi $(clang_2nd_arch_prefix)RS_TRIPLE := armv7-linux-androideabi
$(clang_2nd_arch_prefix)RS_TRIPLE_CFLAGS := $(clang_2nd_arch_prefix)RS_TRIPLE_CFLAGS :=
$(clang_2nd_arch_prefix)RS_COMPAT_TRIPLE := armv7-none-linux-gnueabi $(clang_2nd_arch_prefix)RS_COMPAT_TRIPLE := armv7-none-linux-gnueabi

View File

@@ -36,13 +36,6 @@ CLANG_CONFIG_arm64_TARGET_EXTRA_LDFLAGS := \
-B$(CLANG_CONFIG_arm64_TARGET_TOOLCHAIN_PREFIX) -B$(CLANG_CONFIG_arm64_TARGET_TOOLCHAIN_PREFIX)
define convert-to-clang-flags
$(strip \
$(call subst-clang-incompatible-arm64-flags,\
$(filter-out $(CLANG_CONFIG_arm64_UNKNOWN_CFLAGS),\
$(1))))
endef
RS_TRIPLE := aarch64-linux-android RS_TRIPLE := aarch64-linux-android
RS_TRIPLE_CFLAGS := RS_TRIPLE_CFLAGS :=
RS_COMPAT_TRIPLE := aarch64-linux-android RS_COMPAT_TRIPLE := aarch64-linux-android

View File

@@ -37,13 +37,6 @@ CLANG_CONFIG_mips_TARGET_EXTRA_LDFLAGS := \
-B$(CLANG_CONFIG_mips_TARGET_TOOLCHAIN_PREFIX) -B$(CLANG_CONFIG_mips_TARGET_TOOLCHAIN_PREFIX)
define $(clang_2nd_arch_prefix)convert-to-clang-flags
$(strip \
$(call subst-clang-incompatible-mips-flags,\
$(filter-out $(CLANG_CONFIG_mips_UNKNOWN_CFLAGS),\
$(1))))
endef
$(clang_2nd_arch_prefix)RS_TRIPLE := armv7-linux-androideabi $(clang_2nd_arch_prefix)RS_TRIPLE := armv7-linux-androideabi
$(clang_2nd_arch_prefix)RS_TRIPLE_CFLAGS := $(clang_2nd_arch_prefix)RS_TRIPLE_CFLAGS :=
RS_COMPAT_TRIPLE := mipsel-linux-android RS_COMPAT_TRIPLE := mipsel-linux-android

View File

@@ -36,13 +36,6 @@ CLANG_CONFIG_mips64_TARGET_EXTRA_LDFLAGS := \
-B$(CLANG_CONFIG_mips64_TARGET_TOOLCHAIN_PREFIX) -B$(CLANG_CONFIG_mips64_TARGET_TOOLCHAIN_PREFIX)
define convert-to-clang-flags
$(strip \
$(call subst-clang-incompatible-mips64-flags,\
$(filter-out $(CLANG_CONFIG_mips64_UNKNOWN_CFLAGS),\
$(1))))
endef
RS_TRIPLE := aarch64-linux-android RS_TRIPLE := aarch64-linux-android
RS_TRIPLE_CFLAGS := RS_TRIPLE_CFLAGS :=
RS_COMPAT_TRIPLE := mips64el-linux-android RS_COMPAT_TRIPLE := mips64el-linux-android

View File

@@ -43,13 +43,6 @@ CLANG_CONFIG_x86_TARGET_EXTRA_LDFLAGS := \
-B$(CLANG_CONFIG_x86_TARGET_TOOLCHAIN_PREFIX) -B$(CLANG_CONFIG_x86_TARGET_TOOLCHAIN_PREFIX)
define $(clang_2nd_arch_prefix)convert-to-clang-flags
$(strip \
$(call subst-clang-incompatible-x86-flags,\
$(filter-out $(CLANG_CONFIG_x86_UNKNOWN_CFLAGS),\
$(1))))
endef
$(clang_2nd_arch_prefix)RS_TRIPLE := armv7-linux-androideabi $(clang_2nd_arch_prefix)RS_TRIPLE := armv7-linux-androideabi
$(clang_2nd_arch_prefix)RS_TRIPLE_CFLAGS := -D__i386__ $(clang_2nd_arch_prefix)RS_TRIPLE_CFLAGS := -D__i386__
$(clang_2nd_arch_prefix)RS_COMPAT_TRIPLE := i686-linux-android $(clang_2nd_arch_prefix)RS_COMPAT_TRIPLE := i686-linux-android

View File

@@ -36,13 +36,6 @@ CLANG_CONFIG_x86_64_TARGET_EXTRA_LDFLAGS := \
-B$(CLANG_CONFIG_x86_64_TARGET_TOOLCHAIN_PREFIX) -B$(CLANG_CONFIG_x86_64_TARGET_TOOLCHAIN_PREFIX)
define convert-to-clang-flags
$(strip \
$(call subst-clang-incompatible-x86_64-flags,\
$(filter-out $(CLANG_CONFIG_x86_64_UNKNOWN_CFLAGS),\
$(1))))
endef
RS_TRIPLE := aarch64-linux-android RS_TRIPLE := aarch64-linux-android
RS_TRIPLE_CFLAGS := -D__x86_64__ RS_TRIPLE_CFLAGS := -D__x86_64__
RS_COMPAT_TRIPLE := x86_64-linux-android RS_COMPAT_TRIPLE := x86_64-linux-android

View File

@@ -8,34 +8,8 @@ CLANG_CONFIG_arm_EXTRA_CPPFLAGS :=
CLANG_CONFIG_arm_EXTRA_LDFLAGS := CLANG_CONFIG_arm_EXTRA_LDFLAGS :=
# Include common unknown flags
CLANG_CONFIG_arm_UNKNOWN_CFLAGS := \
$(CLANG_CONFIG_UNKNOWN_CFLAGS) \
-mthumb-interwork \
-fgcse-after-reload \
-frerun-cse-after-loop \
-frename-registers \
-fno-align-jumps \
-fno-builtin-sin \
-fno-caller-saves \
-fno-early-inlining \
-fno-move-loop-invariants \
-fno-partial-inlining \
-fno-strict-volatile-bitfields \
-fno-tree-copy-prop \
-fno-tree-loop-optimize
ifneq (,$(filter krait,$(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT))) ifneq (,$(filter krait,$(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)))
# Android's clang support's krait as a CPU whereas GCC doesn't. Specify # Android's clang support's krait as a CPU whereas GCC doesn't. Specify
# -mcpu here rather than the more normal core/combo/arch/arm/armv7-a-neon.mk. # -mcpu here rather than the more normal core/combo/arch/arm/armv7-a-neon.mk.
CLANG_CONFIG_arm_EXTRA_CFLAGS += -mcpu=krait -mfpu=neon-vfpv4 CLANG_CONFIG_arm_EXTRA_CFLAGS += -mcpu=krait -mfpu=neon-vfpv4
# This isn't really unknown, but allows us to only set -mcpu=krait
CLANG_CONFIG_arm_UNKNOWN_CFLAGS += -mcpu=cortex-a15
endif endif
define subst-clang-incompatible-arm-flags
$(subst -march=armv5te,-march=armv5t,\
$(subst -march=armv5e,-march=armv5,\
$(1)))
endef

View File

@@ -5,17 +5,3 @@ CLANG_CONFIG_arm64_EXTRA_ASFLAGS :=
CLANG_CONFIG_arm64_EXTRA_CFLAGS := CLANG_CONFIG_arm64_EXTRA_CFLAGS :=
CLANG_CONFIG_arm64_EXTRA_LDFLAGS := CLANG_CONFIG_arm64_EXTRA_LDFLAGS :=
# Include common unknown flags
CLANG_CONFIG_arm64_UNKNOWN_CFLAGS := \
$(CLANG_CONFIG_UNKNOWN_CFLAGS) \
-fgcse-after-reload \
-frerun-cse-after-loop \
-frename-registers \
-fno-strict-volatile-bitfields \
-fno-align-jumps
# We don't have any arm64 flags to substitute yet.
define subst-clang-incompatible-arm64-flags
$(1)
endef

View File

@@ -85,6 +85,30 @@ CLANG_CONFIG_UNKNOWN_CFLAGS := \
-Wunused-but-set-parameter \ -Wunused-but-set-parameter \
-Wunused-but-set-variable \ -Wunused-but-set-variable \
-fdiagnostics-color \ -fdiagnostics-color \
-mthumb-interwork \
-fgcse-after-reload \
-frerun-cse-after-loop \
-frename-registers \
-fno-align-jumps \
-fno-builtin-sin \
-fno-caller-saves \
-fno-early-inlining \
-fno-move-loop-invariants \
-fno-partial-inlining \
-fno-strict-volatile-bitfields \
-fno-tree-copy-prop \
-fno-tree-loop-optimize \
-msynci \
-mno-synci \
-mno-fused-madd \
-finline-limit=300 \
-fno-inline-functions-called-once \
-mfpmath=sse \
-mbionic
define convert-to-clang-flags
$(strip $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(1)))
endef
# Clang flags for all host rules # Clang flags for all host rules
CLANG_CONFIG_HOST_EXTRA_ASFLAGS := CLANG_CONFIG_HOST_EXTRA_ASFLAGS :=

View File

@@ -3,19 +3,3 @@
CLANG_CONFIG_mips_EXTRA_ASFLAGS := CLANG_CONFIG_mips_EXTRA_ASFLAGS :=
CLANG_CONFIG_mips_EXTRA_CFLAGS := CLANG_CONFIG_mips_EXTRA_CFLAGS :=
CLANG_CONFIG_mips_EXTRA_LDFLAGS := CLANG_CONFIG_mips_EXTRA_LDFLAGS :=
# Include common unknown flags
CLANG_CONFIG_mips_UNKNOWN_CFLAGS := \
$(CLANG_CONFIG_UNKNOWN_CFLAGS) \
-fno-strict-volatile-bitfields \
-fgcse-after-reload \
-frerun-cse-after-loop \
-frename-registers \
-msynci \
-mno-synci \
-mno-fused-madd
# We don't have any mips flags to substitute yet.
define subst-clang-incompatible-mips-flags
$(1)
endef

View File

@@ -3,19 +3,3 @@
CLANG_CONFIG_mips64_EXTRA_ASFLAGS := CLANG_CONFIG_mips64_EXTRA_ASFLAGS :=
CLANG_CONFIG_mips64_EXTRA_CFLAGS := CLANG_CONFIG_mips64_EXTRA_CFLAGS :=
CLANG_CONFIG_mips64_EXTRA_LDFLAGS := CLANG_CONFIG_mips64_EXTRA_LDFLAGS :=
# Include common unknown flags
CLANG_CONFIG_mips64_UNKNOWN_CFLAGS := \
$(CLANG_CONFIG_UNKNOWN_CFLAGS) \
-fno-strict-volatile-bitfields \
-fgcse-after-reload \
-frerun-cse-after-loop \
-frename-registers \
-msynci \
-mno-synci \
-mno-fused-madd
# We don't have any mips64 flags to substitute yet.
define subst-clang-incompatible-mips64-flags
$(1)
endef

View File

@@ -4,16 +4,3 @@ CLANG_CONFIG_x86_EXTRA_ASFLAGS := \
-msse3 -msse3
CLANG_CONFIG_x86_EXTRA_CFLAGS := CLANG_CONFIG_x86_EXTRA_CFLAGS :=
CLANG_CONFIG_x86_EXTRA_LDFLAGS := CLANG_CONFIG_x86_EXTRA_LDFLAGS :=
# Include common unknown flags
CLANG_CONFIG_x86_UNKNOWN_CFLAGS := \
$(CLANG_CONFIG_UNKNOWN_CFLAGS) \
-finline-limit=300 \
-fno-inline-functions-called-once \
-mfpmath=sse \
-mbionic
# We don't have any x86 flags to substitute yet.
define subst-clang-incompatible-x86-flags
$(1)
endef

View File

@@ -3,16 +3,3 @@
CLANG_CONFIG_x86_64_EXTRA_ASFLAGS := CLANG_CONFIG_x86_64_EXTRA_ASFLAGS :=
CLANG_CONFIG_x86_64_EXTRA_CFLAGS := CLANG_CONFIG_x86_64_EXTRA_CFLAGS :=
CLANG_CONFIG_x86_64_EXTRA_LDFLAGS := CLANG_CONFIG_x86_64_EXTRA_LDFLAGS :=
# Include common unknown flags
CLANG_CONFIG_x86_64_UNKNOWN_CFLAGS := \
$(CLANG_CONFIG_UNKNOWN_CFLAGS) \
-finline-limit=300 \
-fno-inline-functions-called-once \
-mfpmath=sse \
-mbionic
# We don't have any x86_64 flags to substitute yet.
define subst-clang-incompatible-x86_64-flags
$(1)
endef