"Michael S. Tsirkin" <m...@redhat.com> writes: > On Tue, May 21, 2013 at 11:01:05PM +0100, Peter Maydell wrote: >> On 21 May 2013 22:46, Michael S. Tsirkin <m...@redhat.com> wrote: >> > Once in a while make gets killed and doesn't >> > clean up partial object files after it. >> > Result is nasty errors from link. >> > This hack checks object is well formed before linking, >> > and rebuilds it if not. >> > >> > Signed-off-by: Michael S. Tsirkin <m...@redhat.com> >> > --- >> > >> > Is below useful for others? >> >> Seems to me like this is just working around a make bug: >> it is supposed to delete the partial object if it gets >> killed. > > It can't if it gets killed by kill -9 or e.g. OOM killer > (or OS reboot).
Any generated file could be truncated then, not just objects. If you abort a build with kill -9 or equivalent, you blow away the build tree and start over. A sufficiently unlucky truncation could still build, but not work. [...]