From patchwork Thu Nov 29 10:59:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noam Camus X-Patchwork-Id: 1821021 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 169EEDF23A for ; Thu, 29 Nov 2012 11:00:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752687Ab2K2LAR (ORCPT ); Thu, 29 Nov 2012 06:00:17 -0500 Received: from ezexch.ezchip.com ([212.179.42.101]:32233 "EHLO ezexch.ezchip.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751553Ab2K2LAQ convert rfc822-to-8bit (ORCPT ); Thu, 29 Nov 2012 06:00:16 -0500 Received: from ezexch.ezchip.com ([10.1.1.3]) by ezexch.ezchip.com ([10.1.1.3]) with mapi; Thu, 29 Nov 2012 12:59:43 +0200 From: Noam Camus To: "mmarek@suse.cz" CC: "linux-kbuild@vger.kernel.org" , "torvalds@linux-foundation.org" , Noam Camus Date: Thu, 29 Nov 2012 12:59:42 +0200 Subject: RE: Makefile race between jobs Thread-Topic: Makefile race between jobs Thread-Index: AQHNw/w63UZIGdsFE0Cr0hh3DajuPZftciPBgBNFPzA= Message-ID: <264C179F799EF24AB26D5319053335E80CC315EC6F@ezexch.ezchip.com> References: <264C179F799EF24AB26D5319053335E80CC3049A10@ezexch.ezchip.com> <264C179F799EF24AB26D5319053335E80CC3049A11@ezexch.ezchip.com> In-Reply-To: <264C179F799EF24AB26D5319053335E80CC3049A11@ezexch.ezchip.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, he-IL x-tm-as-product-ver: SMEX-10.2.0.2087-7.000.1014-19402.006 x-tm-as-result: No--26.687800-8.000000-31 x-tm-as-user-approved-sender: No x-tm-as-user-blocked-sender: No MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Hello Michal, Below is my patch for dealing with race between 2 jobs of main Makefile. This is the third time I try to get any response from you. Will appreciate your comment. From 697f6ffa0d67b676fc2d75f65541c6e12108829d Mon Sep 17 00:00:00 2001 From: Noam Camus Date: Fri, 16 Nov 2012 15:12:48 +0200 Subject: [PATCH] Makefile: solve race between make jobs. Fix occasionally compilation failures when source tree is distcleaned. The compilation is failing over file scripts/mod/empty.c The error is because empty.o depends on some headers from: arch//include/generated/asm/ I see that there is a race between two targets in main Makefile (j=2): 1) asm-generic 2) scripts_basic asm-generic: generates all wrappers in arch//include/generated/asm/ scripts_basic: calls scripts/Makefile.build --> performs target __build --> depends on targets defined at variable $(always) --> compile scripts/mod/empty.c Occasionally compilation of empty.c starts before all its required headers created by asm-generic are available. This dependency will make sure that this situation can not happen. Signed-off-by: Noam Camus --- Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- 1.7.1 Noam Camus -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Makefile b/Makefile index 5be2ee8..00330a1 100644 --- a/Makefile +++ b/Makefile @@ -415,7 +415,7 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \ # Basic helpers built in scripts/ PHONY += scripts_basic -scripts_basic: +scripts_basic: asm-generic $(Q)$(MAKE) $(build)=scripts/basic $(Q)rm -f .tmp_quiet_recordmcount