[LLVMdev] Building the llvm runtime: 'Can't destroy file: Theprocess cannot access the fi

Reid Spencer reid at x10sys.com
Thu Jan 27 14:09:09 PST 2005


On Thu, 2005-01-27 at 13:16, Henrik Bach wrote:
> c:\projects\build\MinGW\llvm-4-1\Debug\bin\llvm-ar.exe: 
> c:/projects/build/MinGW/llvm-4-1/Debug/lib/libc.bca-000000: Can't destroy 
> file (hb:2): The process cannot access the file because it is being used by 
> another process.
> make[3]: *** [/C/projects/build/MinGW/llvm-4-1/Debug/lib/libc.bca] Error 2
> -------------------------
> 
> Like before, the temporary file libc.bca-000000 doesn't exist when finished. 
> But libc.bca exists.

Here's what's happening in the archiver. It is creating libc.bca. The
way it does that is to create a temporary file using the
Path::createTemporaryFile. The file with the -000000 suffix is the
temporary file that gets renamed as libc.bca when llvm-ar is finished
build it. So, I think what is going on is that the file is being renamed
correctly but Win32/Path.inc is throwing an exception anyway (where the
error message comes from) and llvm-ar returns error code 2 (which means
an error exception was generated). We just need to find out why
Win32/Path.inc is throwing an exception on rename. Possibly the
temporary file has not been closed at the point of the rename. 

See the logic in Archive::writeToDisk in
lib/Bytecode/Archive/ArchiveWriter.cpp for the details. The logic looks
correct to me. The Archive file is closed and then renamed.

Reid. 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050127/a6b89d55/attachment.sig>


More information about the llvm-dev mailing list