From patchwork Sat Aug 4 04:47:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 143435 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp894917ljj; Fri, 3 Aug 2018 21:49:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdlOIwZXq5YGRgAKLptNaxuJ/Y4tJv0mxkEkoY8nmsQOOPDDw3b7sv5j5BqRbYe2MMiQTan X-Received: by 2002:a62:a6db:: with SMTP id r88-v6mr7553320pfl.60.1533358153465; Fri, 03 Aug 2018 21:49:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533358153; cv=none; d=google.com; s=arc-20160816; b=yILFbCspMlM2HkukE9S5B1G/jrpVHIVYDw1zr9Xtn+3REAu/KySPHnEGTOPxs/NO7t n+dPFtII3YhisVcMo9OJLk4n0GP730oHHFUC5Ug+zrrEdzcv2WqXJEZWvaQ2hggQ/bvz do2iasQC2q2ljlKPAbhIcQiMdqewO+8cT2++q1f6ezkWsUtL1HYiYsvUAuHH3ttX+3gt 7lDTbcQXDYSeNZymkD6pArpdAQRvE/T61Geo6bqI5kSEEYGvibElkKxhCdy1OtxGVy7T IDc7xZn3q5VOd0AtA48ojKgYDrwvafS5zWp5+qaq3PsUlinZHvy4qrkYTImyu+NIm/Uw ZUPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=ulZoy0aw7RRCqQOsqMWNRLnJF7c1Iv70/QIKaR5unz4=; b=G6LnKLvQLpPUCnlMNqRENQSd7xUwG49Al0bfZLxHaNy+2yKrz00bvbvoFKPLrI8ZHU JiMCB3exCbkD+kchY8+8CwYJBw04m2Oi6QaEz0IphDOCqnvgkMBR51mPRBZjLaed0Fea B6BwlFjpnbSJnlV3x8q+CZJ6H2bn4E6yOVMNVPgaCECE/0ZfhwhEAKA/VaUnbp1RzuvC /7FqwNtSrjLdcduh7npPvjz2wWxmGJSVaeeP/U1QqHnAcG8DHAc8UHrkXz0B0+caWngX mVaQz6RlgVffDh9mGzbOelptx5Y7uUWpP1WYLUFpogx6w8C3Vir/FDiCbkzmfdXV9Z6t Coog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=kOfjxaRa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1-v6si4901624plb.279.2018.08.03.21.49.13; Fri, 03 Aug 2018 21:49:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=kOfjxaRa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728024AbeHDGsX (ORCPT + 31 others); Sat, 4 Aug 2018 02:48:23 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:64028 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbeHDGsW (ORCPT ); Sat, 4 Aug 2018 02:48:22 -0400 Received: from grover.tkatk1.zaq.ne.jp (zaqdadce369.zaq.ne.jp [218.220.227.105]) (authenticated) by conuserg-11.nifty.com with ESMTP id w744lBUe027764; Sat, 4 Aug 2018 13:47:12 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w744lBUe027764 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1533358033; bh=ulZoy0aw7RRCqQOsqMWNRLnJF7c1Iv70/QIKaR5unz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kOfjxaRajVFuIBjRzC9WPMBXFaRNIX7okCWnL23bBpWSUgfRi4vmWLRdS6hy+0Cyl jD9r5lobuOP3BiF68nTVPWy0n5k6877jQ4CM9cFCpLvvLtpCZ2EFyI648+X0Q/K0mv nClWpM7+LU8UF7t43egQ8g4xQVTMyicPz0aVbCeiuqBffIhZD/yVcIqZRv+mNcKKCU hwQBBbpFIqhZlIPYGAnjBPxk6htSvzE8HNFZDIi4j4xhqYW8YzB3N/EYiE83Y+QuLK l9rt+g40aBEltIS5S90N5PLm8jFZF4puCWwbGaZETKiH9Ws+zr1jgbqk4DqR1w4WG2 Hx0qmXPDWVx/g== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Jeff Dike , Richard Weinberger , linux-um@lists.infradead.org, Randy Dunlap , Geert Uytterhoeven , Michal Marek , Sam Ravnborg , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] um: fix parallel building with O= option Date: Sat, 4 Aug 2018 13:47:01 +0900 Message-Id: <1533358023-5801-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533358023-5801-1-git-send-email-yamada.masahiro@socionext.com> References: <1533358023-5801-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Randy Dunlap reports UML occasionally fails to build with -j and O= options. make[1]: Entering directory '/home/rdunlap/mmotm-2018-0802-1529/UM64' UPD include/generated/uapi/linux/version.h WRAP arch/x86/include/generated/asm/dma-contiguous.h WRAP arch/x86/include/generated/asm/export.h WRAP arch/x86/include/generated/asm/early_ioremap.h WRAP arch/x86/include/generated/asm/mcs_spinlock.h WRAP arch/x86/include/generated/asm/mm-arch-hooks.h WRAP arch/x86/include/generated/uapi/asm/bpf_perf_event.h WRAP arch/x86/include/generated/uapi/asm/poll.h GEN ./Makefile make[2]: *** No rule to make target 'archheaders'. Stop. arch/um/Makefile:119: recipe for target 'archheaders' failed make[1]: *** [archheaders] Error 2 make[1]: *** Waiting for unfinished jobs.... UPD include/config/kernel.release make[1]: *** wait: No child processes. Stop. Makefile:146: recipe for target 'sub-make' failed make: *** [sub-make] Error 2 The cause of the problem is the use of '$(MAKE) KBUILD_SRC=', which recurses to the top Makefile via the $(objtree)/Makefile generated by scripts/mkmakefile. When you run "make -j O= ARCH=um", Make can execute 'archheaders' and 'outputmakefile' targets simultaneously because there is no dependency between them. If it happens, $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders ... tries to run $(objtree)/Makefile that is being updated. The correct way for the recursion is $(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) archheaders ..., which does not rely on the generated Makefile. Signed-off-by: Masahiro Yamada --- arch/um/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.7.4 Reported-by: Randy Dunlap diff --git a/arch/um/Makefile b/arch/um/Makefile index e54dda8..de340e4 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -122,8 +122,7 @@ archheaders: $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \ kbuild-file=$(HOST_DIR)/include/uapi/asm/Kbuild \ obj=$(HOST_DIR)/include/generated/uapi/asm - $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders - + $(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) archheaders archprepare: include/generated/user_constants.h