kbuild: deb-pkg: do not build linux-headers package if CONFIG_MODULES=n
[linux-2.6-microblaze.git] / scripts / Makefile.ubsan
1 # SPDX-License-Identifier: GPL-2.0
2
3 export CFLAGS_UBSAN :=
4
5 ifdef CONFIG_UBSAN_ALIGNMENT
6       CFLAGS_UBSAN += $(call cc-option, -fsanitize=alignment)
7 endif
8
9 ifdef CONFIG_UBSAN_BOUNDS
10       CFLAGS_UBSAN += $(call cc-option, -fsanitize=bounds)
11 endif
12
13 ifdef CONFIG_UBSAN_MISC
14       CFLAGS_UBSAN += $(call cc-option, -fsanitize=shift)
15       CFLAGS_UBSAN += $(call cc-option, -fsanitize=integer-divide-by-zero)
16       CFLAGS_UBSAN += $(call cc-option, -fsanitize=unreachable)
17       CFLAGS_UBSAN += $(call cc-option, -fsanitize=signed-integer-overflow)
18       CFLAGS_UBSAN += $(call cc-option, -fsanitize=object-size)
19       CFLAGS_UBSAN += $(call cc-option, -fsanitize=bool)
20       CFLAGS_UBSAN += $(call cc-option, -fsanitize=enum)
21 endif
22
23 ifdef CONFIG_UBSAN_TRAP
24       CFLAGS_UBSAN += $(call cc-option, -fsanitize-undefined-trap-on-error)
25 endif
26
27       # -fsanitize=* options makes GCC less smart than usual and
28       # increase number of 'maybe-uninitialized false-positives
29       CFLAGS_UBSAN += $(call cc-option, -Wno-maybe-uninitialized)