Ying Wang | ba8b377 | 2014-03-10 18:23:08 -0700 | [diff] [blame] | 1 | ## Clang configurations. |
| 2 | |
Logan Chien | 0e53d88 | 2018-11-06 17:32:40 +0800 | [diff] [blame] | 3 | LLVM_READOBJ := $(LLVM_PREBUILTS_BASE)/$(BUILD_OS)-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-readobj |
| 4 | |
Yi Kong | e4b8f48 | 2023-02-09 15:17:04 +0900 | [diff] [blame] | 5 | LLVM_RTLIB_PATH := $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib/clang/$(LLVM_RELEASE_VERSION)/lib/linux/ |
Ying Wang | 1f98283 | 2014-02-06 18:08:44 -0800 | [diff] [blame] | 6 | |
Dan Willemsen | 02268f0 | 2016-05-19 14:39:25 -0700 | [diff] [blame] | 7 | define convert-to-clang-flags |
| 8 | $(strip $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(1))) |
| 9 | endef |
Ying Wang | 1f98283 | 2014-02-06 18:08:44 -0800 | [diff] [blame] | 10 | |
Dan Albert | b5b2ffe | 2015-04-16 18:07:07 -0700 | [diff] [blame] | 11 | CLANG_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 Wang | 1f98283 | 2014-02-06 18:08:44 -0800 | [diff] [blame] | 37 | # HOST config |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 38 | clang_2nd_arch_prefix := |
Ying Wang | 1f98283 | 2014-02-06 18:08:44 -0800 | [diff] [blame] | 39 | include $(BUILD_SYSTEM)/clang/HOST_$(HOST_ARCH).mk |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 40 | |
| 41 | # HOST_2ND_ARCH config |
| 42 | ifdef HOST_2ND_ARCH |
| 43 | clang_2nd_arch_prefix := $(HOST_2ND_ARCH_VAR_PREFIX) |
| 44 | include $(BUILD_SYSTEM)/clang/HOST_$(HOST_2ND_ARCH).mk |
Tim Murray | 02cefc9 | 2014-03-20 13:48:35 -0700 | [diff] [blame] | 45 | endif |
Ying Wang | 1f98283 | 2014-02-06 18:08:44 -0800 | [diff] [blame] | 46 | |
| 47 | # TARGET config |
| 48 | clang_2nd_arch_prefix := |
| 49 | include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_ARCH).mk |
| 50 | |
| 51 | # TARGET_2ND_ARCH config |
| 52 | ifdef TARGET_2ND_ARCH |
| 53 | clang_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX) |
| 54 | include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_2ND_ARCH).mk |
| 55 | endif |
| 56 | |
Chih-Hung Hsieh | 460171a | 2016-04-21 15:37:24 -0700 | [diff] [blame] | 57 | include $(BUILD_SYSTEM)/clang/tidy.mk |