From b7008d8aa55c56a057b703530ca7fc71ba429d10 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Fri, 2 Feb 2024 17:00:18 +0100 Subject: [PATCH] Increase _FORTIFY_SOURCE level from 2 to 3 in CFLAGS This enables buffer overflow checks if the buffer size is non-const but known during runtime and GCC 12.0 or later is used. --- lib/compilers.cygpart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compilers.cygpart b/lib/compilers.cygpart index 35e6fe28..52df5304 100644 --- a/lib/compilers.cygpart +++ b/lib/compilers.cygpart @@ -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