File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ approach to detect races. KCSAN's primary purpose is to detect `data races`_.
8
8
Usage
9
9
-----
10
10
11
- KCSAN requires Clang version 11 or later.
11
+ KCSAN is supported by both GCC and Clang. With GCC we require version 11 or
12
+ later, and with Clang also require version 11 or later.
12
13
13
14
To enable KCSAN configure the kernel with::
14
15
Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ config HAVE_ARCH_KCSAN
4
4
bool
5
5
6
6
config HAVE_KCSAN_COMPILER
7
- def_bool CC_IS_CLANG && $(cc-option,-fsanitize=thread -mllvm -tsan-distinguish-volatile=1)
7
+ def_bool (CC_IS_CLANG && $(cc-option,-fsanitize=thread -mllvm -tsan-distinguish-volatile=1)) || \
8
+ (CC_IS_GCC && $(cc-option,-fsanitize=thread --param tsan-distinguish-volatile=1))
8
9
help
9
10
For the list of compilers that support KCSAN, please see
10
11
<file:Documentation/dev-tools/kcsan.rst>.
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ ifdef CONFIG_KCSAN
6
6
ifdef CONFIG_CC_IS_CLANG
7
7
cc-param = -mllvm -$(1)
8
8
else
9
- cc-param = --param - $(1)
9
+ cc-param = --param $(1)
10
10
endif
11
11
12
12
# Keep most options here optional, to allow enabling more compilers if absence
You can’t perform that action at this time.
0 commit comments