Enable LTO optimisations

This change enable gcc LTO optimisations.
It helps reduce RAM usege and rpms size.

For example on F31 octave rpm with LTO 17MB vs 18MB without LTO.
And octave-debuginfo rpm with LTO 117MB vs 128MB without LTO.

Enabling it has no any issue in runtime but can take some more time to build (but not critical).
This commit is contained in:
Vasiliy Glazov 2019-10-30 08:20:41 +00:00
parent 2c1fd845b6
commit e6e1baf1c0

View File

@ -19,6 +19,9 @@
%global relsuf .rc%{?rcver}
%endif
%global optflags %{optflags} -flto=auto
%global build_ldflags %{build_ldflags} -flto
Name: octave
Epoch: 6
Version: 5.1.0
@ -213,6 +216,9 @@ autoreconf -i
%build
export AR=%{_bindir}/gcc-ar
export RANLIB=%{_bindir}/gcc-ranlib
export NM=%{_bindir}/gcc-nm
%global enable64 no
export F77=gfortran
# TODO: some items appear to be bundled in libcruft..