From c9b82d76e27e4b76dc703670c167c4e5f3071250 Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Mon, 8 Jul 2013 14:44:57 +0000 Subject: [PATCH] Fixes problem when calling llvm-ar from an unmodifiable directory. This fixes a regression introduced by r185726: the new call to get a unique file does not prepend the system temporary directory, so we need to anchor on the file that the temporary file gets moved to to ensure we're on the same file system. llvm-svn: 185825 --- llvm/tools/llvm-ar/ArchiveWriter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/tools/llvm-ar/ArchiveWriter.cpp b/llvm/tools/llvm-ar/ArchiveWriter.cpp index 52ce045c16c2..ef910019df40 100644 --- a/llvm/tools/llvm-ar/ArchiveWriter.cpp +++ b/llvm/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;