Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Andrey Ryabinin | 0b24bec | 2015-02-13 14:39:17 -0800 | [diff] [blame] | 2 | KASAN_SANITIZE := n |
Andrey Konovalov | 8a16c09 | 2020-05-13 17:50:51 -0700 | [diff] [blame] | 3 | UBSAN_SANITIZE := n |
Dmitry Vyukov | 5c9a875 | 2016-03-22 14:27:30 -0700 | [diff] [blame] | 4 | KCOV_INSTRUMENT := n |
Andrey Ryabinin | 0b24bec | 2015-02-13 14:39:17 -0800 | [diff] [blame] | 5 | |
Andrey Konovalov | 8a16c09 | 2020-05-13 17:50:51 -0700 | [diff] [blame] | 6 | # Disable ftrace to avoid recursion. |
Torsten Duwe | e209274 | 2019-02-08 16:10:14 +0100 | [diff] [blame] | 7 | CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE) |
| 8 | CFLAGS_REMOVE_generic.o = $(CC_FLAGS_FTRACE) |
Linus Torvalds | c620f7b | 2019-05-06 17:54:22 -0700 | [diff] [blame] | 9 | CFLAGS_REMOVE_generic_report.o = $(CC_FLAGS_FTRACE) |
Andrey Konovalov | 8a16c09 | 2020-05-13 17:50:51 -0700 | [diff] [blame] | 10 | CFLAGS_REMOVE_init.o = $(CC_FLAGS_FTRACE) |
| 11 | CFLAGS_REMOVE_quarantine.o = $(CC_FLAGS_FTRACE) |
| 12 | CFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE) |
Torsten Duwe | e209274 | 2019-02-08 16:10:14 +0100 | [diff] [blame] | 13 | CFLAGS_REMOVE_tags.o = $(CC_FLAGS_FTRACE) |
Andrey Konovalov | 8a16c09 | 2020-05-13 17:50:51 -0700 | [diff] [blame] | 14 | CFLAGS_REMOVE_tags_report.o = $(CC_FLAGS_FTRACE) |
Andrey Konovalov | dc15a8a | 2019-02-20 22:20:20 -0800 | [diff] [blame] | 15 | |
Andrey Ryabinin | 0b24bec | 2015-02-13 14:39:17 -0800 | [diff] [blame] | 16 | # Function splitter causes unnecessary splits in __asan_load1/__asan_store1 |
| 17 | # see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63533 |
Andrey Konovalov | ca734cc | 2020-06-01 21:52:43 -0700 | [diff] [blame] | 18 | CC_FLAGS_KASAN_RUNTIME := $(call cc-option, -fno-conserve-stack) |
Masahiro Yamada | 893ab004 | 2020-06-27 03:59:12 +0900 | [diff] [blame^] | 19 | CC_FLAGS_KASAN_RUNTIME += -fno-stack-protector |
Andrey Konovalov | ca734cc | 2020-06-01 21:52:43 -0700 | [diff] [blame] | 20 | # Disable branch tracing to avoid recursion. |
| 21 | CC_FLAGS_KASAN_RUNTIME += -DDISABLE_BRANCH_PROFILING |
| 22 | |
| 23 | CFLAGS_common.o := $(CC_FLAGS_KASAN_RUNTIME) |
| 24 | CFLAGS_generic.o := $(CC_FLAGS_KASAN_RUNTIME) |
| 25 | CFLAGS_generic_report.o := $(CC_FLAGS_KASAN_RUNTIME) |
| 26 | CFLAGS_init.o := $(CC_FLAGS_KASAN_RUNTIME) |
| 27 | CFLAGS_quarantine.o := $(CC_FLAGS_KASAN_RUNTIME) |
| 28 | CFLAGS_report.o := $(CC_FLAGS_KASAN_RUNTIME) |
| 29 | CFLAGS_tags.o := $(CC_FLAGS_KASAN_RUNTIME) |
| 30 | CFLAGS_tags_report.o := $(CC_FLAGS_KASAN_RUNTIME) |
Andrey Ryabinin | 0b24bec | 2015-02-13 14:39:17 -0800 | [diff] [blame] | 31 | |
Andrey Konovalov | 2bd926b | 2018-12-28 00:29:53 -0800 | [diff] [blame] | 32 | obj-$(CONFIG_KASAN) := common.o init.o report.o |
Andrey Konovalov | 11cd3cd | 2018-12-28 00:30:38 -0800 | [diff] [blame] | 33 | obj-$(CONFIG_KASAN_GENERIC) += generic.o generic_report.o quarantine.o |
| 34 | obj-$(CONFIG_KASAN_SW_TAGS) += tags.o tags_report.o |