Ying Wang | ba8b377 | 2014-03-10 18:23:08 -0700 | [diff] [blame] | 1 | ## Clang configurations. |
| 2 | |
Yi Kong | 65e4560 | 2018-11-12 09:32:47 -0800 | [diff] [blame^] | 3 | LLVM_RTLIB_PATH := $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib64/clang/$(LLVM_RELEASE_VERSION)/lib/linux/ |
Ying Wang | 1f98283 | 2014-02-06 18:08:44 -0800 | [diff] [blame] | 4 | |
Dan Willemsen | 02268f0 | 2016-05-19 14:39:25 -0700 | [diff] [blame] | 5 | define convert-to-clang-flags |
| 6 | $(strip $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(1))) |
| 7 | endef |
Ying Wang | 1f98283 | 2014-02-06 18:08:44 -0800 | [diff] [blame] | 8 | |
Dan Albert | b5b2ffe | 2015-04-16 18:07:07 -0700 | [diff] [blame] | 9 | CLANG_DEFAULT_UB_CHECKS := \ |
| 10 | bool \ |
| 11 | integer-divide-by-zero \ |
| 12 | return \ |
| 13 | returns-nonnull-attribute \ |
| 14 | shift-exponent \ |
| 15 | unreachable \ |
| 16 | vla-bound \ |
| 17 | |
| 18 | # TODO(danalbert): The following checks currently have compiler performance |
| 19 | # issues. |
| 20 | # CLANG_DEFAULT_UB_CHECKS += alignment |
| 21 | # CLANG_DEFAULT_UB_CHECKS += bounds |
| 22 | # CLANG_DEFAULT_UB_CHECKS += enum |
| 23 | # CLANG_DEFAULT_UB_CHECKS += float-cast-overflow |
| 24 | # CLANG_DEFAULT_UB_CHECKS += float-divide-by-zero |
| 25 | # CLANG_DEFAULT_UB_CHECKS += nonnull-attribute |
| 26 | # CLANG_DEFAULT_UB_CHECKS += null |
| 27 | # CLANG_DEFAULT_UB_CHECKS += shift-base |
| 28 | # CLANG_DEFAULT_UB_CHECKS += signed-integer-overflow |
| 29 | |
| 30 | # TODO(danalbert): Fix UB in libc++'s __tree so we can turn this on. |
| 31 | # https://llvm.org/PR19302 |
| 32 | # http://reviews.llvm.org/D6974 |
| 33 | # CLANG_DEFAULT_UB_CHECKS += object-size |
| 34 | |
Ying Wang | 1f98283 | 2014-02-06 18:08:44 -0800 | [diff] [blame] | 35 | # HOST config |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 36 | clang_2nd_arch_prefix := |
Ying Wang | 1f98283 | 2014-02-06 18:08:44 -0800 | [diff] [blame] | 37 | include $(BUILD_SYSTEM)/clang/HOST_$(HOST_ARCH).mk |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 38 | |
| 39 | # HOST_2ND_ARCH config |
| 40 | ifdef HOST_2ND_ARCH |
| 41 | clang_2nd_arch_prefix := $(HOST_2ND_ARCH_VAR_PREFIX) |
| 42 | include $(BUILD_SYSTEM)/clang/HOST_$(HOST_2ND_ARCH).mk |
Tim Murray | 02cefc9 | 2014-03-20 13:48:35 -0700 | [diff] [blame] | 43 | endif |
Ying Wang | 1f98283 | 2014-02-06 18:08:44 -0800 | [diff] [blame] | 44 | |
Dan Willemsen | 9ecbf83 | 2016-02-05 16:20:19 -0800 | [diff] [blame] | 45 | ifdef HOST_CROSS_ARCH |
| 46 | clang_2nd_arch_prefix := |
| 47 | include $(BUILD_SYSTEM)/clang/HOST_CROSS_$(HOST_CROSS_ARCH).mk |
| 48 | ifdef HOST_CROSS_2ND_ARCH |
| 49 | clang_2nd_arch_prefix := $(HOST_CROSS_2ND_ARCH_VAR_PREFIX) |
| 50 | include $(BUILD_SYSTEM)/clang/HOST_CROSS_$(HOST_CROSS_2ND_ARCH).mk |
| 51 | endif |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 52 | endif |
| 53 | |
Ying Wang | 1f98283 | 2014-02-06 18:08:44 -0800 | [diff] [blame] | 54 | # TARGET config |
| 55 | clang_2nd_arch_prefix := |
| 56 | include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_ARCH).mk |
| 57 | |
| 58 | # TARGET_2ND_ARCH config |
| 59 | ifdef TARGET_2ND_ARCH |
| 60 | clang_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX) |
| 61 | include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_2ND_ARCH).mk |
| 62 | endif |
| 63 | |
Ying Wang | 1f98283 | 2014-02-06 18:08:44 -0800 | [diff] [blame] | 64 | # This allows us to use the superset of functionality that compiler-rt |
| 65 | # provides to Clang (for supporting features like -ftrapv). |
| 66 | COMPILER_RT_CONFIG_EXTRA_STATIC_LIBRARIES := libcompiler_rt-extras |
Ying Wang | e5d4e74 | 2014-11-06 14:11:33 -0800 | [diff] [blame] | 67 | |
Chih-Hung Hsieh | 460171a | 2016-04-21 15:37:24 -0700 | [diff] [blame] | 68 | include $(BUILD_SYSTEM)/clang/tidy.mk |