[LLVMdev] llvm-ranlib: Bus Error in regressions + fix

Reid Spencer reid at x10sys.com
Thu Nov 24 09:16:35 PST 2005


Evan Jones wrote:

> Windows look like Unix anyway, from an API perspective.
> 
> In fact, with regards to the specific "cannot unlink while open" issue, 
> Cygwin works around it (partially) by removing the file as soon as the 
> file is closed. I'm not sure that would be sufficient in this case, but 
> it might be.

That occurs because of a sharing violation within the Windows operating system. 
Windows doesn't have the notion of unlink. If you remove a file, its gone. 
There are no links. Consequently, if you try to modify a file that is open by 
another handle, you get a sharing violation.  To work around that, you have to 
close or remove the file first. Cygwin does work around this, but that is not 
our solution. We have Windows specific code in lib/System that also works 
around this by closing the file handles properly.  That is why I suggested that 
you use the sys::Path class so that the operations on the files work reliably 
on all platforms (and if not, we only have to fix it in one place).

Reid.




More information about the llvm-dev mailing list