From 24d29fb0f5579a18846f2729d40102da9ce0b1b9 Mon Sep 17 00:00:00 2001 From: Allen Webb Date: Wed, 5 Dec 2018 16:07:49 -0800 Subject: Makefiles: Add support for MSAN and UBSAN. This adds support for building fuzz targets with memory and undefined behavior sanitizers. BRANCH=None BUG=chromium:911310 TEST=USE="ubsan fuzzer" ./build_packages \ --board=amd64-generic --skip_chroot_upgrade chromeos-ec && (cd ../platform/ec && unset BOARD && make -j buildall buildfuzztests) Change-Id: Ic7f4c1d7fcc1f6347f091b98567167066787cb9c Signed-off-by: Allen Webb Reviewed-on: https://chromium-review.googlesource.com/1364326 Reviewed-by: Manoj Gupta Reviewed-by: Mike Frysinger --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 232f0cd6de..dabe3e9b20 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,12 @@ BOOTBLOCK ?= # the EC image (if no touchpad firmware is provided, just output blank hashes). TOUCHPAD_FW ?= +# If TEST_FUZZ is set make sure at least one sanitizer is enabled. +ifeq ($(TEST_FUZZ)_$(TEST_ASAN)$(TEST_MSAN)$(TEST_UBSAN),y_) +$(warning No sanitizer was specified defaulting to address sanitization.) +override TEST_ASAN:=y +endif + include Makefile.toolchain # Define the traditional first target. The dependencies of this are near the -- cgit v1.2.1