From patchwork Tue Jul 30 15:58:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 170078 Delivered-To: patch@linaro.org Received: by 2002:ac9:2daa:0:0:0:0:0 with SMTP id g42csp4847317oce; Tue, 30 Jul 2019 08:59:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFsL7zPRi3HckgunFmX9NNdtYs8Rgy1siOl3VoWdz8uOMbAUnL1UfCCwRteKwfnuZp1XZk X-Received: by 2002:a17:90a:9604:: with SMTP id v4mr115420813pjo.66.1564502359817; Tue, 30 Jul 2019 08:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564502359; cv=none; d=google.com; s=arc-20160816; b=bRpo5GAVP7z18bzpda8PV1UBzDBy3lIWQqPX2QA5uRSwNDoL5gIqrnCvXWjEMCwUte KsJlh+SnwHifXoR7LW15e3nROvbnS9dp7hUViBGAtTkGvHtbyK4xR0eyTm6Li3ec28M2 +wZjF3FHIwWUzMEFEvzB5oUW+CrQpw8B+pFMe/UhAP9H3XQIdIF5VhSwcL1bTf0J1DfK ebg/gU+1VLlkeLbMvpiIQ6KEHYE9ECCnWJXP8F4E0fn+Wp0Q97H2xn0Tw70W+pSjugYL WTDDrgEE7FTVkCUPKSOqGRg08NLdKK44GB2vmBLIex8+6VeOAk2NWwrcL7KtaUNuqypG eprw== 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=tmS7rnSw2i0wnICGgr8MtsDLTrDE/y5htkc0RewVGsQ=; b=UFZy86m7n40oTt2hM/CMOqYb0uS6RAfILHafE3SKwUUgsJL8cINIwsePiUmqmgIt5G dlsjxZEAU7ETzkKr2OLgdTfFy8uwu4MoBr//sBnhXdvqBVHZhJUgNGm/0ovzsEw68kwu 4ge+qZC6lbXkggvK9n1sS544UPy8GLbpM6lcKF+2iiBGRAmC8WfAt8wesVnUbhnxKLL3 WYVahC6vqF3QHjB3Y1mq9obQYpbwrsi6quj7mt1xXG+4id3lVGbqGHAx4PI+TngRRHPd 77vw1xA4zO3J7YgZwDQu2+atXgzAq5EoSFjubBSh2wXZb/VdFW/iJbxc2j9bkrEe8SMp 49BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=SeHvLBy8; 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 k189si30355427pgd.408.2019.07.30.08.59.19; Tue, 30 Jul 2019 08:59:19 -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=SeHvLBy8; 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 S1732728AbfG3P7S (ORCPT + 29 others); Tue, 30 Jul 2019 11:59:18 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:60066 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729291AbfG3P7O (ORCPT ); Tue, 30 Jul 2019 11:59:14 -0400 Received: from grover.flets-west.jp (softbank126026094249.bbtec.net [126.26.94.249]) (authenticated) by conuserg-11.nifty.com with ESMTP id x6UFx3RY014915; Wed, 31 Jul 2019 00:59:03 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x6UFx3RY014915 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1564502344; bh=tmS7rnSw2i0wnICGgr8MtsDLTrDE/y5htkc0RewVGsQ=; h=From:To:Cc:Subject:Date:From; b=SeHvLBy8UxNSSmSxw57UopL/v+/sDXCLCt5mURKX9QxblCFwEtObGcYs6AqFyWRae CQFOKPlz2LDf2LGVNZpY1vPVq5k5/r3rbWY6hR3+iVRPBJfn9lT+MV2AxbOo9L4+a6 TEOg6HC/Qqd/bh8PhpM7UbwTclEpieW4lRQn4KlckotzuDiqNStImwH4HrQIGSLxk1 58eIF1eqpAJ7qYM39BGpzRhVfkm75fltGTDCVc2fUIoZSs6EdFqDQK0KKlCcPpzM5w Iz8KZjhg3iXh8CpNY6pED7y2ZtyyGwTgZh1o2qP9mFFMHXzP7JPDBZsnY+rpZmdBs3 CE7aY0cjYfpMA== X-Nifty-SrcIP: [126.26.94.249] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , stable@vger.kernel.org, Michal Marek Subject: [PATCH 1/4] kbuild: modpost: include .*.cmd files only when targets exist Date: Wed, 31 Jul 2019 00:58:59 +0900 Message-Id: <20190730155902.5557-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 A build rule fails, the .DELETE_ON_ERROR special target removes the target, but does nothing for the .*.cmd file, which might be corrupted. So, .*.cmd files should be included only when the corresponding targets exist. Commit 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd files") missed to fix up this file. Fixes: 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd") Cc: # v5.0+ Signed-off-by: Masahiro Yamada --- scripts/Makefile.modpost | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 6b19c1a4eae5..ad4b9829a456 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -145,10 +145,8 @@ FORCE: # optimization, we don't need to read them if the target does not # exist, we will rebuild anyway in that case. -cmd_files := $(wildcard $(foreach f,$(sort $(targets)),$(dir $(f)).$(notdir $(f)).cmd)) +existing-targets := $(wildcard $(sort $(targets))) -ifneq ($(cmd_files),) - include $(cmd_files) -endif +-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) .PHONY: $(PHONY) From patchwork Tue Jul 30 15:59:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 170076 Delivered-To: patch@linaro.org Received: by 2002:ac9:2daa:0:0:0:0:0 with SMTP id g42csp4847259oce; Tue, 30 Jul 2019 08:59:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwP8ZBwJRocpye3yZ548YkTjFZOK3ACpwCI5ygKMouKKZ2E8V5eEcWlYEvTTodptY9gWdCe X-Received: by 2002:a17:902:d715:: with SMTP id w21mr78093526ply.261.1564502355794; Tue, 30 Jul 2019 08:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564502355; cv=none; d=google.com; s=arc-20160816; b=A2qzqD5/TZll5BmYmVRlZDRRQqWiER1BTB7ZRNl05WfG1etqWPHuyVLL6pZuMAHRv6 GhA+4T0V5z8XrrNk+YF3MOYPt10Ej/6CFPbzBNwtNIJ80hFco8Uh6wdKrldhruqbjTTC NHG/dmZQYicEVIl7W0uzoxXBmipC5DV34FjwM3JRgZuSnMN7/zt3SB9ZpCZktXXnaaSF rInMyzB85P539mmfB2mhK9UiESG+pMMcdF9pNKdTs7V6vl+vbs37SqHLtfbAkol5+UZR pDXagD4zOpizFyWOfwaD+MhWQReUeJU4sy8rPAwYPNacgGJU5+Xe+oWzb0aobn/ZKgHr b1AA== 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=uiroaNh4rM6/ZQ/tf4rAH6ElNB+2ooit+Zk/cSJmCvU=; b=FGaGec8NVJcEwRdZ9M+ti8MnMDt4gVjl8mp7u+0Kz88mhdXj0Ez7xMFzwoYRU4BtLY RLMcK/3ksx/J/wIqPkhu/n91GMO4UP4/83t6EtZ4cqME0iYSLx1v40Yc/F/flzr1ZsdX Yr4tI9U+qt4ATkhiIkUJN8bmf22wtUoHqbauz2RTMruD0sNCfAuSe+8S6Z9fqvnXcixV 8HzvX7YGE87KvqnzqTDj2XOio8z0Wvo5DiqzY+ZooqY9nGPv7EAlhGFiLM8hROiFe38p BAi/zFCy0FHplGR3g2vmQciKCyPC+sXKeUYmG3X83nLVOqel8d4oPYcNQpkjQ1xGOOAY Axuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=vKOSn1C5; 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 b5si28875761pfd.273.2019.07.30.08.59.15; Tue, 30 Jul 2019 08:59:15 -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=vKOSn1C5; 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 S1730522AbfG3P7O (ORCPT + 29 others); Tue, 30 Jul 2019 11:59:14 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:60069 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728448AbfG3P7N (ORCPT ); Tue, 30 Jul 2019 11:59:13 -0400 Received: from grover.flets-west.jp (softbank126026094249.bbtec.net [126.26.94.249]) (authenticated) by conuserg-11.nifty.com with ESMTP id x6UFx3RZ014915; Wed, 31 Jul 2019 00:59:04 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x6UFx3RZ014915 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1564502344; bh=uiroaNh4rM6/ZQ/tf4rAH6ElNB+2ooit+Zk/cSJmCvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vKOSn1C5rnpJBZOh6f5NCTL6evFD9dqrFRd2typ8BPWX34gSbSp3d5Nobzs3DLHNb PiyvmsEd0iSBgezaxtqQJklpi02KoVu0LUFiMJjESfZUkDou0PG0GseUssMTc9rMx+ H2Ad8PZV/1WrNdpDoT07DQYRAzx6SsOUKU9WSOCLdM1b9OAkkzEwmY9l6168SpUHHQ MPc8k/qb8IS2zTwiG00lh4DWZjj2U2NpS+opfv3wiLuL1/FKZp3jM3/dfvec5t2P7D pE+FNuDz7ddo3Yw6xS2MFxqeJ2IE6jMhpHYhqd3Dx58DDWsUzZ63NxCeTunFg1Yhyw iF0V/i7/Ovf3Q== X-Nifty-SrcIP: [126.26.94.249] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek Subject: [PATCH 2/4] kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules Date: Wed, 31 Jul 2019 00:59:00 +0900 Message-Id: <20190730155902.5557-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190730155902.5557-1-yamada.masahiro@socionext.com> References: <20190730155902.5557-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org KBUILD_EXTRA_SYMBOLS makes sense only when building external modules. Moreover, the modpost sets 'external_module' if the -e option is given. I replaced $(patsubst %, -e %,...) with simpler $(addprefix -e,...) while I was here. Signed-off-by: Masahiro Yamada --- scripts/Makefile.modpost | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index ad4b9829a456..c856512349cd 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -78,7 +78,7 @@ modpost = scripts/mod/modpost \ $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \ $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ - $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(KBUILD_EXTRA_SYMBOLS))) \ + $(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \ $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ $(if $(KBUILD_MODPOST_WARN),-w) From patchwork Tue Jul 30 15:59:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 170077 Delivered-To: patch@linaro.org Received: by 2002:ac9:2daa:0:0:0:0:0 with SMTP id g42csp4847293oce; Tue, 30 Jul 2019 08:59:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/0s5EY1+SstzUh8RrqAKbpU/56WQhmJwXesTgJ+WxoaqVBG14fr5Tu7XLTOgMkShyhOHA X-Received: by 2002:a63:7b18:: with SMTP id w24mr109081803pgc.328.1564502357986; Tue, 30 Jul 2019 08:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564502357; cv=none; d=google.com; s=arc-20160816; b=ZbioEhQZ07jPDY/ihaKj9aFqBJNIH1mAM1DQB49WkJn16KA/F9WIRzfRJuNnf0+//J t1r88aMt016UMxPhwjnLQ/FPXoBQNCM0/Gg4VbQVDW3bUfnyd6MHs0iSp+P5Q3J+uGDr J6d127vUikLCVzUV/syXCCThZqmnDDf4Lnfgs1DOXF6flnZ9ILZkY0frYS9Zsw7YyGrW TXuaolG14j61is9oCku99MVhQTU6dNTnMLfPR7R0Rm/7yCl9wkS6vXNooCX0nmkK3b3w 9jzHQDYLk+FPTkp0wK/Q7rV/Q9NV61v7tIZo/7ST5q7Yxn7MB0RM+85mYJIwA9j4SWLF X78g== 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=+WKRGvIah6n1cheWyt6d9fXDQQMt7RydACk7ei/74P4=; b=W01P1y6cCLvhyy2DXqhthZB7njVU3IGlf/Y8c6cwEKqdNHchrNdRkFwmG9VRPHsJup 1snmIUkAXYk5mwbMr/K5Sq35H6rrILvkn/h62OuaZaMwnzyPdlmZNtadHcjnO51t7e90 3qbOLGkbJPfXUUlyvbeXbmDV2x5VCTjwI5CuREjx6/umUL+d2xO9tEW4fgZy8V/t2z50 7MQNxyfV/gsAKEEeIIv1xPAv0VfWf7Y6hQiZS+8aqHWljPgqWALNfEHICiUS9fYLBuZo xSkhHZ5OEGRGxS1jo6aGJFhPz5AV1uRX6Lj/bytt+Bl7xTZtLbXwjOW/BNNAfUah1wjm 7jUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="J/mwep+h"; 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 k189si30355427pgd.408.2019.07.30.08.59.17; Tue, 30 Jul 2019 08:59:17 -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="J/mwep+h"; 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 S1732693AbfG3P7Q (ORCPT + 29 others); Tue, 30 Jul 2019 11:59:16 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:60070 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728759AbfG3P7N (ORCPT ); Tue, 30 Jul 2019 11:59:13 -0400 Received: from grover.flets-west.jp (softbank126026094249.bbtec.net [126.26.94.249]) (authenticated) by conuserg-11.nifty.com with ESMTP id x6UFx3Ra014915; Wed, 31 Jul 2019 00:59:04 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x6UFx3Ra014915 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1564502345; bh=+WKRGvIah6n1cheWyt6d9fXDQQMt7RydACk7ei/74P4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J/mwep+hCpVwNoCzgllncZ02A7L96qj1nskRO3h4bPoVxK3gXgGyI0pQiLZLsnud9 tOmvFm7HHyJQvyUDPLMTA9TyWPJQW8cbHVTN52dNSNe5ViYVjYVgCTVWLVE9qrIFjb /iD4UX3bIolA1tlz6Ur8bZyz0pgCFcP24E9idQ7XvAuHbb8B2tcPKz260hjtRWgT1p c3/FbtF9J6MP/r12JCbUCoNBt8hSiTeq4hswqo6of3sFs23/39QTaxj9kdKxd7dlUB NqE16egg6lD1WmBf8iQecNIWbWmEMo4SG3tEnqnUX+QsNYypCTRHPnc9oYQw8ys8ar o9T5VWE3YpRgA== X-Nifty-SrcIP: [126.26.94.249] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek Subject: [PATCH 3/4] kbuild: modpost: remove unnecessary dependency for __modpost Date: Wed, 31 Jul 2019 00:59:01 +0900 Message-Id: <20190730155902.5557-3-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190730155902.5557-1-yamada.masahiro@socionext.com> References: <20190730155902.5557-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __modpost is a phony target. The dependency on FORCE is pointless. All the objects have been built in the previous stage, so the dependency on the objects are not necessary either. Count the number of modules in a more straightforward way. Signed-off-by: Masahiro Yamada --- scripts/Makefile.modpost | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index c856512349cd..fdab32d6f552 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -86,11 +86,11 @@ modpost = scripts/mod/modpost \ MODPOST_OPT=$(subst -i,-n,$(filter -i,$(MAKEFLAGS))) # We can go over command line length here, so be careful. -quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules +quiet_cmd_modpost = MODPOST $(words $(modules)) modules cmd_modpost = sed 's/ko$$/o/' $(modorder) | $(modpost) $(MODPOST_OPT) -s -T - PHONY += __modpost -__modpost: $(modules:.ko=.o) FORCE +__modpost: $(call cmd,modpost) $(wildcard vmlinux) quiet_cmd_kernel-mod = MODPOST $@ From patchwork Tue Jul 30 15:59:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 170079 Delivered-To: patch@linaro.org Received: by 2002:ac9:2daa:0:0:0:0:0 with SMTP id g42csp4847393oce; Tue, 30 Jul 2019 08:59:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEBl2miJu3Mw16WL8YwV8STYmmpkfokY0DczNuJ8aEWLU+omsfv4BQ8EbNchVwS+SfOmEz X-Received: by 2002:a62:ab18:: with SMTP id p24mr42739989pff.113.1564502365948; Tue, 30 Jul 2019 08:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564502365; cv=none; d=google.com; s=arc-20160816; b=Qmglz9ntoK/0eymeEZFsE8tPhR901ccL3Tyi87C+IeG+05fvxR64V+Dl7C2o1xpYaU LftFI50zgq1aNAoP18yYTvlC/o+FSh/KJjwv+rcfOUOijbmA3/zOryVPW9YVrOzSFQ7A 31XAoD5F/aCU1SrLL4FSRxuqNmeuK1h3KtOj9iTrFw7LT/Lp+sIKL4b2x/zYxxUKTsUL Jc1Ze1qoO9bwHxHfOQNMBFl9z5wyWRxbsr5H/T3HsdTILdRRPZUegyGqkyGmp2NZREca bJZw8SKePJ3szGguwFYD+KjoWri7hJeZDCmwSQEuhnqyH//d93EFckglYHdlwg+WttKY FT6g== 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=r9RuO6e70udYzmxw92TTE0QdUowGbnfuU8zyqiBmS+c=; b=Cn/B0W52hFbtZXAkaQ1KqlPn6p4ZGLHwiuo9asl6ZoKrGo0TlbZlw7fVT0aBTbD9n4 6U5PoVkOmTxFnSCUfA3eQTxw7LMwZSFKzM3ybDiJ0EU4XKpktLfrEtN90OrWB43DbW1a vNHboG22/iDQIEmIVvle+mnxeVfuqZpZ/1WIst6l4631wHlw4BkpXd4szxtEDrQEJZKQ TZN2xQ+qdE5gCgggvLW/ubTP0xgUdNGSJ52FQbywGk8nndDogM4EtiGv+dswPKq4USYb hH0CTs6A16y0JfLMB37HwvCKwg1ajcyjxsD1ICh6+jZ5Yo1Bx4t9cRexuMPUwDxP6gSB xPCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=mXQDXhmD; 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 k189si30355427pgd.408.2019.07.30.08.59.25; Tue, 30 Jul 2019 08:59:25 -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=mXQDXhmD; 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 S1732738AbfG3P7Y (ORCPT + 29 others); Tue, 30 Jul 2019 11:59:24 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:60067 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729621AbfG3P7O (ORCPT ); Tue, 30 Jul 2019 11:59:14 -0400 Received: from grover.flets-west.jp (softbank126026094249.bbtec.net [126.26.94.249]) (authenticated) by conuserg-11.nifty.com with ESMTP id x6UFx3Rb014915; Wed, 31 Jul 2019 00:59:05 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x6UFx3Rb014915 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1564502345; bh=r9RuO6e70udYzmxw92TTE0QdUowGbnfuU8zyqiBmS+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mXQDXhmDrwJPFT4OqN0FKclTVqd6B/6tGUjdSFHdk+HgHOKJOFxDiz0XgBJS3kHg/ AGli8U/93qn4gwNUUwe4IgW4KZACVqHZ3CiKSWEpZG55eu4anoG8aQWvfEHyGKhMfs dc3U7qMPCkcAsnJ0mWwSHVCmOBz3y3hlILRfS0srqs0cTVqXYkuo85NRx2HobOhPhF pIswhEf3XHqhOzHbhh4Jk5zqZqk8Bi+VEhiXyJkeIEO8CiG6PH4nXdD/4410DneP2q 3eh0JHKGsSq6utUWVzxqh7VjUCb4p2SDpyAiUyIGoB14KbAZJAsFFaWBAU65RZ4Sai jq4Sfpbv1467g== X-Nifty-SrcIP: [126.26.94.249] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek Subject: [PATCH 4/4] kbuild: modpost: do not parse unnecessary rules for vmlinux modpost Date: Wed, 31 Jul 2019 00:59:02 +0900 Message-Id: <20190730155902.5557-4-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190730155902.5557-1-yamada.masahiro@socionext.com> References: <20190730155902.5557-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit ff9b45c55b26 ("kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod"), 'make vmlinux' emits a warning, like this: $ make defconfig vmlinux [ snip ] LD vmlinux.o cat: modules.order: No such file or directory MODPOST vmlinux.o MODINFO modules.builtin.modinfo KSYM .tmp_kallsyms1.o KSYM .tmp_kallsyms2.o LD vmlinux SORTEX vmlinux SYSMAP System.map When building only vmlinux, KBUILD_MODULES is not set. Hence, the modules.order is not generated. For the vmlinux modpost, it is not necessary at all. Separate scripts/Makefile.modpost for the vmlinux/modules stages. This works more efficiently because the vmlinux modpost does not need to include .*.cmd files. Fixes: ff9b45c55b26 ("kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod") Signed-off-by: Masahiro Yamada --- scripts/Makefile.modpost | 76 ++++++++++++++++++++++------------------ scripts/link-vmlinux.sh | 2 +- 2 files changed, 42 insertions(+), 36 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index fdab32d6f552..92ed02d7cd5e 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -38,12 +38,39 @@ # symbols in the final module linking stage # KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules. # This is solely useful to speed up test compiles -PHONY := _modpost -_modpost: __modpost + +PHONY := __modpost +__modpost: include include/config/auto.conf include scripts/Kbuild.include +kernelsymfile := $(objtree)/Module.symvers +modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers + +MODPOST = scripts/mod/modpost \ + $(if $(CONFIG_MODVERSIONS),-m) \ + $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \ + $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ + $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ + $(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \ + $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ + $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ + $(if $(KBUILD_MODPOST_WARN),-w) + +ifdef MODPOST_VMLINUX + +__modpost: vmlinux.o + +quiet_cmd_modpost = MODPOST $@ + cmd_modpost = $(MODPOST) $@ + +PHONY += vmlinux.o +vmlinux.o: + $(call cmd,modpost) + +else + # When building external modules load the Kbuild file to retrieve EXTRA_SYMBOLS info ifneq ($(KBUILD_EXTMOD),) @@ -58,50 +85,27 @@ endif include scripts/Makefile.lib -kernelsymfile := $(objtree)/Module.symvers -modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers - modorder := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order -# Step 1), find all modules listed in modules.order -ifdef CONFIG_MODULES +# find all modules listed in modules.order modules := $(sort $(shell cat $(modorder))) -endif # Stop after building .o files if NOFINAL is set. Makes compile tests quicker -_modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules)) - -# Step 2), invoke modpost -# Includes step 3,4 -modpost = scripts/mod/modpost \ - $(if $(CONFIG_MODVERSIONS),-m) \ - $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \ - $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ - $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ - $(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \ - $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ - $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ - $(if $(KBUILD_MODPOST_WARN),-w) - -MODPOST_OPT=$(subst -i,-n,$(filter -i,$(MAKEFLAGS))) +__modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules)) + @: + +MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T - $(wildcard vmlinux) # We can go over command line length here, so be careful. quiet_cmd_modpost = MODPOST $(words $(modules)) modules - cmd_modpost = sed 's/ko$$/o/' $(modorder) | $(modpost) $(MODPOST_OPT) -s -T - + cmd_modpost = sed 's/ko$$/o/' $(modorder) | $(MODPOST) -PHONY += __modpost -__modpost: - $(call cmd,modpost) $(wildcard vmlinux) - -quiet_cmd_kernel-mod = MODPOST $@ - cmd_kernel-mod = $(modpost) $@ - -vmlinux.o: FORCE - $(call cmd,kernel-mod) +PHONY += modules-modpost +modules-modpost: + $(call cmd,modpost) # Declare generated files as targets for modpost -$(modules:.ko=.mod.c): __modpost ; - +$(modules:.ko=.mod.c): modules-modpost # Step 5), compile all *.mod.c files @@ -149,4 +153,6 @@ existing-targets := $(wildcard $(sort $(targets))) -include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) +endif + .PHONY: $(PHONY) diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index a7124f895b24..915775eb2921 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -210,7 +210,7 @@ info LD vmlinux.o modpost_link vmlinux.o # modpost vmlinux.o to check for section mismatches -${MAKE} -f "${srctree}/scripts/Makefile.modpost" vmlinux.o +${MAKE} -f "${srctree}/scripts/Makefile.modpost" MODPOST_VMLINUX=1 info MODINFO modules.builtin.modinfo ${OBJCOPY} -j .modinfo -O binary vmlinux.o modules.builtin.modinfo