Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7504217ybh; Thu, 8 Aug 2019 17:28:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPMkCElCQZ9Wkd5K2SQ10Pb3js6jQKVfMvp3JBZy0+Mu2Ly6vRDveFDDNCZNFPHPEz5GTo X-Received: by 2002:a17:90a:c70e:: with SMTP id o14mr2187011pjt.56.1565310519807; Thu, 08 Aug 2019 17:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565310519; cv=none; d=google.com; s=arc-20160816; b=OgBh+HdXuMbS7P+B3ltVjoL3NVP1X1HbOmRZLZl9m2USIIw+BWj3wRMikQnSgZ+PCM UO32pj48g5TnhTQ0/R7m6ynsncdCyYw9tVIb83tKmFckwXR8w8KFhqH1TmIPz4ZAWNyp 6XKDIW0b+fCWgz6ISpKYFLQqxkTFD4hiO98/Glr5mEwWULpdYkYqUhLGWeKRFWDEwwkE gRdlK22HOmK39SHmPhuLuStyLkSfkhZXyLVoyqSwdkR3ZeIGhhjGM+8WMvJ+8yJmp/3Z ayUKxKvvGSxDeiQGd96jHluJkEKvIge079FFCrpAwPtiRyeSBGe4Suu7hktEr/3M8yiO xXKg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IGL5DKWdJn7PBi3pvoDO2whZUNIAfJTBQdVIbDm2ils=; b=ENnPfTwHN2lOj9F3NV16PUilkp2lN8h5l1VXLZSvH36IXJNUG29hIG56DQY1ZvMdp3 g6PONHH2t7tohlQKY4bqaiO1uJeLIJ5vhzJfORqSmbtQHt6MzPBHlvX1s0GLUJ2Jd2Eo 4mZZN2x0HOJlYzcWKVoFyG4KI79kNKQfW8G2qOD4DxPU8F2p+I+Jis1h5uyHTFvDv9g6 WdcTD9PNf2ZepU7Y+EFXiZymyjOzCAzUoqZVs8mtDYmXOTK7JMEn925DCfijAAKLnI6t OUOD20LFrxvm8iKnr1BOgYQkhJ1wiCkvHQlPsKn6EvkLK93Ym/Heqh+bEw8L1A1XJrnx ncTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ZScCbWpe; 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 s3si53102620pgq.392.2019.08.08.17.28.23; Thu, 08 Aug 2019 17:28:39 -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=fail header.i=@gmail.com header.s=20161025 header.b=ZScCbWpe; 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 S2405120AbfHIAV5 (ORCPT + 99 others); Thu, 8 Aug 2019 20:21:57 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:34209 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732796AbfHIAV4 (ORCPT ); Thu, 8 Aug 2019 20:21:56 -0400 Received: by mail-ot1-f67.google.com with SMTP id n5so126128552otk.1; Thu, 08 Aug 2019 17:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IGL5DKWdJn7PBi3pvoDO2whZUNIAfJTBQdVIbDm2ils=; b=ZScCbWpeAMjzl0XmTuKKF8pd17I8kPcB3a/WlU1fcXRTtSba0jThQX6frIL/CsC4gf U4bT2fG4mp48haUjk2hNJ+P92k8Lf4Wx1uylZPiKQbzeWFOYACCtHK9aQ5QOjH/yZ2KY UpcQRUil/+FjYtDO9ioS3yzu5F+yXWYO57Lc6xrYCfMX9Ay5LdOw3a+mfz7j2Wr9s8XV fWX3U7uXdRMXlqmKPvGrMSK/EWBRMAoQhI9grQG8IkCR0po3fZaqZglhzZoVS0MseANc 0ILdgV95rz0c6WlAGjIsZ1iTgxB7SWn4ctSS0M73QUL7ja0GrTv2o7TcE6gVcYEbmFoV ykXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IGL5DKWdJn7PBi3pvoDO2whZUNIAfJTBQdVIbDm2ils=; b=R3tbPb1QtchVxUlBNjiRRzTSHHwp5Z1s4QC3Hcip2qh/O07Iyyf20p5WUW3bdx19cg tr4hS4qsQts95n/nO2UM0cLeZFOs1BzUmSlYPf7pg7/N0OY7EnFhYa9DHWlDUzzmxkjo E5DFj8/8D/SBbzeS13NRswGoF8Ql/rmkd3ssPnE3kQA3mZ6beFw7LhD6VpgrXKpgR0+9 Kj5qw9BzEnjIEWn9bHRk28RXr1Tn87Uw1n/uW5pipoRG27A7u+rWb0qNdvr2Z01lfiwn CXd2RqN6ci6dSKDevuMiTH6xYyNpyZbX2AS0d/x/syL9qdy+/7Ows69C54bNt2F21dao iOyg== X-Gm-Message-State: APjAAAU1ky3WkZSOsmPOemdB7kKOkxlLAryFwVm1/70WMqauyULEC008 9Gb/q8h9/Dwgy9Re26KO9VU= X-Received: by 2002:a6b:b804:: with SMTP id i4mr17180702iof.119.1565310115747; Thu, 08 Aug 2019 17:21:55 -0700 (PDT) Received: from wandering.us.cray.com (msp-nat.cray.com. [136.162.2.1]) by smtp.gmail.com with ESMTPSA id l7sm8426377iof.81.2019.08.08.17.21.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 08 Aug 2019 17:21:55 -0700 (PDT) From: Shaun Tancheff X-Google-Original-From: Shaun Tancheff To: Masahiro Yamada Cc: Shaun Tancheff , linux-kbuild@vger.kernel.org, Joe Lawrence , "'James E . J . Bottomley'" , Jonathan Corbet , "'Martin K . Petersen'" , Michal Marek , Shuah Khan , Thomas Renninger , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH 1/1] kbuild: recursive build of external kernel modules Date: Thu, 8 Aug 2019 19:21:04 -0500 Message-Id: <20190809002104.18599-2-stancheff@cray.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190809002104.18599-1-stancheff@cray.com> References: <20190809002104.18599-1-stancheff@cray.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building a tree of external modules stage 2 fails silently as the root modules.order is empty. Modify the modules.order location to be fixed to the root when KBUILD_EXTMOD is specified and write all module paths to the single modules.order file. Signed-off-by: Shaun Tancheff --- Makefile | 1 + scripts/Makefile.build | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 23cdf1f41364..a9964492f47e 100644 --- a/Makefile +++ b/Makefile @@ -1622,6 +1622,7 @@ $(module-dirs): prepare $(objtree)/Module.symvers modules: $(module-dirs) @$(kecho) ' Building modules, stage 2.'; + $(Q)$rm -f $(KBUILD_EXTMOD)/modules.order $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost PHONY += modules_install diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 0d434d0afc0b..f9908b3d59e0 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -64,7 +64,13 @@ builtin-target := $(obj)/built-in.a endif ifeq ($(CONFIG_MODULES)$(need-modorder),y1) +ifneq ($(KBUILD_EXTMOD),) +modorder-target := $(KBUILD_EXTMOD)/modules.order +modorder-add := >> +else modorder-target := $(obj)/modules.order +modorder-add := > +endif endif mod-targets := $(patsubst %.o, %.mod, $(obj-m)) @@ -423,7 +429,7 @@ endif # builtin-target $(modorder-target): $(subdir-ym) FORCE $(Q){ $(foreach m, $(modorder), \ $(if $(filter %/modules.order, $m), cat $m, echo $m);) :; } \ - | $(AWK) '!x[$$0]++' - > $@ + | $(AWK) '!x[$$0]++' - $(modorder-add) $@ # # Rule to compile a set of .o files into one .a file (with symbol table) -- 2.20.1