Add -flto to ldflags for clang toolchain
Also, add a gating CI tests to ensure that future macro changes work with clang.
This commit is contained in:
parent
8a5ee87c50
commit
d698d04313
5
macros
5
macros
@ -86,7 +86,10 @@
|
|||||||
# the flags, while intended for ld, are still passed through the gcc
|
# the flags, while intended for ld, are still passed through the gcc
|
||||||
# compiler driver. At the beginning of %%build, the environment
|
# compiler driver. At the beginning of %%build, the environment
|
||||||
# variable RPM_LD_FLAGS to this value.
|
# variable RPM_LD_FLAGS to this value.
|
||||||
%build_ldflags -Wl,-z,relro %{_ld_as_needed_flags} %{_ld_symbols_flags} %{_hardened_ldflags}
|
# 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}" : "" ]
|
||||||
|
|
||||||
# Expands to shell code to set the compiler/linker environment
|
# Expands to shell code to set the compiler/linker environment
|
||||||
# variables CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, LDFLAGS if they have
|
# variables CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, LDFLAGS if they have
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Summary: Red Hat specific rpm configuration files
|
Summary: Red Hat specific rpm configuration files
|
||||||
Name: redhat-rpm-config
|
Name: redhat-rpm-config
|
||||||
Version: 168
|
Version: 169
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
# No version specified.
|
# No version specified.
|
||||||
License: GPL+
|
License: GPL+
|
||||||
@ -212,6 +212,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua
|
|||||||
%{_rpmconfigdir}/macros.d/macros.kmp
|
%{_rpmconfigdir}/macros.d/macros.kmp
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Aug 20 2020 Tom Stellard <tstellar@redhat.com> - 169-1
|
||||||
|
- Add -flto to ldflags for clang toolchain
|
||||||
|
|
||||||
* Thu Aug 20 2020 Neal Gompa <ngompa13@gmail.com> - 168-1
|
* Thu Aug 20 2020 Neal Gompa <ngompa13@gmail.com> - 168-1
|
||||||
- Fix CC/CXX exports so arguments are included in exported variable
|
- Fix CC/CXX exports so arguments are included in exported variable
|
||||||
- Allow overrides of CC/CXX like CFLAGS and CXXFLAGS from shell variables
|
- Allow overrides of CC/CXX like CFLAGS and CXXFLAGS from shell variables
|
||||||
|
Loading…
Reference in New Issue
Block a user