Index: lld/ELF/LTO.cpp =================================================================== --- lld/ELF/LTO.cpp +++ lld/ELF/LTO.cpp @@ -196,7 +196,9 @@ std::tie(OldPrefix, NewPrefix) = Config->ThinLTOPrefixReplace.split(';'); // Create the empty files which, if indexed, will be overwritten later. - writeEmptyDistributedBuildOutputs(Obj.getName(), OldPrefix, NewPrefix, false); + if (Config->ThinLTOIndexOnly) + writeEmptyDistributedBuildOutputs(Obj.getName(), OldPrefix, NewPrefix, + false); unsigned SymNum = 0; std::vector Syms = F.getSymbols(); Index: lld/test/ELF/lto/thinlto.ll =================================================================== --- lld/test/ELF/lto/thinlto.ll +++ lld/test/ELF/lto/thinlto.ll @@ -58,8 +58,8 @@ ; The backend index for this module contains summaries from itself and ; Inputs/thinlto.ll, as it imports from the latter. ; BACKEND1: