aboutsummaryrefslogtreecommitdiff
path: root/Makefile.flags
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.flags')
-rw-r--r--Makefile.flags5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile.flags b/Makefile.flags
index 9f77674ba..65021de25 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -75,6 +75,11 @@ else
CFLAGS += $(call cc-option,-Os,$(call cc-option,-O2,))
endif
endif
+ifeq ($(CONFIG_DEBUG_SANITIZE),y)
+CFLAGS += $(call cc-option,-fsanitize=address,)
+CFLAGS += $(call cc-option,-fsanitize=leak,)
+CFLAGS += $(call cc-option,-fsanitize=undefined,)
+endif
# If arch/$(ARCH)/Makefile did not override it (with, say, -fPIC)...
ARCH_FPIC ?= -fpic