Skip to content

Commit

Permalink
Allow higher _FORTIFY_SOURCE levels
Browse files Browse the repository at this point in the history
  • Loading branch information
riptl authored and ripatel-fd committed Jan 5, 2025
1 parent 23a66e6 commit 8d4de28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config/base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion config/extra/with-security.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8d4de28

Please sign in to comment.