diff --git a/config/base.mk b/config/base.mk index c4eacd19da..bac55dc2e5 100644 --- a/config/base.mk +++ b/config/base.mk @@ -43,3 +43,6 @@ FUZZFLAGS:=-max_total_time=600 -timeout=10 -runs=10 # Obtain compiler version so that decisions can be made on disabling/enabling # certain flags CC_MAJOR_VERSION=$(shell $(CC) -dumpversion | cut -f1 -d.) + +# Default _FORTIFY_SOURCE level +FORTIFY_SOURCE?=2 diff --git a/config/extra/with-security.mk b/config/extra/with-security.mk index ad4aff4b0e..009536f89f 100644 --- a/config/extra/with-security.mk +++ b/config/extra/with-security.mk @@ -9,5 +9,5 @@ LDFLAGS+=-fstack-protector-strong # _FORTIFY_SOURCE only works when optimization is enabled ifeq ($(FD_DISABLE_OPTIMIZATION),) -CPPFLAGS+=-D_FORTIFY_SOURCE=2 +CPPFLAGS+=-D_FORTIFY_SOURCE=$(FORTIFY_SOURCE) endif