From patchwork Mon Dec 16 17:47:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181754 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp4617918och; Mon, 16 Dec 2019 09:54:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwEcJWbbDo+l7PzSm8HgM6lXd5opQTiZ507BtTK8cjh91b8m6IVlQHn+BHQJE30W/gZAxk/ X-Received: by 2002:a9d:588c:: with SMTP id x12mr32031691otg.2.1576518867972; Mon, 16 Dec 2019 09:54:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576518867; cv=none; d=google.com; s=arc-20160816; b=pEmqqYbGNziEaQVQ+5x8AgNpSIgnDA4/8IH/G0XTRq2fAZxcEyW5N4vF6CaQ+UAkNi 7z846UUiqk2GKBI1/Z8rhNJrPOjqX4pHTPOblLr+9opZHPCF5I8OVXMaaAP4ns64Ozr6 7RDd45Pcjns2mgdhh19oJbrmuvcLS/NJFaSE8sghaunrXz2+4RvdMhscf9s8Mq0nsYKf OLSDFszQHDnAAz11djr5IT3GuvcxfUF3AYbtpXCDdyDChh0O5af/SBiSt2iLOT9+XuQv lERvgDkuc+P5fcBMmHaAiSv7eSuANSelWLeGT1+0B+8lxIKymAZFQZL2npNW3EAI/fw6 6xjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Eme6cqaRXdxigDjFuSQK6i+ARTk8WaCqnlFNDjEcZxk=; b=IEQy0zexphvFMK/jadb2MUdc93e/2g2BvtSKMEq+vUrB8CBxACrI57gmcH0pkyYY5A aqojJMTU0/VF2ovXqgY2dLe/Nuo5saA49wZhBBlGGKiStLqQcxorJF6mGN9s0px5A3tq Pu9JZgKbCiQXAIvDif2wZ0y/bAD1oUDRJZr0tQz9Ittubd+TsyXDXkfk/K9o21SAbHKb k6OxdB6rmjZB3vGp1CXrSl/caunRQ4QBIz0/x/SnfMGtDRs7w/uvMU6sRRW1Wbd0F46x D5N6jp2DMDZNMFpJ1EjpTYmIKL4ONVmhPu+pUjHR+1LU7Ba54NN05vqEOMhwI1C1DYPU UtSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oHbGoTNj; 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 g5si10141716otn.232.2019.12.16.09.54.27; Mon, 16 Dec 2019 09:54:27 -0800 (PST) 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=@kernel.org header.s=default header.b=oHbGoTNj; 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 S1727106AbfLPRy0 (ORCPT + 27 others); Mon, 16 Dec 2019 12:54:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:50156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbfLPRyW (ORCPT ); Mon, 16 Dec 2019 12:54:22 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9168021582; Mon, 16 Dec 2019 17:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576518862; bh=RfmMguvOsEmVTvPQcmmNoPaMeAWc9qTU28XzeE79xCs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oHbGoTNjQmeP4GqpkQ8xRuW4LHeMqLhJ/LRi7M+plG0ASYWQjZhMM4truSQuqrihV IHBBVV3Y1zCl3AJ5SnlHgfWpAkgEcUAmiTd39xaX7WbUa4wautxZGZbS6YYU3NlkY2 W+ZN+EkDC5xT2fBue+aylul/EQCQCQpRRicRZ42A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Sasha Levin Subject: [PATCH 4.14 096/267] kbuild: fix single target build for external module Date: Mon, 16 Dec 2019 18:47:02 +0100 Message-Id: <20191216174901.982408463@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174848.701533383@linuxfoundation.org> References: <20191216174848.701533383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit e07db28eea38ed4e332b3a89f3995c86b713cb5b ] Building a single target in an external module fails due to missing .tmp_versions directory. For example, $ make -C /lib/modules/$(uname -r)/build M=$PWD foo.o will fail in the following way: CC [M] /home/masahiro/foo/foo.o /bin/sh: 1: cannot create /home/masahiro/foo/.tmp_versions/foo.mod: Directory nonexistent This is because $(cmd_crmodverdir) is executed only before building /, %/, %.ko single targets of external modules. Create .tmp_versions in the 'prepare' target. Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- Makefile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) -- 2.20.1 diff --git a/Makefile b/Makefile index d97288c0754fe..4de172b2e1fba 100644 --- a/Makefile +++ b/Makefile @@ -1529,9 +1529,6 @@ else # KBUILD_EXTMOD # We are always building modules KBUILD_MODULES := 1 -PHONY += crmodverdir -crmodverdir: - $(cmd_crmodverdir) PHONY += $(objtree)/Module.symvers $(objtree)/Module.symvers: @@ -1543,7 +1540,7 @@ $(objtree)/Module.symvers: module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) PHONY += $(module-dirs) modules -$(module-dirs): crmodverdir $(objtree)/Module.symvers +$(module-dirs): prepare $(objtree)/Module.symvers $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) modules: $(module-dirs) @@ -1584,7 +1581,8 @@ help: # Dummies... PHONY += prepare scripts -prepare: ; +prepare: + $(cmd_crmodverdir) scripts: ; endif # KBUILD_EXTMOD @@ -1709,17 +1707,14 @@ endif # Modules /: prepare scripts FORCE - $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) # Make sure the latest headers are built for Documentation Documentation/ samples/: headers_install %/: prepare scripts FORCE - $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) %.ko: prepare scripts FORCE - $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) $(@:.ko=.o) $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost