2014-03-11 09:23:08 +08:00
|
|
|
## Clang configurations.
|
|
|
|
|
2018-11-06 17:32:40 +08:00
|
|
|
LLVM_READOBJ := $(LLVM_PREBUILTS_BASE)/$(BUILD_OS)-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-readobj
|
|
|
|
|
2018-11-13 01:32:47 +08:00
|
|
|
LLVM_RTLIB_PATH := $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib64/clang/$(LLVM_RELEASE_VERSION)/lib/linux/
|
2014-02-20 01:03:00 +08:00
|
|
|
|
2016-05-20 05:39:25 +08:00
|
|
|
define convert-to-clang-flags
|
|
|
|
$(strip $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(1)))
|
|
|
|
endef
|
2014-02-07 10:08:44 +08:00
|
|
|
|
2015-04-17 09:07:07 +08:00
|
|
|
CLANG_DEFAULT_UB_CHECKS := \
|
|
|
|
bool \
|
|
|
|
integer-divide-by-zero \
|
|
|
|
return \
|
|
|
|
returns-nonnull-attribute \
|
|
|
|
shift-exponent \
|
|
|
|
unreachable \
|
|
|
|
vla-bound \
|
|
|
|
|
|
|
|
# TODO(danalbert): The following checks currently have compiler performance
|
|
|
|
# issues.
|
|
|
|
# CLANG_DEFAULT_UB_CHECKS += alignment
|
|
|
|
# CLANG_DEFAULT_UB_CHECKS += bounds
|
|
|
|
# CLANG_DEFAULT_UB_CHECKS += enum
|
|
|
|
# CLANG_DEFAULT_UB_CHECKS += float-cast-overflow
|
|
|
|
# CLANG_DEFAULT_UB_CHECKS += float-divide-by-zero
|
|
|
|
# CLANG_DEFAULT_UB_CHECKS += nonnull-attribute
|
|
|
|
# CLANG_DEFAULT_UB_CHECKS += null
|
|
|
|
# CLANG_DEFAULT_UB_CHECKS += shift-base
|
|
|
|
# CLANG_DEFAULT_UB_CHECKS += signed-integer-overflow
|
|
|
|
|
|
|
|
# TODO(danalbert): Fix UB in libc++'s __tree so we can turn this on.
|
|
|
|
# https://llvm.org/PR19302
|
|
|
|
# http://reviews.llvm.org/D6974
|
|
|
|
# CLANG_DEFAULT_UB_CHECKS += object-size
|
|
|
|
|
2014-02-07 10:08:44 +08:00
|
|
|
# HOST config
|
2014-04-18 01:03:35 +08:00
|
|
|
clang_2nd_arch_prefix :=
|
2014-02-07 10:08:44 +08:00
|
|
|
include $(BUILD_SYSTEM)/clang/HOST_$(HOST_ARCH).mk
|
2014-04-18 01:03:35 +08:00
|
|
|
|
|
|
|
# HOST_2ND_ARCH config
|
|
|
|
ifdef HOST_2ND_ARCH
|
|
|
|
clang_2nd_arch_prefix := $(HOST_2ND_ARCH_VAR_PREFIX)
|
|
|
|
include $(BUILD_SYSTEM)/clang/HOST_$(HOST_2ND_ARCH).mk
|
2014-03-21 04:48:35 +08:00
|
|
|
endif
|
2014-02-07 10:08:44 +08:00
|
|
|
|
|
|
|
# TARGET config
|
|
|
|
clang_2nd_arch_prefix :=
|
|
|
|
include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_ARCH).mk
|
|
|
|
|
|
|
|
# TARGET_2ND_ARCH config
|
|
|
|
ifdef TARGET_2ND_ARCH
|
|
|
|
clang_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
|
|
|
|
include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_2ND_ARCH).mk
|
|
|
|
endif
|
|
|
|
|
2016-04-22 06:37:24 +08:00
|
|
|
include $(BUILD_SYSTEM)/clang/tidy.mk
|