diff options
Diffstat (limited to 'debian/patches/gcc-default-format-security.diff')
-rw-r--r-- | debian/patches/gcc-default-format-security.diff | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/debian/patches/gcc-default-format-security.diff b/debian/patches/gcc-default-format-security.diff index 54106eb..c554c4d 100644 --- a/debian/patches/gcc-default-format-security.diff +++ b/debian/patches/gcc-default-format-security.diff @@ -1,24 +1,5 @@ # DP: Turn on -Wformat -Wformat-security by default for C, C++, ObjC, ObjC++. ---- - gcc/c-common.c | 2 +- - gcc/c.opt | 2 +- - gcc/doc/invoke.texi | 8 ++++++++ - 3 files changed, 10 insertions(+), 2 deletions(-) - -Index: b/src/gcc/c-family/c.opt -=================================================================== ---- a/src/gcc/c-family/c.opt -+++ b/src/gcc/c-family/c.opt -@@ -401,7 +401,7 @@ - Warn about format strings that are not literals - - Wformat-security --C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) -+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) - Warn about possible security problems with format functions - - Wformat-y2k Index: b/src/gcc/doc/invoke.texi =================================================================== --- a/src/gcc/doc/invoke.texi @@ -35,3 +16,22 @@ Index: b/src/gcc/doc/invoke.texi @item -Wformat-y2k @opindex Wformat-y2k @opindex Wno-format-y2k +--- a/src/gcc/gcc.c ++++ b/src/gcc/gcc.c +@@ -654,11 +654,14 @@ + #define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G" + #endif + ++/* no separate spec, just shove it into the ssp default spec */ ++#define FORMAT_SECURITY_SPEC "%{!Wno-format-security:-Wformat-security}" ++ + #ifndef SSP_DEFAULT_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP +-#define SSP_DEFAULT_SPEC "%{!fno-stack-protector:%{!fstack-protector-all:%{!ffreestanding:%{!nostdlib:-fstack-protector}}}}" ++#define SSP_DEFAULT_SPEC "%{!fno-stack-protector:%{!fstack-protector-all:%{!ffreestanding:%{!nostdlib:-fstack-protector}}}} " FORMAT_SECURITY_SPEC + #else +-#define SSP_DEFAULT_SPEC "" ++#define SSP_DEFAULT_SPEC FORMAT_SECURITY_SPEC + #endif + #endif + |