| |
@@ -86,7 +86,10 @@
|
| |
# the flags, while intended for ld, are still passed through the gcc
|
| |
# compiler driver. At the beginning of %%build, the environment
|
| |
# 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
|
| |
# variables CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, LDFLAGS if they have
|
| |
Also, add a gating CI tests to ensure that future macro changes work
with clang.