Index: lib/Support/Windows/Path.inc =================================================================== --- lib/Support/Windows/Path.inc +++ lib/Support/Windows/Path.inc @@ -413,6 +413,16 @@ // a true error, so stop trying. for (unsigned Retry = 0; Retry != 200; ++Retry) { auto EC = rename_internal(FromHandle, To, true); + + if (EC.value() == ERROR_CALL_NOT_IMPLEMENTED) { + // Wine doesn't support SetFileInformationByHandle in rename_internal. + // Fall back to MoveFileEx. + if (::MoveFileExW(WideFrom.begin(), WideTo.begin(), + MOVEFILE_REPLACE_EXISTING)) + return std::error_code(); + return mapWindowsError(GetLastError()); + } + if (!EC || EC != errc::permission_denied) return EC;