1 |
commit: 86549c2ffccd36fbf393a3574167278a412a4d6d |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Nov 22 23:52:23 2018 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Nov 22 23:52:23 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=86549c2f |
7 |
|
8 |
8.2.0: pull 10_all_default-fortify-source.patch from Debian, bug #621036 |
9 |
|
10 |
glibc and other packages expect _FORTIFY_SOURCE define to be a number. |
11 |
Before the patch _FORTIFY_SOURCE was |
12 |
((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0) |
13 |
After the patch it's |
14 |
2 |
15 |
(or not set if build is unoptimised). |
16 |
|
17 |
Reported-by: Martin Kletzander |
18 |
Bug: https://bugs.gentoo.org/621036 |
19 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
20 |
|
21 |
8.2.0/gentoo/10_all_default-fortify-source.patch | 17 ++++++++++++----- |
22 |
8.2.0/gentoo/README.history | 3 +++ |
23 |
2 files changed, 15 insertions(+), 5 deletions(-) |
24 |
|
25 |
diff --git a/8.2.0/gentoo/10_all_default-fortify-source.patch b/8.2.0/gentoo/10_all_default-fortify-source.patch |
26 |
index 36c5762..d307474 100644 |
27 |
--- a/8.2.0/gentoo/10_all_default-fortify-source.patch |
28 |
+++ b/8.2.0/gentoo/10_all_default-fortify-source.patch |
29 |
@@ -1,14 +1,21 @@ |
30 |
-Enable -D_FORTIFY_SOURCE=2 by default. |
31 |
- |
32 |
+Taken Debian's patch and removed docs matches: |
33 |
+ https://salsa.debian.org/toolchain-team/gcc.git |
34 |
+Also see https://bugs.gentoo.org/621036 where |
35 |
+initially Gentoo used too complicated macro. |
36 |
|
37 |
+# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++, |
38 |
+# DP: if the optimization level is > 0 |
39 |
--- a/gcc/c-family/c-cppbuiltin.c |
40 |
+++ b/gcc/c-family/c-cppbuiltin.c |
41 |
-@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile) |
42 |
+@@ -951,6 +951,12 @@ c_cpp_builtins (cpp_reader *pfile) |
43 |
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); |
44 |
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0); |
45 |
|
46 |
-+ /* Fortify Source enabled by default w/optimization. */ |
47 |
-+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)"); |
48 |
++#if !defined(ACCEL_COMPILER) |
49 |
++ /* Fortify Source enabled by default for optimization levels > 0 */ |
50 |
++ if (optimize) |
51 |
++ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2); |
52 |
++#endif |
53 |
+ |
54 |
/* Misc. */ |
55 |
if (flag_gnu89_inline) |
56 |
|
57 |
diff --git a/8.2.0/gentoo/README.history b/8.2.0/gentoo/README.history |
58 |
index a2e8c1b..52c8a22 100644 |
59 |
--- a/8.2.0/gentoo/README.history |
60 |
+++ b/8.2.0/gentoo/README.history |
61 |
@@ -1,3 +1,6 @@ |
62 |
+1.6 TODO |
63 |
+ U 10_all_default-fortify-source.patch |
64 |
+ |
65 |
1.5 27 Oct 2018 |
66 |
+ 111_all_ubd-hog-PR85704.patch |
67 |
U 105_all_libgfortran-Werror.patch |