diff --git a/tools/llvm-ar/ArchiveWriter.cpp b/tools/llvm-ar/ArchiveWriter.cpp index 52ce045c16c..ef910019df4 100644 --- a/tools/llvm-ar/ArchiveWriter.cpp +++ b/tools/llvm-ar/ArchiveWriter.cpp @@ -260,8 +260,8 @@ bool Archive::writeToDisk(bool TruncateNames, std::string *ErrMsg) { // Create a temporary file to store the archive in int TmpArchiveFD; SmallString<128> TmpArchive; - error_code EC = sys::fs::createUniqueFile("temp-archive-%%%%%%%.a", - TmpArchiveFD, TmpArchive); + error_code EC = sys::fs::createUniqueFile( + archPath + ".temp-archive-%%%%%%%.a", TmpArchiveFD, TmpArchive); if (EC) return true;