diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2018-12-07 22:53:01 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2018-12-07 22:53:01 +0000 |
commit | 0402657947045ebe81a9806e8dfdeaf69591e6a0 (patch) | |
tree | 868c0042ca8bac04061ff3cbb3e5eba105fbbf8c /7.4.0 | |
parent | 7.4.0: initial copy/rename of 7.3.0 patches not included in 7.4.0 (diff) | |
download | gcc-patches-0402657947045ebe81a9806e8dfdeaf69591e6a0.tar.gz gcc-patches-0402657947045ebe81a9806e8dfdeaf69591e6a0.tar.bz2 gcc-patches-0402657947045ebe81a9806e8dfdeaf69591e6a0.zip |
7.4.0: pull 10_all_default-fortify-source.patch from Debian, bug #621036
Reported-by: Martin Kletzander
Bug: https://bugs.gentoo.org/621036
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to '7.4.0')
-rw-r--r-- | 7.4.0/gentoo/01_all_default-fortify-source.patch | 17 | ||||
-rw-r--r-- | 7.4.0/gentoo/README.history | 5 |
2 files changed, 16 insertions, 6 deletions
diff --git a/7.4.0/gentoo/01_all_default-fortify-source.patch b/7.4.0/gentoo/01_all_default-fortify-source.patch index 36c5762..d307474 100644 --- a/7.4.0/gentoo/01_all_default-fortify-source.patch +++ b/7.4.0/gentoo/01_all_default-fortify-source.patch @@ -1,14 +1,21 @@ -Enable -D_FORTIFY_SOURCE=2 by default. - +Taken Debian's patch and removed docs matches: + https://salsa.debian.org/toolchain-team/gcc.git +Also see https://bugs.gentoo.org/621036 where +initially Gentoo used too complicated macro. +# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++, +# DP: if the optimization level is > 0 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c -@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile) +@@ -951,6 +951,12 @@ c_cpp_builtins (cpp_reader *pfile) builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0); -+ /* Fortify Source enabled by default w/optimization. */ -+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)"); ++#if !defined(ACCEL_COMPILER) ++ /* Fortify Source enabled by default for optimization levels > 0 */ ++ if (optimize) ++ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2); ++#endif + /* Misc. */ if (flag_gnu89_inline) diff --git a/7.4.0/gentoo/README.history b/7.4.0/gentoo/README.history index 14581f5..57a1e8f 100644 --- a/7.4.0/gentoo/README.history +++ b/7.4.0/gentoo/README.history @@ -1,4 +1,7 @@ -1.0 TODO +1.1 TODO + U 01_all_default-fortify-source.patch + +1.0 [not released, a copy of 8.2.0] + 01_all_default-fortify-source.patch + 02_all_default-warn-format-security.patch + 03_all_default-warn-trampolines.patch |