]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - scripts/Makefile.ubsan
btrfs: document some invariants of seed code
[mirror_ubuntu-hirsute-kernel.git] / scripts / Makefile.ubsan
CommitLineData
b2441318 1# SPDX-License-Identifier: GPL-2.0
0887a7eb
KC
2ifdef CONFIG_UBSAN_ALIGNMENT
3 CFLAGS_UBSAN += $(call cc-option, -fsanitize=alignment)
4endif
5
277a1085
KC
6ifdef CONFIG_UBSAN_BOUNDS
7 CFLAGS_UBSAN += $(call cc-option, -fsanitize=bounds)
8endif
9
10ifdef CONFIG_UBSAN_MISC
c6d30853
AR
11 CFLAGS_UBSAN += $(call cc-option, -fsanitize=shift)
12 CFLAGS_UBSAN += $(call cc-option, -fsanitize=integer-divide-by-zero)
13 CFLAGS_UBSAN += $(call cc-option, -fsanitize=unreachable)
c6d30853 14 CFLAGS_UBSAN += $(call cc-option, -fsanitize=signed-integer-overflow)
c6d30853 15 CFLAGS_UBSAN += $(call cc-option, -fsanitize=object-size)
c6d30853
AR
16 CFLAGS_UBSAN += $(call cc-option, -fsanitize=bool)
17 CFLAGS_UBSAN += $(call cc-option, -fsanitize=enum)
277a1085 18endif
c6d30853 19
0887a7eb
KC
20ifdef CONFIG_UBSAN_TRAP
21 CFLAGS_UBSAN += $(call cc-option, -fsanitize-undefined-trap-on-error)
c6d30853 22endif
725c4d22 23
a76bcf55
AB
24 # -fsanitize=* options makes GCC less smart than usual and
25 # increase number of 'maybe-uninitialized false-positives
26 CFLAGS_UBSAN += $(call cc-option, -Wno-maybe-uninitialized)