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: unassignedb...@nondot.org
          Reporter: cs...@ukr.net
                CC: llvm-bugs@lists.llvm.org, smithp...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to