toolchain.eclass: mangle -O3 down to -O2, not -O0
authorSergei Trofimovich <slyfox@gentoo.org>
Thu, 5 Mar 2020 23:52:26 +0000 (23:52 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Thu, 5 Mar 2020 23:52:26 +0000 (23:52 +0000)
commit3bbf3bd432ec1436bef6e2d7ffc83d1c031553ab
tree3d25396526042118e370e70a7e5d5d010107b3a4
parent47f2f61b980efab9ea9412db2aa484e51f0c5b2e
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 <slyfox@gentoo.org>
eclass/toolchain.eclass