From bc8fa85e907d4b2b88760da8d23c9e17663c44fa Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 2 Aug 2021 12:43:26 +0200 Subject: [PATCH] Active GCC plugin during LTO linking See the downstream bug for details: https://bugzilla.redhat.com/show_bug.cgi?id=1983727 --- macros | 4 ++-- redhat-rpm-config.spec | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/macros b/macros index 53dce74..76a12b9 100644 --- a/macros +++ b/macros @@ -89,7 +89,7 @@ # When clang is used as a linker driver, it does not auto-detect the LTO # bytecode and neither does bfd, so we need to explicitly pass the -flto # flag when linking. -%build_ldflags -Wl,-z,relro %{_ld_as_needed_flags} %{_ld_symbols_flags} %{_hardened_ldflags} %[ "%{toolchain}" == "clang" ? "%{?_lto_cflags}" : "" ] +%build_ldflags -Wl,-z,relro %{_ld_as_needed_flags} %{_ld_symbols_flags} %{_hardened_ldflags} %{_annotation_ldflags} %[ "%{toolchain}" == "clang" ? "%{?_lto_cflags}" : "" ] # Expands to shell code to set the compiler/linker environment # variables CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, LDFLAGS if they have @@ -317,7 +317,7 @@ print(result) %_annobin_clang_plugin %dnl-fplugin=/usr/lib64/clang/`clang -dumpversion`/lib/annobin.so %_annotation_plugin %{?_annotated_build:%{expand:%%{_annobin_%{toolchain}_plugin}}} %_annotation_cflags %[ "%{_target_cpu}" == "armv7hl" ? "" : "%{_annotation_plugin}" ] - +%_annotation_ldflags %{?_lto_cflags:%{_annotation_cflags}} # Fail linking if there are undefined symbols. Required for proper # ELF symbol versioning support. Disabled by default. diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index b497fee..3229b74 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: 193 +Version: 194 Release: 1%{?dist} # No version specified. License: GPL+ @@ -215,6 +215,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua %{_rpmconfigdir}/macros.d/macros.kmp %changelog +* Mon Aug 2 2021 Florian Weimer - 194-1 +- Active GCC plugin during LTO linking + * Sat Jul 24 2021 Michel Alexandre Salim - 193-1 - Add macros.build-constraints - Keep the misc macros in alphabetical order