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
1010 ubsan-cflags-$(CONFIG_UBSAN_UNREACHABLE) += -fsanitize=unreachable
1111 ubsan-cflags-$(CONFIG_UBSAN_BOOL) += -fsanitize=bool
1212 ubsan-cflags-$(CONFIG_UBSAN_ENUM) += -fsanitize=enum
13−ubsan-cflags-$(CONFIG_UBSAN_TRAP) += -fsanitize-undefined-trap-on-error
13+ubsan-cflags-$(CONFIG_UBSAN_TRAP) += $(call cc-option,-fsanitize-trap=undefined,-fsanitize-undefined-trap-on-error)
1414
1515 export CFLAGS_UBSAN := $(ubsan-cflags-y)