arm.mk revision 2d5a50e686ffc5ac00d6623d6f6a083bd1da9679
1# Clang flags for arm arch, target or host.
2
3CLANG_CONFIG_arm_EXTRA_ASFLAGS :=
4
5CLANG_CONFIG_arm_EXTRA_CFLAGS :=
6
7ifneq (,$(filter krait,$(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)))
8  # Android's clang support's krait as a CPU whereas GCC doesn't. Specify
9  # -mcpu here rather than the more normal core/combo/arch/arm/armv7-a-neon.mk.
10  CLANG_CONFIG_arm_EXTRA_CFLAGS += -mcpu=krait -mfpu=neon-vfpv4
11endif
12
13ifeq ($(HOST_OS),darwin)
14  # Darwin is really bad at dealing with idiv/sdiv. Don't use krait on Darwin.
15  CLANG_CONFIG_arm_EXTRA_CFLAGS += -mcpu=cortex-a9
16endif
17
18CLANG_CONFIG_arm_EXTRA_CPPFLAGS :=
19
20CLANG_CONFIG_arm_EXTRA_LDFLAGS :=
21
22# Include common unknown flags
23CLANG_CONFIG_arm_UNKNOWN_CFLAGS := \
24  $(CLANG_CONFIG_UNKNOWN_CFLAGS) \
25  -mthumb-interwork \
26  -fgcse-after-reload \
27  -frerun-cse-after-loop \
28  -frename-registers \
29  -fno-align-jumps \
30  -fno-builtin-sin \
31  -fno-caller-saves \
32  -fno-early-inlining \
33  -fno-move-loop-invariants \
34  -fno-partial-inlining \
35  -fno-strict-volatile-bitfields \
36  -fno-tree-copy-prop \
37  -fno-tree-loop-optimize \
38  -Wa,--noexecstack
39
40define subst-clang-incompatible-arm-flags
41  $(subst -march=armv5te,-march=armv5t,\
42  $(subst -march=armv5e,-march=armv5,\
43  $(1)))
44endef
45