summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2020-03-06 18:29:12 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2020-03-06 18:35:50 +0000
commita664bdd217c8f4fbb108d6c2585425383b749b3b (patch)
tree5fa07480673f4e4ca85a06cc6f722e5c0edb86d4 /eclass/toolchain.eclass
parentdev-python/pyformance-0.4-r1: add python3_7 (diff)
downloadgentoo-a664bdd217c8f4fbb108d6c2585425383b749b3b.tar.gz
gentoo-a664bdd217c8f4fbb108d6c2585425383b749b3b.tar.bz2
gentoo-a664bdd217c8f4fbb108d6c2585425383b749b3b.zip
toolchain.eclass: always use -O2, even when no -O is passed in.
Mike noticed that CFLAGS without any optimization options still effectively are -O0. Let's follow glibc ebuild here and always use -O2. Suggested-by: Mike Gilbert Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'eclass/toolchain.eclass')
-rw-r--r--eclass/toolchain.eclass6
1 files changed, 5 insertions, 1 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index d69ce9503eaa..05d13189d3dd 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1494,8 +1494,12 @@ downgrade_arch_flags() {
}
gcc_do_filter_flags() {
- replace-flags -O? -O2 # 701786 (-O3)
+ # Be conservative here:
+ # - don't allow -O3 and like to over-optimize libgcc # 701786
+ # - don't allow -O0 to generate potentially invalid startup code
strip-flags
+ filter-flags '-O?'
+ append-flags -O2
# dont want to funk ourselves
filter-flags '-mabi*' -m31 -m32 -m64