From patchwork Thu Sep 12 07:33:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 173676 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp1772929ilq; Thu, 12 Sep 2019 00:33:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0O2245cFY1WFkIH24AhxrugE2x5nG1lYAUYse+zSL2+TmEmSbEqSXeqnnjucHahF19QfZ X-Received: by 2002:a50:cfc7:: with SMTP id i7mr31561266edk.89.1568273634544; Thu, 12 Sep 2019 00:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568273634; cv=none; d=google.com; s=arc-20160816; b=ZrVcWxIhtxlSEsU62cJclUqclRzBbE6NEout+iVf9zTzPd2feKs99zAAgKbtTbCXCb wAI555pOjbdkRLk/QPkfchi/g3XYzTwe8U3Tu/uUL9OBIjbVzHF7ENWgxftIrEZNZkdR thitW73lSwgG+2r82yaD2Vifxx1U8D37Kk5n/mJr5suBiJXXbJvfBT8SL8nvfd3Id341 jU95ZlakoJB9gY+Ocmvnt+qKnBCC23oMwdbEGuSsC8E14GIbjLXPd7lwSWpNAA7aV6+Q 2mEw2O+fpuveVXnoUm8hHm7KhpHkS7qCgsRkJbg7nyBRZEhk2m2z1xrZiVjDOwmGNCm3 UuhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=LqEDIT/B2atU2BjPW+NBM34K9nUbTM8vvHn1AoCzsCs=; b=Kgf0y2cjcPqBOfgD8ouB2Ncnl5ulq3fhjL60KF9VG8QgAQh/A3rq4DLupmzrDDxenr yVPIVySREuEmZaBSekMHf83kTs4/RcFoukq1ead/LyrFgOouktkKgd/0cEyqU9+9vfZG kMKkMAVQ8ZAGwcnY2e1YAG7JsN0Vozs1vS/AkrmNnTO6hqoFPc/YBhIUTxaE7wEwB5Wc ffrpFfO858Ls3sJW52pZd8vy62wN/Wl1XzOcLyyqzCCGnHUVg23bL7p97I5+jRfe3DtT fcilBCNH3OEh3glxg9G8uNSg+KvsvXYYfOAfI+PCz8NrZ6J+zmdXOzjcyVHPEjrauLjJ 4j1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=M3Ei2vzu; 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 j12si12951984edn.348.2019.09.12.00.33.54; Thu, 12 Sep 2019 00:33:54 -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=M3Ei2vzu; 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 S1729685AbfILHds (ORCPT + 27 others); Thu, 12 Sep 2019 03:33:48 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:43159 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbfILHdr (ORCPT ); Thu, 12 Sep 2019 03:33:47 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x8C7Xbg8018895; Thu, 12 Sep 2019 16:33:38 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x8C7Xbg8018895 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1568273618; bh=LqEDIT/B2atU2BjPW+NBM34K9nUbTM8vvHn1AoCzsCs=; h=From:To:Cc:Subject:Date:From; b=M3Ei2vzubTb8BRzMbZ3SsNAr7MzewSzAZZg0zDVPpLcsU8giwNoH2pPXhZb3KqHue odD+Ces3Hh+ja/8ryuQfAxx1dm9VKVYFKm2SByyrtwz0WJUu1IUGHfSDkyst4JMQyx zzGci76Sxf8fB9rO6hk+bnSzZy9c3JEq489y20fYE4i+pn7LPLgZx+ZphHznPEdT4X TaLjDemlz8XN5cKSX8rMLnt82dQtUMzg+Yjd279m+1nU276+HRem16ZglaC4LNhgVI wfiOlQVAlIKDrGDQw75+lpNPws1lFswTughJxWK85A1iovkzB1P2+R+OxCZ7Hmax3R H3FC736G/j2HQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] kbuild: do not create built-in.a that is never linked to vmlinux Date: Thu, 12 Sep 2019 16:33:33 +0900 Message-Id: <20190912073336.7036-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Both 'obj-y += foo/' and 'obj-m += foo/' requrest Kbuild to visit the sub-directory foo/, but the difference is that only the former combines foo/built-in.a into the built-in.a of the current directory because everything in sub-directories visited by obj-m is supposed to be modular. So, it makes sense to create built-in.a only if that sub-directory is reachable by the chain of obj-y. Otherwise, built-in.a will not be linked into vmlinux anyway. If an orphan built-in.a is created, it is very likely a Makefile bug. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 2 +- scripts/Makefile.lib | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 9fa09361aa5d..54fc68168686 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -66,7 +66,7 @@ lib-target := $(obj)/lib.a real-obj-y += $(obj)/lib-ksyms.o endif -ifneq ($(strip $(real-obj-y) $(need-builtin)),) +ifdef need-builtin builtin-target := $(obj)/built-in.a endif diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 264611972c4a..07095d3789a1 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -35,7 +35,11 @@ __subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) subdir-y += $(__subdir-y) __subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m))) subdir-m += $(__subdir-m) +ifdef need-builtin obj-y := $(patsubst %/, %/built-in.a, $(obj-y)) +else +obj-y := $(filter-out %/, $(obj-y)) +endif obj-m := $(filter-out %/, $(obj-m)) # Subdirectories we need to descend into From patchwork Thu Sep 12 07:33:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 173674 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp1772899ilq; Thu, 12 Sep 2019 00:33:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwA4aLI+l3AoI9NSK6gt7jTGYUE8cyYCLZtx7QMr9cCm4ZHzIhpI3TWs/8Jp/5HW+wi57zJ X-Received: by 2002:a17:906:c799:: with SMTP id cw25mr16792077ejb.107.1568273632327; Thu, 12 Sep 2019 00:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568273632; cv=none; d=google.com; s=arc-20160816; b=cM8KVoZ3RwdZvAfJuvcSbQxHORDnoHMRkbzkO0XybFDfb75iygGYUHSuEbz9S2LcJr 2SMe4yrVTUAnmwEyQVerpv+5N+S69KYFqkh7MpNHgRPZtupohHaDmSZvWutbopaEkfBS boMWUiJN4IGQ4DzbU5QW/ScyWwjr4u1ts7w/s7iLwWi0t+6q7j8YlDbb2tAjw0qNmf2H OzQ7eBflkUlfe7YxshlfgT0FTxXmnJgKi69MLn28GSUZdf8eP3QhaMcLevo17ytJJbfZ QoCaMiPM2mleWJSqEUzaw01WSWmUlkcyXedhhuzBX7bxJaEeOHUEytR4HaaTjh37bIK0 YwuA== 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; bh=G45NEfuMGe0ysBOraG5cU6KIy3gv/xwEFarEE/1Azn4=; b=uvgEJl2knjPCXgzKaaX1uHLaQkDOt5d1m6WeTJtv/VVeUtpPY1AFYbLG05U9tbu9dD GznyBxTkNID/YHx/xCZHi/SB1CHHw5UNRXAOARThkF7+T3L+utyvS97B1FUYj8IZLsVm nP2BnnqQzw5UFV7DbYmX0w1pGiEpnm8RCM33TqSB5QEHvfi7sFX7Nd0j14FTGGunPGEB LRJ99ny32dVlAeW3/z3QYP9vkum+g+RfWsObtuFDujJKu49qfrz68MzU85MGLmyTSN0Q cRtNQlTIvrQ/YmhqfXZtMTF2ApAbr0cEGEOxbRkYw9ZzM6NhJ9Pd+6lg0HVJegk6G2Bc ksPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=nYZi0y5Z; 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 j12si12951984edn.348.2019.09.12.00.33.52; Thu, 12 Sep 2019 00:33:52 -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=nYZi0y5Z; 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 S1729883AbfILHds (ORCPT + 27 others); Thu, 12 Sep 2019 03:33:48 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:43160 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbfILHdr (ORCPT ); Thu, 12 Sep 2019 03:33:47 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x8C7Xbg9018895; Thu, 12 Sep 2019 16:33:39 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x8C7Xbg9018895 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1568273619; bh=G45NEfuMGe0ysBOraG5cU6KIy3gv/xwEFarEE/1Azn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nYZi0y5Z0dJ+Wz9a0/lEP2LGcyWK4k8zCXSa3YBUTLoEOIcpXhE6OZnb1TEYGDMls I6797JLQDUDiBeaI/5C/SN+hxqQsPSjEtecK2LMwxz/ihNk0JVapSBsaCPxFlFXKuB AR+Eejw+0aUwu+hLPhEWQID67d1+E/d9wyQNCOigNR9unRDU22oniGucgR2+/g7mCF 8qcyPKhdTFI40W+9c6aCAZUAv5aW33fgmDGxxRhaKD61BKtnoigWiEg94mISV4ivlY jS5fo5IvmFXvjBxx+pgJ/cz3msXVmjWnsAumeZRkgrVhYIwC6oPE+XnhYUEotAjYD1 QH1pnP3A7kj+w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] kbuild: warn orphan obj-y objects Date: Thu, 12 Sep 2019 16:33:34 +0900 Message-Id: <20190912073336.7036-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190912073336.7036-1-yamada.masahiro@socionext.com> References: <20190912073336.7036-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org obj-y specifies objects linked into vmlinux, but they are actually linked if and only if that sub-directory is visited by the chain of obj-y. If you have an orphan obj-y object, it is a bug, but may not easy to notice. This commit provides build-time warning. I tested allmodconfig based on v5.3-rc4, and I saw one warning: scripts/Makefile.build:57: 'sound/soc/sprd/sprd-mcdt.o' will not be linked to vmlinux even though obj-y is specified. This is a proper warning. sound/soc/sprd/sprd-mcdt.o is compiled as built-in since CONFIG_SND_SOC_SPRD_MCDT is boolean. However, CONFIG_SND and CONFIG_SND_SOC are tristate, and set to m by allmodconfig. So, Kbuild descends into sound/soc/, then sound/soc/sprd/ by obj-m. sound/soc/sprd/sprd-mcdt.o is not linked to vmlinux. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 6 ++++++ scripts/link-vmlinux.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 54fc68168686..d30b04707fec 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -52,6 +52,12 @@ ifndef obj $(warning kbuild: Makefile.build is included improperly) endif +ifeq ($(need-builtin),) +ifneq ($(real-obj-y),) +$(warning '$(real-obj-y)' will not be linked to vmlinux even though obj-y is specified.) +endif +endif + ifeq ($(need-modorder),) ifneq ($(obj-m),) $(warning $(patsubst %.o,'%.ko',$(obj-m)) will not be built even though obj-m is specified.) diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 2438a9faf3f1..8961d999b86b 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -216,7 +216,7 @@ else fi; # final build of init/ -${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init +${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init need-builtin=1 #link vmlinux.o info LD vmlinux.o From patchwork Thu Sep 12 07:33:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 173675 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp1772903ilq; Thu, 12 Sep 2019 00:33:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsF7i+eZDnwEUhv2Ur0ESl4o8EmV27Mg3ujW1zxfYgicLxXIilTmV6PqACxsnAy97pAxDs X-Received: by 2002:aa7:d899:: with SMTP id u25mr39309934edq.289.1568273632774; Thu, 12 Sep 2019 00:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568273632; cv=none; d=google.com; s=arc-20160816; b=Vb0bZyq9U+DJ15JPZ8jfj8DcxtdkvP7RShufNzZJcGAHe1IJVclkFW11bnTzWq2um3 iCPn2s6Apu6lIbh81J4U5Uyy3qa9qchlT8vReoGBX63aZq80wMry0LQszEg06cLleavw sfg6smcwbLVD4hYVZtz5LJFTlPO48o5o7Ln4avpacLUeML6JfQSGy1/vAVvXmK0PAZhU gcWVMPENEiE4vIrP7dwE/EInhXxbBTT/sl5wTErjf7GqbHVqpA8dWcvSMJCfuEtPqrWJ hFr04zPD4PW8jccOeFVC85MWHzthTYBuefqyQeQ8EUkH+JjEYz1eXHcSWJPaOe26KJoE knog== 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; bh=pv44XTP6ZfWgIUysfDsiZqGnj8xj7NDBDRlFeIGA84g=; b=qgSPE5rrRM8pKye9erJzHKeuUg8wCiSLX4G2+xmyEDLYUSCm3HMx4h6YNytGP8DC3N YvwTFZH0n0/Ii6NvVMTmkdMa6gFve3+8FfK5yrNUX0GYvP+AKSFDlcfwD+XuQBuG5ffb tP3jSEEk9eLLnrxU1Ynta/LueAkw6gv3esBQ0Yid6lwyAgvc4BXQW8O2A5S7T2Dj5vbd A5sHwhOnPngpaVjsjQNsTWd31Y0BrMnN0otMllBVJHSmINzeeN/twPU+Gai4k3M5PSx6 KcuyA8P07lyg0eAABfNeFcHzsKf0A1iR0co0+bFUNqBXnQrKRAq2Q5h/eVOJBJXeOfBN 3HBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=I+g5chcL; 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 j12si12951984edn.348.2019.09.12.00.33.52; Thu, 12 Sep 2019 00:33:52 -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=I+g5chcL; 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 S1729784AbfILHds (ORCPT + 27 others); Thu, 12 Sep 2019 03:33:48 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:43163 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbfILHdr (ORCPT ); Thu, 12 Sep 2019 03:33:47 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x8C7XbgA018895; Thu, 12 Sep 2019 16:33:39 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x8C7XbgA018895 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1568273620; bh=pv44XTP6ZfWgIUysfDsiZqGnj8xj7NDBDRlFeIGA84g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I+g5chcLlIDpARKarWd1h8kPMPDRdX2ak4F2bhQSgK5RIhxJYxvrrNcqOwtELDXQ+ r7dx6z4/ump7yNMjRmBHVR8uucYqp/65wbDtjAslwvDglc4ErPRFF0VrlQg4PHBZg5 yzQjalhq6rNYKH6Dqzxx32lHsdWVoAMNGc3Cr7bovxP94tnj8qsfzMV6o2HWQVD5kd eFnUcKgs5jqcLg0voqGtoKtX26PTl5eYWMrdNIKXzvlMxViUqRzqZ/qzJyENEKOEM/ 4DgeqAbsf7iew2We9AULrjjgdxWuZEbBi4oNo2QuMz2XifMbDHX9UWNw2RGOHuVUKG 5/+TDvqKvXTUw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] kbuild: change need-modorder implementation slightly Date: Thu, 12 Sep 2019 16:33:35 +0900 Message-Id: <20190912073336.7036-3-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190912073336.7036-1-yamada.masahiro@socionext.com> References: <20190912073336.7036-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Align with the need-builtin implementation. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 2 +- scripts/Makefile.lib | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/scripts/Makefile.build b/scripts/Makefile.build index d30b04707fec..91617b9d7a34 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -528,7 +528,7 @@ $(subdir-ym): $(Q)$(MAKE) $(build)=$@ \ $(if $(filter $@/, $(KBUILD_SINGLE_TARGETS)),single-build=) \ need-builtin=$(if $(filter $@/built-in.a, $(subdir-obj-y)),1) \ - need-modorder=$(if $(need-modorder),$(if $(filter $@/modules.order, $(modorder)),1)) + need-modorder=$(if $(filter $@/modules.order, $(modorder)),1) # Add FORCE to the prequisites of a target to force it to be always rebuilt. # --------------------------------------------------------------------------- diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 07095d3789a1..034e92ea72c6 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -23,7 +23,9 @@ lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m))) # Determine modorder. # Unfortunately, we don't have information about ordering between -y # and -m subdirs. Just put -y's first. +ifdef need-modorder modorder := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m:.o=.ko)) +endif # Handle objects in subdirs # ---------------------------------------------------------------------------