From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeuOF-0004GP-IS for qemu-devel@nongnu.org; Tue, 21 May 2013 17:46:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UeuO9-0004dh-Hn for qemu-devel@nongnu.org; Tue, 21 May 2013 17:46:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeuO9-0004dU-AS for qemu-devel@nongnu.org; Tue, 21 May 2013 17:46:33 -0400 Date: Wed, 22 May 2013 00:46:45 +0300 From: "Michael S. Tsirkin" Message-ID: <20130521214645.GA8863@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] makefile: detect corrupted elf files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Paolo Bonzini , Anthony Liguori , Luiz Capitulino 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? Makefile.target | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile.target b/Makefile.target index ce4391f..4dddee5 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 %), , CORRUPTBINARY) + -- MST