Skip to content

Commit

Permalink
Increase _FORTIFY_SOURCE level from 2 to 3 in CFLAGS
Browse files Browse the repository at this point in the history
This enables buffer overflow checks if the buffer size is non-const
but known during runtime and GCC 12.0 or later is used.
  • Loading branch information
chrfranke authored and jon-turney committed Feb 4, 2024
1 parent 1dabadf commit b7008d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/compilers.cygpart
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ declare -x CC="gcc";
# Flags passed to CC when compiling C code. Individual packages may append
# or override this value if they will not build correctly without it.
# DEFAULT VALUE
# -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4
# -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=3 -fstack-protector-strong --param=ssp-buffer-size=4
#****
declare -x CFLAGS="-ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4";
declare -x CFLAGS="-ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=3 -fstack-protector-strong --param=ssp-buffer-size=4";

#****v* Compiling/CPPFLAGS
# DESCRIPTION
Expand Down

0 comments on commit b7008d8

Please sign in to comment.