From patchwork Sat Nov 17 04:36:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noam Camus X-Patchwork-Id: 1758461 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6ACA93FC8A for ; Sat, 17 Nov 2012 04:38:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753954Ab2KQEiH (ORCPT ); Fri, 16 Nov 2012 23:38:07 -0500 Received: from ezexch.ezchip.com ([212.179.42.101]:4155 "EHLO ezexch.ezchip.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752054Ab2KQEiG convert rfc822-to-8bit (ORCPT ); Fri, 16 Nov 2012 23:38:06 -0500 Received: from ezexch.ezchip.com ([10.1.1.3]) by ezexch.ezchip.com ([10.1.1.3]) with mapi; Sat, 17 Nov 2012 06:37:29 +0200 From: Noam Camus To: Noam Camus , "mmarek@suse.cz" CC: "linux-kbuild@vger.kernel.org" Date: Sat, 17 Nov 2012 06:36:05 +0200 Subject: RE: Makefile race between jobs Thread-Topic: Makefile race between jobs Thread-Index: AQHNw/w63UZIGdsFE0Cr0hh3DajuPZftciPB Message-ID: <264C179F799EF24AB26D5319053335E80CC3049A11@ezexch.ezchip.com> References: <264C179F799EF24AB26D5319053335E80CC3049A10@ezexch.ezchip.com> In-Reply-To: <264C179F799EF24AB26D5319053335E80CC3049A10@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-19374.000 x-tm-as-result: No--28.262200-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, Here is my patch for dealing with race between 2 jobs of main Makefile: 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 Please comment. 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