platform.in: Enable LTO by default

To opt out:

  %define optflags_lto %nil

To compile libs add `-ffat-lto-objects' like this:

  %define optflags_lto %optflags_lto -ffat-lto-objects

Do not use `-ffat-lto-objects' for anything except exported libs as it
doubles compile time.
This commit is contained in:
Виталий Чикунов 2021-07-28 06:49:46 +03:00
parent 715065e999
commit 9fdc144edd

View File

@ -607,4 +607,7 @@ PATH=/usr/libexec/rpm-build:$PATH\
# flags for compiling kernel
%optflags_kernel %nil
%optflags_default %optflags_core %optflags_warnings %optflags_debug %{!?_enable_debug:%{optflags_optimization}}
# link time optimization
%optflags_lto -flto
%optflags_default %optflags_core %optflags_warnings %optflags_debug %{!?_enable_debug:%{optflags_optimization}} %optflags_lto