1 |
commit: a664bdd217c8f4fbb108d6c2585425383b749b3b |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Mar 6 18:29:12 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Mar 6 18:35:50 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a664bdd2 |
7 |
|
8 |
toolchain.eclass: always use -O2, even when no -O is passed in. |
9 |
|
10 |
Mike noticed that CFLAGS without any optimization options |
11 |
still effectively are -O0. Let's follow glibc ebuild here |
12 |
and always use -O2. |
13 |
|
14 |
Suggested-by: Mike Gilbert |
15 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
16 |
|
17 |
eclass/toolchain.eclass | 6 +++++- |
18 |
1 file changed, 5 insertions(+), 1 deletion(-) |
19 |
|
20 |
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass |
21 |
index d69ce9503ea..05d13189d3d 100644 |
22 |
--- a/eclass/toolchain.eclass |
23 |
+++ b/eclass/toolchain.eclass |
24 |
@@ -1494,8 +1494,12 @@ downgrade_arch_flags() { |
25 |
} |
26 |
|
27 |
gcc_do_filter_flags() { |
28 |
- replace-flags -O? -O2 # 701786 (-O3) |
29 |
+ # Be conservative here: |
30 |
+ # - don't allow -O3 and like to over-optimize libgcc # 701786 |
31 |
+ # - don't allow -O0 to generate potentially invalid startup code |
32 |
strip-flags |
33 |
+ filter-flags '-O?' |
34 |
+ append-flags -O2 |
35 |
|
36 |
# dont want to funk ourselves |
37 |
filter-flags '-mabi*' -m31 -m32 -m64 |