diff --git a/mk/targets.mk b/mk/targets.mk index a179653df4..4562a48878 100644 --- a/mk/targets.mk +++ b/mk/targets.mk @@ -74,6 +74,10 @@ empty: all # support debug build %-debug: OPTFLAGS = -g -O0 +# support address sanitiser +%-asan: OPTFLAGS = -g -O0 -fsanitize=address -fno-omit-frame-pointer +%-asan: LDFLAGS += -fsanitize=address + # cope with -nologging %-nologging: EXTRAFLAGS += "-DLOGGING_ENABLED=DISABLED " @@ -94,6 +98,7 @@ endef define board_template $(1)-hil : $(1) $(1)-debug : $(1) +$(1)-asan : $(1) $(1)-hilsensors : $(1) endef