blob: 063fd3473dccadf6e783013336487eaf24572d15 [file] [log] [blame]
Ying Wangba8b3772014-03-10 18:23:08 -07001## Clang configurations.
2
Logan Chien0e53d882018-11-06 17:32:40 +08003LLVM_READOBJ := $(LLVM_PREBUILTS_BASE)/$(BUILD_OS)-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-readobj
4
Yi Kong65e45602018-11-12 09:32:47 -08005LLVM_RTLIB_PATH := $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib64/clang/$(LLVM_RELEASE_VERSION)/lib/linux/
Ying Wang1f982832014-02-06 18:08:44 -08006
Dan Willemsen02268f02016-05-19 14:39:25 -07007define convert-to-clang-flags
8$(strip $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(1)))
9endef
Ying Wang1f982832014-02-06 18:08:44 -080010
Dan Albertb5b2ffe2015-04-16 18:07:07 -070011CLANG_DEFAULT_UB_CHECKS := \
12 bool \
13 integer-divide-by-zero \
14 return \
15 returns-nonnull-attribute \
16 shift-exponent \
17 unreachable \
18 vla-bound \
19
20# TODO(danalbert): The following checks currently have compiler performance
21# issues.
22# CLANG_DEFAULT_UB_CHECKS += alignment
23# CLANG_DEFAULT_UB_CHECKS += bounds
24# CLANG_DEFAULT_UB_CHECKS += enum
25# CLANG_DEFAULT_UB_CHECKS += float-cast-overflow
26# CLANG_DEFAULT_UB_CHECKS += float-divide-by-zero
27# CLANG_DEFAULT_UB_CHECKS += nonnull-attribute
28# CLANG_DEFAULT_UB_CHECKS += null
29# CLANG_DEFAULT_UB_CHECKS += shift-base
30# CLANG_DEFAULT_UB_CHECKS += signed-integer-overflow
31
32# TODO(danalbert): Fix UB in libc++'s __tree so we can turn this on.
33# https://llvm.org/PR19302
34# http://reviews.llvm.org/D6974
35# CLANG_DEFAULT_UB_CHECKS += object-size
36
Ying Wang1f982832014-02-06 18:08:44 -080037# HOST config
Ying Wang6feb6d52014-04-17 10:03:35 -070038clang_2nd_arch_prefix :=
Ying Wang1f982832014-02-06 18:08:44 -080039include $(BUILD_SYSTEM)/clang/HOST_$(HOST_ARCH).mk
Ying Wang6feb6d52014-04-17 10:03:35 -070040
41# HOST_2ND_ARCH config
42ifdef HOST_2ND_ARCH
43clang_2nd_arch_prefix := $(HOST_2ND_ARCH_VAR_PREFIX)
44include $(BUILD_SYSTEM)/clang/HOST_$(HOST_2ND_ARCH).mk
Tim Murray02cefc92014-03-20 13:48:35 -070045endif
Ying Wang1f982832014-02-06 18:08:44 -080046
Dan Willemsen9ecbf832016-02-05 16:20:19 -080047ifdef HOST_CROSS_ARCH
48clang_2nd_arch_prefix :=
49include $(BUILD_SYSTEM)/clang/HOST_CROSS_$(HOST_CROSS_ARCH).mk
50ifdef HOST_CROSS_2ND_ARCH
51clang_2nd_arch_prefix := $(HOST_CROSS_2ND_ARCH_VAR_PREFIX)
52include $(BUILD_SYSTEM)/clang/HOST_CROSS_$(HOST_CROSS_2ND_ARCH).mk
53endif
Dan Willemsen057aaea2015-08-14 12:59:50 -070054endif
55
Ying Wang1f982832014-02-06 18:08:44 -080056# TARGET config
57clang_2nd_arch_prefix :=
58include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_ARCH).mk
59
60# TARGET_2ND_ARCH config
61ifdef TARGET_2ND_ARCH
62clang_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
63include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_2ND_ARCH).mk
64endif
65
Chih-Hung Hsieh460171a2016-04-21 15:37:24 -070066include $(BUILD_SYSTEM)/clang/tidy.mk