From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf2hk-0007HI-Ms for qemu-devel@nongnu.org; Wed, 22 May 2013 02:39:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf2hi-0003I0-L2 for qemu-devel@nongnu.org; Wed, 22 May 2013 02:39:20 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:41050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf2hi-0003Hp-CM for qemu-devel@nongnu.org; Wed, 22 May 2013 02:39:18 -0400 Message-ID: <519C6694.4020905@weilnetz.de> Date: Wed, 22 May 2013 08:32:52 +0200 From: Stefan Weil MIME-Version: 1.0 References: <20130521220709.GA26328@redhat.com> In-Reply-To: <20130521220709.GA26328@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv2 RFC] makefile: detect corrupted elf files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Blue Swirl , Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org, Luiz Capitulino Am 22.05.2013 00:07, schrieb Michael S. Tsirkin: > 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 > --- > > v1 actually prints some noise on stderr, this shuts it up. > > Makefile.target | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/Makefile.target b/Makefile.target > index ce4391f..c506d4c 100644 > --- a/Makefile.target > +++ b/Makefile.target > @@ -191,3 +191,10 @@ endif > > GENERATED_HEADERS += config-target.h > Makefile: $(GENERATED_HEADERS) > + > +.SECONDEXPANSION: > + > +.PHONY: CORRUPTBINARY > + > +$(all-obj-y): % : $$(if $$(shell size % 2>/dev/null), , CORRUPTBINARY) > + This modification adds build complexity and execution time for each build, just to fix a potential problem which is very rare. I personally prefer the current solution (remove bad object files manually). I did not test the patch, but won't cross builds be caught in an endless loop when the native size command does not know the cross object format? Regards, Stefan