CMAKE_LINK_DEPENDS_USE_LINKER broken with LTO
CMake 3.27 added and enabled by default the CMAKE_LINK_DEPENDS_USE_LINKER feature, which uses the --dependency-file
linker flag to determine dependencies. However, the implementation of this flag is currently buggy in the ld.bfd and ld.gold linkers (ld.lld works fine) if linker plugins are involved, see https://sourceware.org/bugzilla/show_bug.cgi?id=30568 for details. This results in spurious relinks of all binaries and libraries on each build system invocation.
I would recommend to disable this functionality by default until the linker bugs are fixed.
We found this issue due to major build time regressions on Fedora rawhide RPM builds, which recently upgraded to CMake 2.37.