Index: lld/Common/Filesystem.cpp =================================================================== --- lld/Common/Filesystem.cpp +++ lld/Common/Filesystem.cpp @@ -62,6 +62,10 @@ // defines affect the behavior of the Windows versions of the calls // we are using here. If this code stops working this is worth // bearing in mind. + + if (!sys::fs::exists(path)) + return; + SmallString<128> tmpName; if (!sys::fs::createUniqueFile(path + "%%%%%%%%.tmp", tmpName)) { if (!sys::fs::rename(path, tmpName))