[llvm-bugs] [Bug 48378] New: wasm-ld fails in Windows 7
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Dec 3 11:22:45 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=48378
Bug ID: 48378
Summary: wasm-ld fails in Windows 7
Product: lld
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: release blocker
Priority: P
Component: All Bugs
Assignee: unassignedbugs at nondot.org
Reporter: cs134 at ukr.net
CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com
Recently I installed emscripten (emsdk) and it failed to compile hello world,
saying this:
wasm-ld: error: failed to write the output file: permission denied
I debugged wasm-ld and found out this:
"\llvm\lib\Support\Windows\Path.inc" have function "static std::error_code
setDeleteDisposition(HANDLE Handle, bool Delete)"
It calls SetFileInformationByHandle on file handle to set it for deletion after
closing.
But I have Windows 7 and it behaves differently from Windows 10!
"static std::error_code rename_handle(HANDLE FromHandle, const Twine &To)"
called when it tries to commit all changes done to a temporary file.
this function calls "rename_internal", and "rename_internal" calls
"GetFinalPathNameByHandleW"
On Windows 7Â GetFinalPathNameByHandleW fails with error code 5
(ERROR_ACCESS_DENIED) when it tries to get path of file scheduled for deletion.
On Windows 10 everything works perfectly.
Here's sample code in Python to quickly test this behavior:
https://pastebin.com/v51m3uBU
Possible solution is to set Disposition.DeleteFile back to false before calling
GetFinalPathNameByHandleW.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201203/9062e78c/attachment-0001.html>
More information about the llvm-bugs
mailing list