From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ueuju-0002gy-Jo for qemu-devel@nongnu.org; Tue, 21 May 2013 18:09:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ueujq-0002eD-Kn for qemu-devel@nongnu.org; Tue, 21 May 2013 18:09:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ueujq-0002dw-Ch for qemu-devel@nongnu.org; Tue, 21 May 2013 18:08:58 -0400 Date: Wed, 22 May 2013 01:09:17 +0300 From: "Michael S. Tsirkin" Message-ID: <20130521220917.GA803@redhat.com> References: <20130521214645.GA8863@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] makefile: detect corrupted elf files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Blue Swirl , Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org, Luiz Capitulino On Tue, May 21, 2013 at 11:01:05PM +0100, Peter Maydell wrote: > On 21 May 2013 22:46, Michael S. Tsirkin 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 > > --- > > > > 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). > > +$(all-obj-y): % : $$(if $$(shell size %), , CORRUPTBINARY) > > If we do do this, we probably ought to be running the > cross-prefix version of size, not the host version. Good point, thanks. > thanks > -- PMM