]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - scripts/Makefile.kcsan
cxgb4: convert to new udp_tunnel_nic infra
[mirror_ubuntu-hirsute-kernel.git] / scripts / Makefile.kcsan
CommitLineData
dfd402a4
ME
1# SPDX-License-Identifier: GPL-2.0
2ifdef CONFIG_KCSAN
3
17168f5c
ME
4# GCC and Clang accept backend options differently. Do not wrap in cc-option,
5# because Clang accepts "--param" even if it is unused.
6ifdef CONFIG_CC_IS_CLANG
7cc-param = -mllvm -$(1)
8else
9cc-param = --param -$(1)
10endif
11
75d75b7a
ME
12# Keep most options here optional, to allow enabling more compilers if absence
13# of some options does not break KCSAN nor causes false positive reports.
17168f5c 14CFLAGS_KCSAN := -fsanitize=thread \
75d75b7a 15 $(call cc-option,$(call cc-param,tsan-instrument-func-entry-exit=0) -fno-optimize-sibling-calls) \
d31d4d6b 16 $(call cc-option,$(call cc-param,tsan-instrument-read-before-write=1)) \
75d75b7a 17 $(call cc-param,tsan-distinguish-volatile=1)
dfd402a4
ME
18
19endif # CONFIG_KCSAN