When the compiler writes its output file, the file is created, written and closed. Hence, there is a small window when the file exists and is empty. This breaks make -j, because another process may be waiting for the file to come into existence.
What should happen is that the file is created under a temporary name (perhaps named using random bytes from the crypt package), written, and then renamed. This should work because rename is atomic. Note that the temp file should be in the same directory to be used for the output file.
When the compiler writes its output file, the file is created, written and closed. Hence, there is a small window when the file exists and is empty. This breaks
make -j
, because another process may be waiting for the file to come into existence.What should happen is that the file is created under a temporary name (perhaps named using random bytes from the crypt package), written, and then renamed. This should work because rename is atomic. Note that the temp file should be in the same directory to be used for the output file.