From e6e1baf1c035a0e37233b3c7d6231187e208732d Mon Sep 17 00:00:00 2001 From: Vasiliy Glazov Date: Oct 30 2019 08:20:41 +0000 Subject: 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). --- diff --git a/octave.spec b/octave.spec index 7ce503a..a1a6b0c 100644 --- a/octave.spec +++ b/octave.spec @@ -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..