History

ubsan: Use Clang's -fsanitize-trap=undefined option

Clang changed the way it enables UBSan trapping mode. Update the Makefile logic to discover it.

Kees Cook committed 2 years ago

Commit 167ebed1 parent 0ea74b41 file · +1 −1Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/Makefile.ubsan+1−1
@@ -10,6 +10,6 @@ ubsan-cflags-$(CONFIG_UBSAN_DIV_ZERO) += -fsanitize=integer-divide-by-zero · 9 unmodified lines
10ubsan-cflags-$(CONFIG_UBSAN_UNREACHABLE) += -fsanitize=unreachable10ubsan-cflags-$(CONFIG_UBSAN_UNREACHABLE) += -fsanitize=unreachable
11ubsan-cflags-$(CONFIG_UBSAN_BOOL) += -fsanitize=bool11ubsan-cflags-$(CONFIG_UBSAN_BOOL) += -fsanitize=bool
12ubsan-cflags-$(CONFIG_UBSAN_ENUM) += -fsanitize=enum12ubsan-cflags-$(CONFIG_UBSAN_ENUM) += -fsanitize=enum
13ubsan-cflags-$(CONFIG_UBSAN_TRAP) += -fsanitize-undefined-trap-on-error13ubsan-cflags-$(CONFIG_UBSAN_TRAP) += $(call cc-option,-fsanitize-trap=undefined,-fsanitize-undefined-trap-on-error)
14 14
15export CFLAGS_UBSAN := $(ubsan-cflags-y)15export CFLAGS_UBSAN := $(ubsan-cflags-y)