1 |
commit: 34cb2fd271320c1ba9699d146e98c7fdfac541bb |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 30 01:17:33 2023 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 30 01:17:33 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=34cb2fd2 |
7 |
|
8 |
13.1.0: update for default hardening as in 12.x |
9 |
|
10 |
See: 224f6241ec785ccc386eb191df36d919e9b62351 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
13.1.0/gentoo/01_all_default-fortify-source.patch | 8 ++++++-- |
14 |
13.1.0/gentoo/15_all_DEF_GENTOO_GLIBCXX_ASSERTIONS.patch | 14 ++++++++++++++ |
15 |
13.1.0/gentoo/README.history | 4 ++++ |
16 |
3 files changed, 24 insertions(+), 2 deletions(-) |
17 |
|
18 |
diff --git a/13.1.0/gentoo/01_all_default-fortify-source.patch b/13.1.0/gentoo/01_all_default-fortify-source.patch |
19 |
index d9f001a..79d6639 100644 |
20 |
--- a/13.1.0/gentoo/01_all_default-fortify-source.patch |
21 |
+++ b/13.1.0/gentoo/01_all_default-fortify-source.patch |
22 |
@@ -7,14 +7,18 @@ initially Gentoo used too complicated macro. |
23 |
# DP: if the optimization level is > 0 |
24 |
--- a/gcc/c-family/c-cppbuiltin.cc |
25 |
+++ b/gcc/c-family/c-cppbuiltin.cc |
26 |
-@@ -1510,6 +1510,12 @@ c_cpp_builtins (cpp_reader *pfile) |
27 |
+@@ -1510,6 +1510,16 @@ c_cpp_builtins (cpp_reader *pfile) |
28 |
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); |
29 |
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0); |
30 |
|
31 |
+#if !defined(ACCEL_COMPILER) |
32 |
++ #ifndef GENTOO_FORTIFY_SOURCE_LEVEL |
33 |
++ #define GENTOO_FORTIFY_SOURCE_LEVEL 2 |
34 |
++ #endif |
35 |
++ |
36 |
+ /* Fortify Source enabled by default for optimization levels > 0 */ |
37 |
+ if (optimize) |
38 |
-+ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2); |
39 |
++ builtin_define_with_int_value ("_FORTIFY_SOURCE", GENTOO_FORTIFY_SOURCE_LEVEL); |
40 |
+#endif |
41 |
+ |
42 |
/* Misc. */ |
43 |
|
44 |
diff --git a/13.1.0/gentoo/15_all_DEF_GENTOO_GLIBCXX_ASSERTIONS.patch b/13.1.0/gentoo/15_all_DEF_GENTOO_GLIBCXX_ASSERTIONS.patch |
45 |
new file mode 100644 |
46 |
index 0000000..2daf73b |
47 |
--- /dev/null |
48 |
+++ b/13.1.0/gentoo/15_all_DEF_GENTOO_GLIBCXX_ASSERTIONS.patch |
49 |
@@ -0,0 +1,14 @@ |
50 |
+https://bugs.gentoo.org/876895 |
51 |
+--- a/gcc/c-family/c-cppbuiltin.cc |
52 |
++++ b/gcc/c-family/c-cppbuiltin.cc |
53 |
+@@ -957,6 +957,10 @@ c_cpp_builtins (cpp_reader *pfile) |
54 |
+ cpp_define (pfile, "__cpp_rtti=199711L"); |
55 |
+ } |
56 |
+ |
57 |
++ #ifdef DEF_GENTOO_GLIBCXX_ASSERTIONS |
58 |
++ cpp_define (pfile, "_GLIBCXX_ASSERTIONS"); |
59 |
++ #endif |
60 |
++ |
61 |
+ if (cxx_dialect >= cxx11) |
62 |
+ cpp_define (pfile, "__GXX_EXPERIMENTAL_CXX0X__"); |
63 |
+ |
64 |
|
65 |
diff --git a/13.1.0/gentoo/README.history b/13.1.0/gentoo/README.history |
66 |
index 43b714e..1564ee1 100644 |
67 |
--- a/13.1.0/gentoo/README.history |
68 |
+++ b/13.1.0/gentoo/README.history |
69 |
@@ -1,3 +1,7 @@ |
70 |
+6 30 Jan 2023 |
71 |
+ U 01_all_default-fortify-source.patch |
72 |
+ + 15_all_DEF_GENTOO_GLIBCXX_ASSERTIONS.patch |
73 |
+ |
74 |
5 17 Dec 2022 |
75 |
U 30_all_tar_libstdc++-link.patch |