• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Clang configurations.
2
3LLVM_READOBJ := $(LLVM_PREBUILTS_BASE)/$(BUILD_OS)-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-readobj
4
5LLVM_RTLIB_PATH := $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib64/clang/$(LLVM_RELEASE_VERSION)/lib/linux/
6
7define convert-to-clang-flags
8$(strip $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(1)))
9endef
10
11CLANG_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
37# HOST config
38clang_2nd_arch_prefix :=
39include $(BUILD_SYSTEM)/clang/HOST_$(HOST_ARCH).mk
40
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
45endif
46
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
57include $(BUILD_SYSTEM)/clang/tidy.mk
58