Add support for Undefined Behavior Sanitizer

Hardware / Coreboot - Ryan Salsamendi [hotmail.com] - 14 June 2017 13:56 EDT

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

ab37e9a Add support for Undefined Behavior Sanitizer
src/Kconfig | 8 ++
src/lib/Makefile.inc | 4 +
src/lib/ubsan.c | 360 +++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 372 insertions(+)

Upstream: review.coreboot.org


  • Share