From 3bbf3bd432ec1436bef6e2d7ffc83d1c031553ab Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 5 Mar 2020 23:52:26 +0000 Subject: [PATCH] toolchain.eclass: mangle -O3 down to -O2, not -O0 In bug #701786 'strip-flags' removed all unsafe options first including -O3 and only then mangled -O? to -O2. This effectively made gcc to compalie wth -O0, generated huge slow profile and confused LTO. Let's default to safer -O3->-O2 transition. Reported-by: jeff.lemos.a@gmail.com Closes: https://bugs.gentoo.org/701786 Signed-off-by: Sergei Trofimovich --- eclass/toolchain.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 62520ae92dff..d69ce9503eaa 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1494,8 +1494,8 @@ downgrade_arch_flags() { } gcc_do_filter_flags() { + replace-flags -O? -O2 # 701786 (-O3) strip-flags - replace-flags -O? -O2 # dont want to funk ourselves filter-flags '-mabi*' -m31 -m32 -m64 -- 2.26.2