Index: lib/Support/FileOutputBuffer.cpp =================================================================== --- lib/Support/FileOutputBuffer.cpp +++ lib/Support/FileOutputBuffer.cpp @@ -77,16 +77,11 @@ sys::RemoveFileOnSignal(TempFilePath); -#ifndef LLVM_ON_WIN32 - // On Windows, CreateFileMapping (the mmap function on Windows) - // automatically extends the underlying file. We don't need to - // extend the file beforehand. _chsize (ftruncate on Windows) is - // pretty slow just like it writes specified amount of bytes, - // so we should avoid calling that. + // The behavior is defined by the file system. On filesystems + // backed by NFS, this is essential. EC = sys::fs::resize_file(FD, Size); if (EC) return EC; -#endif auto MappedFile = llvm::make_unique( FD, mapped_file_region::readwrite, Size, 0, EC);