Marco Elver | dfd402a | 2019-11-14 19:02:54 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | ifdef CONFIG_KCSAN |
| 3 | |
Marco Elver | 17168f5 | 2020-05-21 16:20:38 +0200 | [diff] [blame] | 4 | # GCC and Clang accept backend options differently. Do not wrap in cc-option, |
| 5 | # because Clang accepts "--param" even if it is unused. |
| 6 | ifdef CONFIG_CC_IS_CLANG |
| 7 | cc-param = -mllvm -$(1) |
| 8 | else |
| 9 | cc-param = --param -$(1) |
| 10 | endif |
| 11 | |
| 12 | CFLAGS_KCSAN := -fsanitize=thread \ |
| 13 | $(call cc-option,$(call cc-param,tsan-instrument-func-entry-exit=0) -fno-optimize-sibling-calls) |
Marco Elver | dfd402a | 2019-11-14 19:02:54 +0100 | [diff] [blame] | 14 | |
| 15 | endif # CONFIG_KCSAN |