From 5baaf4a99cc77572d3496a7000674098bef7ed68 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 21 Jul 2020 21:38:41 -0600 Subject: [PATCH] Enable LTO by default --- macros | 12 +++++++++++- redhat-rpm-config.spec | 5 ++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/macros b/macros index 20396fb..9f2067b 100644 --- a/macros +++ b/macros @@ -320,7 +320,17 @@ print(result) %_ld_as_needed 1 %_ld_as_needed_flags %{?_ld_as_needed:-Wl,--as-needed} -%_general_options -O2 -fexceptions -g -grecord-gcc-switches -pipe +# LTO is the default in Fedora. +# "%define _lto_cflags %{nil}" to opt out +# +# We currently have -ffat-lto-objects turned on out of an abundance of +# caution. To remove it we need to do a check of the installed .o/.a files +# to verify they have real sections/symbols after LTO stripping. That +# way we can detect installing an unusable .o/.a file. This is on the TODO +# list for F34. +%_lto_cflags -flto -ffat-lto-objects + +%_general_options -O2 %{?_lto_cflags} -fexceptions -g -grecord-gcc-switches -pipe %_warning_options -Wall -Werror=format-security %_preprocessor_defines -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index 7cd0eaa..b9f85ce 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -6,7 +6,7 @@ Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config -Version: 162 +Version: 163 Release: 1%{?dist} # No version specified. License: GPL+ @@ -211,6 +211,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua %{_rpmconfigdir}/macros.d/macros.kmp %changelog +* Tue Jul 21 2020 Jeff Law - 163-1 +- Enable LTO by default + * Thu Jul 16 2020 Lumír Balhar - 162-1 - New script brp-fix-pyc-reproducibility