From ab37e9a171794d3d1fdaa5eff93a61590e5cee8c Mon Sep 17 00:00:00 2001 From: Ryan Salsamendi Date: Sun, 11 Jun 2017 21:07:31 -0700 Subject: Add support for Undefined Behavior Sanitizer Initial support for undefined behavior sanitizer in ramstage. Enabling this will add -fsanitize=undefined to the compiler command line and link with ubsan.c in ramstage. Code with UB triggers a report with error, file, and line number, then aborts. Change-Id: Ib139a418db97b533f99fc59bcb1a71fb6dcd01d8 Signed-off-by: Ryan Salsamendi Reviewed-on: https://review.coreboot.org/20156 Tested-by: build bot (Jenkins) Reviewed-by: Philipp Deppenwiese --- src/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Kconfig') diff --git a/src/Kconfig b/src/Kconfig index 50a054a128..637f5757e7 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -200,6 +200,14 @@ config COVERAGE coverage information in CBMEM for extraction from user space. If unsure, say N. +config UBSAN + bool "Undefined behavior sanitizer support" + default n + help + Instrument the code with checks for undefined behavior. If unsure, + say N because it adds a small performance penalty and may abort + on code that happens to work in spite of the UB. + config RELOCATABLE_RAMSTAGE depends on EARLY_CBMEM_INIT bool "Build the ramstage to be relocatable in 32-bit address space." -- cgit v1.2.3