diff --git a/Config.in b/Config.in index 64604a0aed..86699f58c6 100644 --- a/Config.in +++ b/Config.in @@ -930,6 +930,15 @@ config BR2_FORTIFY_SOURCE_2 Also adds checks at run-time (detected buffer overflow terminates the program) +config BR2_FORTIFY_SOURCE_3 + bool "Extended" + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_12 + help + This option sets _FORTIFY_SOURCES to 3 and even more + checking is added compared to level 2. Extends checks at + run-time that can introduce an additional performance + overhead. + endchoice comment "Fortify Source needs a glibc toolchain and optimization" diff --git a/package/Makefile.in b/package/Makefile.in index 43d214bcbe..7f1b00ba24 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -160,6 +160,8 @@ ifeq ($(BR2_FORTIFY_SOURCE_1),y) TARGET_HARDENED += -D_FORTIFY_SOURCE=1 else ifeq ($(BR2_FORTIFY_SOURCE_2),y) TARGET_HARDENED += -D_FORTIFY_SOURCE=2 +else ifeq ($(BR2_FORTIFY_SOURCE_3),y) +TARGET_HARDENED += -D_FORTIFY_SOURCE=3 endif TARGET_CPPFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64