blob: d03c5417d2cd51515eef28c3fefed5630dbf63ba [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 Konge4b8f482023-02-09 15:17:04 +09005LLVM_RTLIB_PATH := $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib/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
47# TARGET config
48clang_2nd_arch_prefix :=
49include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_ARCH).mk
50
51# TARGET_2ND_ARCH config
52ifdef TARGET_2ND_ARCH
53clang_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
54include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_2ND_ARCH).mk
55endif
56
Chih-Hung Hsieh460171a2016-04-21 15:37:24 -070057include $(BUILD_SYSTEM)/clang/tidy.mk