LTO, llvm-(nm, ar, ranlib)

Hello,

gcc-ar/gcc-nm/gcc-ranlib compared to ar/nm/ranlib provide an implicit --plugin argument, so that the former can work with LTO objects, even when the gcc-lto plugin is not in ${libdir}/bfd-plugins.

Do llvm-ar, llvm-ranlib and llvm-nm also imply a --plugin argument, compared to ar/ranlib/nm concerning LTO?

Also https://llvm.org/docs/LinkTimeOptimization.html does not say anything about llvm-ar/llvm-nm/llvm-ranlib, only on https://clang.llvm.org/docs/ThinLTO.html they are decently mentioned. At the same time under https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html gcc-ar and gcc-ranlib are recommended.

How should libraries be portably built with LTO? Shall ./configure detect, whether clang or gcc is used, and then substitute AR with llvm-ar or gcc-ar, until llvm starts installing LLVMgold.so under {libdir}/bfd-plugins ? At gcc I asked the very same question: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84995 .

Regards
   Дилян