diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk index 26690ac9d7..4ddfd327c9 100644 --- a/mk/spdk.common.mk +++ b/mk/spdk.common.mk @@ -58,6 +58,8 @@ ifeq ($(CONFIG_DEBUG), y) COMMON_CFLAGS += -DDEBUG -O0 else COMMON_CFLAGS += -DNDEBUG -O2 +# Enable _FORTIFY_SOURCE checks - these only work when optimizations are enabled. +COMMON_CFLAGS += -D_FORTIFY_SOURCE=2 endif CFLAGS += $(COMMON_CFLAGS) -Wno-pointer-sign -std=gnu11