diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2018-11-22 23:52:23 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2018-11-22 23:52:23 +0000 |
commit | 86549c2ffccd36fbf393a3574167278a412a4d6d (patch) | |
tree | 036ac7dde98f0368daf4c9f5958bf6a789cffc95 | |
parent | 4.3.6: backport libjava-ucontext.patch: bug #671270 (diff) | |
download | gcc-patches-86549c2f.tar.gz gcc-patches-86549c2f.tar.bz2 gcc-patches-86549c2f.zip |
8.2.0: pull 10_all_default-fortify-source.patch from Debian, bug #621036
glibc and other packages expect _FORTIFY_SOURCE define to be a number.
Before the patch _FORTIFY_SOURCE was
((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)
After the patch it's
2
(or not set if build is unoptimised).
Reported-by: Martin Kletzander
Bug: https://bugs.gentoo.org/621036
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rw-r--r-- | 8.2.0/gentoo/10_all_default-fortify-source.patch | 17 | ||||
-rw-r--r-- | 8.2.0/gentoo/README.history | 3 |
2 files changed, 15 insertions, 5 deletions
diff --git a/8.2.0/gentoo/10_all_default-fortify-source.patch b/8.2.0/gentoo/10_all_default-fortify-source.patch index 36c5762..d307474 100644 --- a/8.2.0/gentoo/10_all_default-fortify-source.patch +++ b/8.2.0/gentoo/10_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/8.2.0/gentoo/README.history b/8.2.0/gentoo/README.history index a2e8c1b..52c8a22 100644 --- a/8.2.0/gentoo/README.history +++ b/8.2.0/gentoo/README.history @@ -1,3 +1,6 @@ +1.6 TODO + U 10_all_default-fortify-source.patch + 1.5 27 Oct 2018 + 111_all_ubd-hog-PR85704.patch U 105_all_libgfortran-Werror.patch |