This can be reproduced with a recent enough version of Clang with support for ThinLTO, which *requires* passing -fuse-ld=lld to the linker, and -flto=thin to *both* the compiler and the linker. Failing to pass the linker options results in lld not being used and the GNU Binutils linkers don't understand LLVM bitcode, or in lld being used (if it's the default) but -flto=thin will be missing from the linker command line (not good either). This has gone unnoticed even when some distributions use LTO becase it just *happens* to work with the Binutils linkers: linking object built with -flto wors even if the flag is not passed to the linker.
This can be reproduced by trying to build with the following CMake incantation: CC=clang CXX=clang \ LDFLAGS='-fuse-ld=lld -flto=thin' CFLAGS='-flto=thin' CXXFLAGS='-flto=thin' cmake -DPORT=GTK -DENABLE_GTKDOC=ON <…>
Created attachment 376897 [details] Patch
Comment on attachment 376897 [details] Patch Looks legit :)
Comment on attachment 376897 [details] Patch Clearing flags on attachment: 376897 Committed r248954: <https://trac.webkit.org/changeset/248954>
All reviewed patches have been landed. Closing bug.
<rdar://problem/54565709>