From patchwork Tue May 21 21:46:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 245413 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CAA6A2C00AA for ; Wed, 22 May 2013 07:47:02 +1000 (EST) Received: from localhost ([::1]:54438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeuOa-0004Hl-Ty for incoming@patchwork.ozlabs.org; Tue, 21 May 2013 17:47:00 -0400 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 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4LLkNeO005148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 21 May 2013 17:46:23 -0400 Received: from redhat.com (vpn-202-144.tlv.redhat.com [10.35.202.144]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id r4LLkKej004127; Tue, 21 May 2013 17:46:21 -0400 Date: Wed, 22 May 2013 00:46:45 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <20130521214645.GA8863@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Blue Swirl , Paolo Bonzini , Anthony Liguori , Luiz Capitulino Subject: [Qemu-devel] [PATCH] makefile: detect corrupted elf files X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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) +