summaryrefslogtreecommitdiff
path: root/debian/patches/gcc-default-format-security.diff
diff options
context:
space:
mode:
authordoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2013-09-04 13:32:55 +0000
committerdoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2013-09-04 13:32:55 +0000
commit770854fa078454d11e352e65aa274d7b5deaa9bc (patch)
tree4494c86717401f8ad5e54d5e7bb00eebc632a36c /debian/patches/gcc-default-format-security.diff
parenta411e4eeb12531d2d28296ccf74e6c8d368f95e3 (diff)
downloadgcc-48-770854fa078454d11e352e65aa274d7b5deaa9bc.tar.gz
* Fix gcc-default-format-security.diff for GCC 4.8.
git-svn-id: svn://svn.debian.org/svn/gcccvs/branches/sid/gcc-4.8@6955 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
Diffstat (limited to 'debian/patches/gcc-default-format-security.diff')
-rw-r--r--debian/patches/gcc-default-format-security.diff38
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
+