Activate GCC annobin plugin during LTO linking (#1983727)

Resolves: #1983727
This commit is contained in:
Florian Weimer 2021-07-30 13:07:12 +02:00
parent 4dd0b33150
commit 95a3d5d4a4
2 changed files with 6 additions and 2 deletions

3
macros
View File

@ -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
@ -323,6 +323,7 @@ print(result)
# The annobin plugin is not built for clang yet
%_annobin_clang_plugin %dnl-fplugin=/usr/lib64/clang/`clang -dumpversion`/lib/annobin.so
%_annotation_cflags %{?_annotated_build:%{expand:%%{_annobin_%{toolchain}_plugin}}}
%_annotation_ldflags %{?_lto_cflags:%{_annotation_cflags}}
# Fail linking if there are undefined symbols. Required for proper
# ELF symbol versioning support. Disabled by default.

View File

@ -6,7 +6,7 @@
Summary: Red Hat specific rpm configuration files
Name: redhat-rpm-config
Version: 186
Version: 187
Release: 1%{?dist}
# No version specified.
License: GPL+
@ -189,6 +189,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua
%doc buildflags.md
%changelog
* Fri Jul 30 2021 Florian Weimer <fweimer@redhat.com> - 187-1
- Active GCC plugin during LTO linking (#1983727)
* Thu Jul 22 2021 Florian Weimer <fweimer@redhat.com> - 186-1
- aarch64: Do not build with -mbranch-protection=standard (#1984652)