From patchwork Wed Jul 17 06:17:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169101 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp530443ilk; Tue, 16 Jul 2019 23:19:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQcga4VpuMdPqzmB96+CeS3C3D10l1aORMJaNEfwTM/wDmDDj5AIw4/FaHJr4XMdjhhk44 X-Received: by 2002:a63:10a:: with SMTP id 10mr39608892pgb.281.1563344353351; Tue, 16 Jul 2019 23:19:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344353; cv=none; d=google.com; s=arc-20160816; b=V49NoWQF3KTIAYOxOjopjKIV78nS+9Y5X8ExztzJ9UvLJQCReTUroS43uYUT+Nvpg8 0y4MnYjVn4wmqbH6NZSVSzNm3rOf3VD1qV07AHzch/UoiPeaoPfq4Yqfuld0Bjr5wnlJ OFEf9gM0ZFgK4j4tfA0BzuoSDyH5R5iKT3ruENICGyNE6fijo2cOGi/9ozIardcSi55J yA8RQrt+6zySy2ck99DLpKfUp8YsDY0gejGrG4FtJu0STPaVb4rp8iwFo3t+IJGUmeZE XBhz6cDVKs1JkVkGDQMPbQTfPjtAYb6zU92YQMmNlbUGVFM2b8VuHQD2rwEhfg13zl7y xxiQ== 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=voAuv5qPBHPc/k/dyjB+W0Xau4XgwmjU5jtBPFVJyF4=; b=bQ+5YaaoDoQbI4k8IcX7s6Yppm0qjYFtqdI0f5Ab3XvCGY7YhOfiZpTrcjgm0LCutc IDFW3sw8y9O91VVFnsNNK79apWKxQgV11eD962bTrT/2T5yWKeaDERNQxOu1mfr0EiZW kkTiwKuYtfFolPBHi5kkTrS5OEqOvL35muSDXBdau6D2ACpE05vXL+C4Klebk/fP4o78 AzcaU2XP6Sjakd9M358lPhXlHq/1LkEK/zQKSW8mqu9PlotzotiViDzk+ZUNlpgQmRe9 3nlikry4alKKnaCV1bsnNKlDty3HrGsbsxjUJjZIjtH0lEGGfs3ysR29o7IBhRaqXJWK Osng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=XoHSJH3N; 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 h15si22105276plk.74.2019.07.16.23.19.12; Tue, 16 Jul 2019 23:19: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=XoHSJH3N; 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 S1728709AbfGQGTI (ORCPT + 29 others); Wed, 17 Jul 2019 02:19:08 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:62963 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbfGQGS0 (ORCPT ); Wed, 17 Jul 2019 02:18:26 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5Od009435; Wed, 17 Jul 2019 15:18:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5Od009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344287; bh=voAuv5qPBHPc/k/dyjB+W0Xau4XgwmjU5jtBPFVJyF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XoHSJH3Nzc2u1kjNx0kOh8OywZ9B4vO80mxko2a2YUKt83wRCgExPt8JCkpK6oHa1 XCSbkNlFY5N6bucKXjA85n7aDSoqeVGxbao77NLi8OICi/NYPCTvHhtea1FjPNTHby VFfSjnz0z650Lnq6l6PDx4eH++3iT1kOanAGJ/z8NT7BYmYlFVE7iwh4c65uSq5Qt5 WQ8/3ieUrvBn7J9mwDMmlVEtvYAj0Rj85+L2l1ODyP7t/89+ab/7ERTis+ItvwoyrR 4pCZj4zYu5oRZR8cUa1Y3lOaUifJuNFaoENx75zvj96wfyIKiVSxHmQKM5AkgHlJzO J3aNWuDV5joKQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v3 01/12] kbuild: do not create empty modules.order in the prepare stage Date: Wed, 17 Jul 2019 15:17:49 +0900 Message-Id: <20190717061800.10018-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, $(objtree)/modules.order is touched in two places. In the 'prepare0' rule, scripts/Makefile.build creates an empty modules.order while processing 'obj=.' In the 'modules' rule, the top-level Makefile overwrites it with the correct list of modules. While this might be a good side-effect that modules.order is made empty every time (probably this is not intended functionality), I personally do not like this behavior. Create modules.order only when it is sensible to do so. This avoids creating the following pointless files: scripts/basic/modules.order scripts/dtc/modules.order scripts/gcc-plugins/modules.order scripts/genksyms/modules.order scripts/mod/modules.order scripts/modules.order scripts/selinux/genheaders/modules.order scripts/selinux/mdp/modules.order scripts/selinux/modules.order Going forward, $(objtree)/modules.order lists the modules that was built in the last successful build. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: - inverted the logic "preparing" -> need-modorder Makefile | 4 ++-- scripts/Makefile.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index e43285786102..b74a6e9cefc8 100644 --- a/Makefile +++ b/Makefile @@ -1072,7 +1072,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; PHONY += $(vmlinux-dirs) $(vmlinux-dirs): prepare - $(Q)$(MAKE) $(build)=$@ need-builtin=1 + $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1 filechk_kernel.release = \ echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" @@ -1616,7 +1616,7 @@ $(objtree)/Module.symvers: module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) PHONY += $(module-dirs) modules $(module-dirs): prepare $(objtree)/Module.symvers - $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) + $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) need-modorder=1 modules: $(module-dirs) @$(kecho) ' Building modules, stage 2.'; diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 5829ccbc7dd0..631bb89524de 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -63,7 +63,7 @@ ifneq ($(strip $(real-obj-y) $(need-builtin)),) builtin-target := $(obj)/built-in.a endif -ifdef CONFIG_MODULES +ifeq ($(CONFIG_MODULES)$(need-modorder),y1) modorder-target := $(obj)/modules.order endif From patchwork Wed Jul 17 06:17:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169092 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp529867ilk; Tue, 16 Jul 2019 23:18:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzG1lUA2GNyYceWTGKB+r5V+7ACs5ZaNVR1gk8RPYdDh8O6tHXaK2J0v4Ydp21lHeMXDErs X-Received: by 2002:a63:eb06:: with SMTP id t6mr34270060pgh.107.1563344316423; Tue, 16 Jul 2019 23:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344316; cv=none; d=google.com; s=arc-20160816; b=EwGQubhIpsZb6ppXidF9LgABrhTHZUh6KwgLHs9dQ1WcyGAhAJ2sIEO1mzmlpmLoy2 Kb1SIkpplIThy1nfnyxXCZseY1F3dUGYPezPCpriTPFBFEa3CZgAafyFyt7ORpvTqBzn 8YB4NRIrhMoiwb3omWYspbVlOWJUU1d3d/FjIaLoAzTbA+feffirLwqfMC0/5JEXoxR6 FgItZtZ/7yv6f9Chzy7sKg1xfe/kewn3IBEM3F6D0j0plwVdjsnzTucW5gdqQC3/xdbh ldXT+dJNLqZsh4plfbsTjx76jZ7TfDphXpBz0+QdlDTJwAShbbGaY/nfSjoxCu2Oir97 qk7Q== 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=bW9MlR9anEqZaRsV/yNzhOtgPvYfSH+v4L1uzgSzinY=; b=mFOEQQgi+8On2SujKwITFWh6U9xlb6s8ijIngO2KpgHQx1MHlJywJiCrv0IZB9GyE7 KM5sEf+zhEaZ47B0BVB6iIdrKKiYupWARF+xOlfl/Z6bgVLK1nkc7Dit283VE/nrcPtm BQgu0xu5WhdyMyEvwYtsPaCTTzAjToObHf5P5PfJhJqXDwv5KogkOYISVlO6iS+nPm79 gI7Z+ZU/KiDFja/x/13/KOeik/tEgF7FcsAyh3XTs5WvyJ0H64xMqqoeIO6J8niSOg0E YLaUHyeSe+t55HIpmKU6DxiwuOiaFGPcaWplvZRmSN0CHYbwPGrZYsQU3KnNyZU2E9JB BknQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=qKceRlqp; 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 d9si16559388pgv.577.2019.07.16.23.18.36; Tue, 16 Jul 2019 23:18:36 -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=qKceRlqp; 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 S1727290AbfGQGSe (ORCPT + 29 others); Wed, 17 Jul 2019 02:18:34 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:62967 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbfGQGS1 (ORCPT ); Wed, 17 Jul 2019 02:18:27 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5Oe009435; Wed, 17 Jul 2019 15:18:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5Oe009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344288; bh=bW9MlR9anEqZaRsV/yNzhOtgPvYfSH+v4L1uzgSzinY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qKceRlqpHWlnG3IVZ+0qQxJKx6Vv2a8liDbA/6tI8y/ScyIs3FffSd/TyCpkfCHZS V0nrbWf+wwgDU8ztwIJLhxk2xSPVRplD0CZKx3X4Cwtq+U1gKRgxSJOTlKP3/TRApD Zmrpts4pxfjvlJ8WdP2EPmJ3JeUkIFrU3l5VjdhijKMjQE4XFmC5qcKyoNui+GsVbJ zxZaZ+3Z4+uM17uOxSguQDFP5aNi5O6ADeXz+7Kn8ajhrS8rBHAVLqFWfzoAJq7P6J etOVAQKcpMGFYgMnX7lMfY+qcZ3UpmBwqRSOvple/qcSY+t1bJLuTVatwny1P4d9wa DNM2WS+BW2aiA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v3 02/12] kbuild: get rid of kernel/ prefix from in-tree modules.{order, builtin} Date: Wed, 17 Jul 2019 15:17:50 +0900 Message-Id: <20190717061800.10018-3-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Removing the 'kernel/' prefix will make our life easier because we can simply do 'cat modules.order' to get all built modules with full paths. Currently, we parse the first line of '*.mod' files in $(MODVERDIR). Since we have duplicated functionality here, I plan to remove MODVERDIR entirely. In fact, modules.order is generated also for external modules in a broken format. It adds the 'kernel/' prefix to the absolute path of the module, like this: kernel//path/to/your/external/module/foo.ko This is fine for now since modules.order is not used for external modules. However, I want to sanitize the format everywhere towards the goal of removing MODVERDIR. We cannot change the format of installed module.{order,builtin}. So, 'make modules_install' will add the 'kernel/' prefix while copying them to $(MODLIB)/. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None Makefile | 4 ++-- scripts/Makefile.build | 2 +- scripts/Makefile.modbuiltin | 2 +- scripts/modules-check.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index b74a6e9cefc8..396cd5e525d1 100644 --- a/Makefile +++ b/Makefile @@ -1329,8 +1329,8 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi - @cp -f $(objtree)/modules.order $(MODLIB)/ - @cp -f $(objtree)/modules.builtin $(MODLIB)/ + @sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order + @sed 's:^:kernel/:' modules.builtin > $(MODLIB)/modules.builtin @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/ $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 631bb89524de..10e92a27ec20 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -426,7 +426,7 @@ endif # builtin-target modorder-cmds = \ $(foreach m, $(modorder), \ $(if $(filter %/modules.order, $m), \ - cat $m;, echo kernel/$m;)) + cat $m;, echo $m;)) $(modorder-target): $(subdir-ym) FORCE $(Q)(cat /dev/null; $(modorder-cmds)) > $@ diff --git a/scripts/Makefile.modbuiltin b/scripts/Makefile.modbuiltin index 50a9990760f3..7d4711b88656 100644 --- a/scripts/Makefile.modbuiltin +++ b/scripts/Makefile.modbuiltin @@ -40,7 +40,7 @@ __modbuiltin: $(modbuiltin-target) $(subdir-ym) @: $(modbuiltin-target): $(subdir-ym) FORCE - $(Q)(for m in $(modbuiltin-mods); do echo kernel/$$m; done; \ + $(Q)(for m in $(modbuiltin-mods); do echo $$m; done; \ cat /dev/null $(modbuiltin-subdirs)) > $@ PHONY += FORCE diff --git a/scripts/modules-check.sh b/scripts/modules-check.sh index 39e8cb36ba19..f51f446707b8 100755 --- a/scripts/modules-check.sh +++ b/scripts/modules-check.sh @@ -9,7 +9,7 @@ check_same_name_modules() for m in $(sed 's:.*/::' modules.order | sort | uniq -d) do echo "warning: same module names found:" >&2 - sed -n "/\/$m/s:^kernel/: :p" modules.order >&2 + sed -n "/\/$m/s:^: :p" modules.order >&2 done } From patchwork Wed Jul 17 06:17:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169100 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp530380ilk; Tue, 16 Jul 2019 23:19:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqykFoLXmEo1PvkhkgrU2jqWVuMKyesHF+8tqd2myToi95XWexxDGTJ7faMOG51yWt/yuJxR X-Received: by 2002:a17:902:e613:: with SMTP id cm19mr38519885plb.299.1563344350480; Tue, 16 Jul 2019 23:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344350; cv=none; d=google.com; s=arc-20160816; b=k6LzJJqnCKlpAzylyvj+9azKCBDP68QKDzmHd0aUen0/BIT8MIa088MWD8NB/kLx4Q 6HCNrQ4UDO9NHUjUyDgPb/ej7IWKHva1nbQNPXUaygosG41ZE0AYI/dwtzgQomp2fjvu GcuBx4IyMZT4aaoaicUHwEszpiDoOTJdjlTcrvO1IkoFZvzXUsXDUVz07QsKdGAy3QPF 8YeeOqeg0TRsmZ9H8F4tPUCy55eVXDPoW/wSJiVmtrTdwvKKgo0+xAtcJu521qQ3+1sL C2iReSK//ZOS1QhZCNI69vJkOvakHlfCeMextd7yCMk9jYVofOoA+IgtTeOqIA80Brwk Otww== 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=2G2F1io/a1Cyo3RLgFQtLEcw7nkwBeLTzPQ6b0qTYgw=; b=LeJDsDt93qUePcKljQsJiz5kpEnAEZkc70kApxwvNrTxSs2e4fcWcCPky0Eb/VJ0RK quwdRPRw5BQY1k7N+dJnGP8L8GaNwC2wZfDdWLoSCB9U89AvFKRF+s1dDd7npfkQWNan 4bpZWqQvv7qZkYtGmZ2CLlIwXsTbVdfQh1l+BFbXHL/ekU45K1a583F6nMUn+/WK0jK9 1mr//ZId1XqfypsA88SO8PmUHvWfElb/1O36v69W6FehOU6ig/LaqJwT9YJSZFczf0kW a/0KjYaef6TcUmSdeapxRyVjfYYzNMKa/hWdf80crIRjbwi2uaK3mAEvV6NuDyJ9WX8z 8M5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=0+8YVbrz; 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 h15si22105276plk.74.2019.07.16.23.19.10; Tue, 16 Jul 2019 23:19:10 -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=0+8YVbrz; 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 S1728819AbfGQGTJ (ORCPT + 29 others); Wed, 17 Jul 2019 02:19:09 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:62962 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbfGQGS0 (ORCPT ); Wed, 17 Jul 2019 02:18:26 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5Of009435; Wed, 17 Jul 2019 15:18:08 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5Of009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344288; bh=2G2F1io/a1Cyo3RLgFQtLEcw7nkwBeLTzPQ6b0qTYgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0+8YVbrztAoSBFqkGzUPZ8kZKGT1V69CbSed8SLuaCMh1al9n/CsHQJkRVsEuL9f0 Roitzljx5PR6tv3Jg4S2KH2udpdY8BU4CmSmsCogSuBJ8PA2oYbDRHTRRlHYz2hUZd WnAnLNXphpTL1iMItElC+97PRshKMZF5OTTzKvlEStrDc+Pha5mMr9Ew8UiSCISV3n QXJjxgu5IWypy87/z73HVWtooH73btg8B0w/TYnCT+JwYg/HFG41/YaTQy3b28lTz0 6cIJi9O0ePaACVQJAtRM9F8WOWemIaC7LxqhFJAtYieO9Wslvd80P7Rput734rXOuP 4V6pc4mf8O42Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v3 03/12] kbuild: remove duplication from modules.order in sub-directories Date: Wed, 17 Jul 2019 15:17:51 +0900 Message-Id: <20190717061800.10018-4-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, only the top-level modules.order drops duplicated entries. The modules.order files in sub-directories potentially contain duplication. To list out the paths of all modules, I want to use modules.order instead of parsing *.mod files in $(MODVERDIR). To achieve this, I want to rip off duplication from modules.order of external modules too. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None scripts/Makefile.build | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 10e92a27ec20..be32a3752de4 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -423,13 +423,10 @@ endif # builtin-target # # Create commands to either record .ko file or cat modules.order from # a subdirectory -modorder-cmds = \ - $(foreach m, $(modorder), \ - $(if $(filter %/modules.order, $m), \ - cat $m;, echo $m;)) - $(modorder-target): $(subdir-ym) FORCE - $(Q)(cat /dev/null; $(modorder-cmds)) > $@ + $(Q){ $(foreach m, $(modorder), \ + $(if $(filter %/modules.order, $m), cat $m, echo $m);) :; } \ + | $(AWK) '!x[$$0]++' - > $@ # # Rule to compile a set of .o files into one .a file (with symbol table) From patchwork Wed Jul 17 06:17:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169094 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp529954ilk; Tue, 16 Jul 2019 23:18:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZUd2DuN4ETR+7J0bmgZEw+SdIrFUeRUrPaYS/Jn8Re/dTHIUdq58Sowg3/OdbhM6YFXDo X-Received: by 2002:a63:1f1f:: with SMTP id f31mr38665690pgf.353.1563344322198; Tue, 16 Jul 2019 23:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344322; cv=none; d=google.com; s=arc-20160816; b=Au1H1Z+bbV48TyVUSoC7C7dwHVTa+PXAL7hr9G0kH43D5DtHk9BDgWzwtGwkTe4rJL bnf/18iHchUzCBTi1lvfv5gfqnFUEzDx5kTEaLSEI5TGf4E8HE87SLsItfpo9V3tZZBs YJshQtsCOq03V+eoa0vdHd77ICScNt5omCOEPBubYYSFF9wgvfPOs4wjl650X8Xq8noA sKhOSBLCXkyFiaohU5O3TeAXPtpWNTbWSuhKhUKfCeoy+2BIvJ25YLE67oEpBRh2Kol5 hKgFHAXsdYgPQVeHsNfjR83iP6q/xOr0gCj1VA+y3AQtKTBlc3eKHnNhDwYlgq77V5qY +/KQ== 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=f2zDwOw4/cS+Ip24709ZHEFoSqKLnSYLOjK1NOsqn1Q=; b=e93UF/jGbz9H7LyWtfOsFqGMdoNX5ZibD+9HByx8CUGh+TP9OQ7TU1ynwMUR60ibwS XiapOynYrs01qasjvF3UlvcyWwyBPRCdR72+yhN78mHA8YQAMJfSXIGGjzL5uNbJgKqJ EHIgz3qDO1ZQcatN3/IKsEDk+iyVg778oRfEiC9eusHe+fIqk6nuMJV8KJt7/PhFL3dV 7mm+HwkOkL6i031HFlmIjrtkxJGXbj7tXprg/TUC+SNyIVSma0FbIoRXz/diuoclsFaF WTYx2W8DX+85A9w6gGSLwJNkJmnQzE0xskvmZp0D2BrieUC2Ko67UigVX9A0L4VEKS/p NqXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=m76ZNMIu; 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 4si23759508pgo.198.2019.07.16.23.18.41; Tue, 16 Jul 2019 23:18:42 -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=m76ZNMIu; 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 S1727401AbfGQGSk (ORCPT + 29 others); Wed, 17 Jul 2019 02:18:40 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:63126 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbfGQGSa (ORCPT ); Wed, 17 Jul 2019 02:18:30 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5Og009435; Wed, 17 Jul 2019 15:18:09 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5Og009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344289; bh=f2zDwOw4/cS+Ip24709ZHEFoSqKLnSYLOjK1NOsqn1Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m76ZNMIucs0jE+ici7e2zOKCr/o4vOE36vdBJMv/7gSV/FhoMN1ru8iYWPwcuYrY6 7l3CNfjjpTubks2R5qrI+1SowXM90fO6sH84la6P9V5SqN5Nipx1HIDaL7EkjBctmz 3YOZbiYE9W8VqLfoOaPdG2WVLuWvcHU9QmnvUEDy75xqNZahmn3a+nWuTV+Vr0uXGo bwj8OwZl41PferYDVcxCT8dNjRIb7z7vKL2EOC0rvN7C29/Dq4YX7OwI+6mQTK6dTZ sQT1N0s4YvGdYWg+fLhzHgou4aoVjIA0e2T5UvW6LFcog6iz7HnL1Ij2POXmIAGsz+ GAb2qUU95tQIw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , "James E.J. Bottomley" , "Martin K. Petersen" , linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH v3 04/12] scsi: remove pointless $(MODVERDIR)/$(obj)/53c700.ver Date: Wed, 17 Jul 2019 15:17:52 +0900 Message-Id: <20190717061800.10018-5-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Nothing depends on this, so it is dead code. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None drivers/scsi/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile index aeda53901064..c00e3dd57990 100644 --- a/drivers/scsi/Makefile +++ b/drivers/scsi/Makefile @@ -185,7 +185,7 @@ zalon7xx-objs := zalon.o ncr53c8xx.o # Files generated that shall be removed upon make clean clean-files := 53c700_d.h 53c700_u.h scsi_devinfo_tbl.c -$(obj)/53c700.o $(MODVERDIR)/$(obj)/53c700.ver: $(obj)/53c700_d.h +$(obj)/53c700.o: $(obj)/53c700_d.h $(obj)/scsi_sysfs.o: $(obj)/scsi_devinfo_tbl.c From patchwork Wed Jul 17 06:17:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169090 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp529747ilk; Tue, 16 Jul 2019 23:18:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyM7TRcp3q3B1pQNK5Zpbv03lvMTVPOa7I2UW5HgpW0r5YpKV74TCTjfKS+pK56hUHABRNC X-Received: by 2002:a63:755e:: with SMTP id f30mr39349872pgn.246.1563344308842; Tue, 16 Jul 2019 23:18:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344308; cv=none; d=google.com; s=arc-20160816; b=f/9O7msGwPs0sJ85ouXZrtCawW3cBzN00PpcWr7UiVQq3cBhCon1+nwmZ3sbZRaICS Z/Yen8YdhxVMzHfRnkBMxYexzhZs+fgNGECV7mKfOJAUtAVvjr92a1UHF8Zcw0b1REHW cDM80KpE6d4FXV98ItacSu7x/E8mtCLbKmfiLzE7OcpFnlQaxHfJT16lMLK68XivAiqS JiQtT3hopl3cmcyFfny/fwgLGscBidyPGFPscAwGa36f1+8r9QKC4KSPpeDX74uJBoDp /D5EmAn8kZiB4/vf+JXWSJCYdtfNfofauESRhlcr+okzHa1m8sQ+2yeBd5+AN+44TAzV WlEA== 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=+yHX6hQw6OuR92f/Hwcn458uT44htMCycbRv85DrcTU=; b=NVkP46UkIm8Nqh7Q033Yij7faL93Sw3fozaW3jA/a1AAc+M03RCjXkedOUmEz1Ew5R miN1y7fVoNc/nrxuJWxwTqb6j7jYu6yXgXibWUk37WH/20RNNwQJ1DswzB/4XNgYsxa2 OwZ6BmgUuwfmgSt4j74z/PTazQ9vzuMdShpGRAAQrtRKT+AtI2y0iKaMsT8nsP70Fvfk /VKDet1FqXwJqbL/ULLQFU/EoNEUEP6WnxPaCj/fgTGXwuzUwZKQHFaEg93jzQXMRDE/ ZkMDeUTkVhKz5kUOa69u0rz+oQuBKpmlrH1htWIvUnJcRDYPWYMYpxQxvlguBySLI9Zl u/iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=WnnXStxn; 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 d9si16559388pgv.577.2019.07.16.23.18.28; Tue, 16 Jul 2019 23:18:28 -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=WnnXStxn; 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 S1726949AbfGQGS1 (ORCPT + 29 others); Wed, 17 Jul 2019 02:18:27 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:62957 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbfGQGS0 (ORCPT ); Wed, 17 Jul 2019 02:18:26 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5Oh009435; Wed, 17 Jul 2019 15:18:09 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5Oh009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344290; bh=+yHX6hQw6OuR92f/Hwcn458uT44htMCycbRv85DrcTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WnnXStxnJFNvoFfWAQmGD1Nbi4KX7Y2o6KZ5tH7MndH+tuICLHarIOUq1rYFe0pqm mQJvAhWDUo16SQ/26eHp0GTuiWRFU4EzJoXOtMMQaza3xCNhWVqPnJPSl+NeC/mx9O NNQKwXZnGpSPj9X5Yds2DV9bWe3HjgMwkGIcR9k/x579hz0bojLjW20boi57r3MNnd QJa3f54MDuKZbe7I5EkdLDrk/Xk5teT8KYLfvE3hK5IAUxSYnvKebHQYGt1LCHP4se N0oC0XphRuQ6bMvVOigXkDb6xCJSBLX65Bpzm5S3p+x9Hs8qvV07NG1wbCLF2/rZvm C93Z58TrTlJHw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v3 05/12] kbuild: modinst: read modules.order instead of $(MODVERDIR)/*.mod Date: Wed, 17 Jul 2019 15:17:53 +0900 Message-Id: <20190717061800.10018-6-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Towards the goal of removing MODVERDIR, read out modules.order to get the list of modules to be installed. This is simpler than parsing *.mod files in $(MODVERDIR). For external modules, $(KBUILD_EXTMOD)/modules.order should be read. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None scripts/Makefile.modinst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index 0dae402661f3..5a4579e76485 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -8,10 +8,7 @@ __modinst: include scripts/Kbuild.include -# - -__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod))) -modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) +modules := $(sort $(shell cat $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order)) PHONY += $(modules) __modinst: $(modules) From patchwork Wed Jul 17 06:17:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169091 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp529796ilk; Tue, 16 Jul 2019 23:18:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfVoTr3o0BuzHWitHtQa7tgoh72LxEbgGHbLSkNd4vvn+Vx4XtMUdYtVAr3+YN8s5m63Ky X-Received: by 2002:a63:f401:: with SMTP id g1mr40184399pgi.314.1563344311358; Tue, 16 Jul 2019 23:18:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344311; cv=none; d=google.com; s=arc-20160816; b=azRKJJTnsxMWzS0Wmnz1MnyA2mNUX9rBPbCl2elzJX3s1SA/MQeL58wOov5fVeNkUN jfkfL6T2xVUi4O+va+ZU9puPbwl2AELNXoiVkWlyWbOB1JN4NsaPRfIn8SRVFmVbPYyS d60qZqe4ztkeb1+q4SdJd5IuIJFcJSGOdC20n1rOScEpLOeqYGWrV1SVsWQdJxaCr6XF +7nZO3GrRSehvUdEI3096cH5nl8KxpgV/O4rvzTsSm6F11L7dg+s3wRR00PKMXqlWdXP rh0Jq4Zd8WcJudVM1pX5KqFfpLCx/HOP3RLi7rcsLlmKJ4HvC4lEzDItYJSWXn8b7ZZl OxtA== 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=NThCfRRReemUKwHcPVaeEGel1SdY7KDk5R0W8YGBelE=; b=ZQppWbgMVcqa4g1hfDbpAF8iKcXUHi6qPyd14pHkb1QoRfGKFQ0uxp5RSRnr7tkQrK 1dk3vOO1doOct6V4XNBBEmBcJLcO5afanKXc5KudIvyNegOzEx24ZGBV/fC67hwIBTvr FwkOfTQPjhLtoK65wUDrJmfV1Rko4/UTutnl6qtUKW9FdkQJM2XKxXfSkSmMFluumflP WdGkJnXzA9dSf67nMsRk1BqAAIUOC8mxZ+38oLvquNa92zpDlNp7Eyf8AVZta0Z2wsJI jHgYX+BvfmCw1WHag6BMRdtwdX93ddG70UG213gwk/zGYcvGnfTcakEQPW2U7zK/QjjN 9bgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Pv+5ZlUv; 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 d9si16559388pgv.577.2019.07.16.23.18.30; Tue, 16 Jul 2019 23:18:31 -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=Pv+5ZlUv; 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 S1727035AbfGQGS3 (ORCPT + 29 others); Wed, 17 Jul 2019 02:18:29 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:62970 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725907AbfGQGS0 (ORCPT ); Wed, 17 Jul 2019 02:18:26 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5Oi009435; Wed, 17 Jul 2019 15:18:10 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5Oi009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344290; bh=NThCfRRReemUKwHcPVaeEGel1SdY7KDk5R0W8YGBelE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pv+5ZlUvWSf7GBEtyBfu9nBNVMty9Qf4wBQSYHkJE7ZwK3gcEYl7hjwG3KzuxNU2M rzzw31wyA1wR97Ce+lley7A8pyU2m2TVFdX9WwLfWUjYTCanT4mlCcxkms8YS/j350 ZN9lVBjr0qG23nN6yiIkZstX7OAXLHcOrg9hXHhq6imK8EnxPEPpGfQtCkCaddaprm XGPknsCX6GeMD/OHA2id8kOebLfi/wmdhtlRm4cKFxAlu1vLuw6NKRa7B5bwSVckoT cs0Qp6+F9iKorbMg4rHBkAomHZLDMmTADN6FeUm7en4fdzxDIOhKc2foaB18VXwTrj BDRGHBAvX6QNQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v3 06/12] kbuild: modsign: read modules.order instead of $(MODVERDIR)/*.mod Date: Wed, 17 Jul 2019 15:17:54 +0900 Message-Id: <20190717061800.10018-7-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Towards the goal of removing MODVERDIR, read out modules.order to get the list of modules to be signed. This is simpler than parsing *.mod files in $(MODVERDIR). The modules_sign target is only supported for in-kernel modules. So, this commit does not take care of external modules. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None scripts/Makefile.modsign | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.modsign b/scripts/Makefile.modsign index da56aa78d245..d7325cefe709 100644 --- a/scripts/Makefile.modsign +++ b/scripts/Makefile.modsign @@ -8,8 +8,7 @@ __modsign: include scripts/Kbuild.include -__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod))) -modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) +modules := $(sort $(shell cat modules.order)) PHONY += $(modules) __modsign: $(modules) From patchwork Wed Jul 17 06:17:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169095 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp530053ilk; Tue, 16 Jul 2019 23:18:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7i4D+05OVTXYHq7XTlXY+AxBOSbsL7+Izw9ArSFS8ZGX1oCj2jgsNPbjefgnzfpXNtF/H X-Received: by 2002:a63:d755:: with SMTP id w21mr39406990pgi.311.1563344328807; Tue, 16 Jul 2019 23:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344328; cv=none; d=google.com; s=arc-20160816; b=N7g+OTeB/SNzk8F5yVqj5m2CacfNaTduoFvAugJlBudMTDGVF1T+zBpVjmFtpAfdJT 4B05R3Gbj6wQuDvH73JipZ3a62rBw86+SnCATH8RthD4EAn4syKU236rQS6uHQ+gSoKN Ys1X3TOdxA8AG0oK4AcdrVf3T8vMfmxqoxxBzIyXGgUBfPqmpeftDyP+CkuJkbFqWXkU XEkhk/i+3ym3gxK3pD+vwePJLlMeflSMS9cdXLeKqbKxJGU7vZ6obRapFBR13nkvha+P BTjAmuZNtJT6LTA688wUOZqlvrKwhjN8+A2J+PnLIdka4VGaBLwZ+mt7KEjGYTM6I45S 42mA== 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=a5q8HeaGgVOWSLah04ZIlj93TeQsneob5gv011FKr5g=; b=BkyLrqj58+djU/IK/R1B3e5gAQDZ5MPqHW7YjXmKU41Pr1NWbei3lRtfeJTLbKhOc1 IQJOtDa3NWaP9MjPAaLsWii5lYP+s5PTz+lB+3l5znIUWi8XYLM0LpEnPhTayUi8+AL/ 1S9Q9g8/C9OGOw8T9qThgRyzKa6YSPtlN4diTwScKifibHzFoJX5WXYy1WqaUT8dOhMo 6yjaTkZCUoNXd9rCCDwHqwDUYOUIRMvfV0B7EybipKWzhuQKywX4B4BaZMLEIAX9bmLq JDU0tSt/oyPHaMHSd5Vp3olroinL3YnoLDNPF6d1T84SI7XZ5OWfLMdDpZstXLjcvQts H7Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ViwK+Rhh; 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 y63si21374772pgd.403.2019.07.16.23.18.48; Tue, 16 Jul 2019 23:18:48 -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=ViwK+Rhh; 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 S1727552AbfGQGSq (ORCPT + 29 others); Wed, 17 Jul 2019 02:18:46 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:62972 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbfGQGS0 (ORCPT ); Wed, 17 Jul 2019 02:18:26 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5Oj009435; Wed, 17 Jul 2019 15:18:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5Oj009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344291; bh=a5q8HeaGgVOWSLah04ZIlj93TeQsneob5gv011FKr5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ViwK+RhhxDTAPBewxfuYJk5gYFRwRsxaX+ne1sXhrIpqEBY5xtAMlK5o+dKAE/kAu 62KtJxo1W4RM9sWKO9jbR2pX83+0BOX888DO7L/GTXSAMU/JApQIFrasegAlWEj47V 4/HSTg2LdJpQbo410Pp4NZSY9fgW9qk2MTLMiV+jFV1nxvOqbPMabEU+c7dwXlYoa2 Tn2cNr9V7xJddQtOyGUW2FWeNrHFUHG4sJAPSAW98JAQhjwiSTsuyx9lD7OFyij1m4 nm8W+kkMiJN9AadWMW8Ov6MsLALK6O69RFvEUTmDA/0oFqpDokqC3I8DplRBMIu6Rl og4VELHdOGC7A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v3 07/12] kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod Date: Wed, 17 Jul 2019 15:17:55 +0900 Message-Id: <20190717061800.10018-8-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Towards the goal of removing MODVERDIR, read out modules.order to get the list of modules to be processed. This is simpler than parsing *.mod files in $(MODVERDIR). For external modules, $(KBUILD_EXTMOD)/modules.order should be read. Signed-off-by: Masahiro Yamada --- Changes in v3: - Add ifdef CONFIG_MODULES to avoid warning Changes in v2: None scripts/Makefile.modpost | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index fec6ec2ffa47..5841508ffca9 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -8,9 +8,10 @@ # b) A .o file which is the .o files above linked together # c) A .mod file in $(MODVERDIR)/, listing the name of the # the preliminary .o file, plus all .o files +# d) modules.order, which lists all the modules # Stage 2 is handled by this file and does the following -# 1) Find all modules from the files listed in $(MODVERDIR)/ +# 1) Find all modules listed in modules.order # 2) modpost is then used to # 3) create one .mod.c file pr. module # 4) create one Module.symvers file with CRC for all exported symbols @@ -60,10 +61,12 @@ include scripts/Makefile.lib kernelsymfile := $(objtree)/Module.symvers modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers -# Step 1), find all modules listed in $(MODVERDIR)/ -MODLISTCMD := find $(MODVERDIR) -name '*.mod' | xargs -r grep -h '\.ko$$' | sort -u -__modules := $(shell $(MODLISTCMD)) -modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o))) +modorder := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order + +# Step 1), find all modules listed in modules.order +ifdef CONFIG_MODULES +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)) @@ -84,7 +87,7 @@ 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 - cmd_modpost = $(MODLISTCMD) | sed 's/\.ko$$/.o/' | $(modpost) $(MODPOST_OPT) -s -T - + cmd_modpost = sed 's/ko$$/o/' $(modorder) | $(modpost) $(MODPOST_OPT) -s -T - PHONY += __modpost __modpost: $(modules:.ko=.o) FORCE From patchwork Wed Jul 17 06:17:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169102 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp530495ilk; Tue, 16 Jul 2019 23:19:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNt6h079RJTa4EVJ7SdnAVlCzUMZbVtVa7G/lTGMhUzgwx68sMF52tAs4lXzGcdnqGR/Kx X-Received: by 2002:a17:902:b093:: with SMTP id p19mr39664661plr.141.1563344356531; Tue, 16 Jul 2019 23:19:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344356; cv=none; d=google.com; s=arc-20160816; b=R3aoxwhA7KtDHzKsW6w777ow2CvdWc/sS5bhSi5uSclxD7QuNg9o+jtIMS44ovxgl7 S2rj1JRmRHePnUazsiZ4UcKB10GcwSqcMK1Jt0x85mrfwqRL18joKVRaE6nEGFWHc2DO wxwuHVDCnyJshUkj89IMsl7JfD13TS5t8N7tQ6GFmHsKwM95jqqM/QCb4di9XS0YPFaO NrlTAbl9J3bAq686oH2w22Jh8C1ORP9DpFiBvIFKLmi0B24nZ+t/UAdKP66kZb9QIJVV d1FLFDM0p1TJ2hcY9PlNPi8wgTix9B6vwoAHmQPRvHI0NrzdPjhAmS9n3Sdy7XdfNgb/ 6QSw== 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=QrjfI2RnWCz+plNxdKJS2TlPRyyWoZjdUiaEuuPNZUY=; b=xm3rSghutCUHF99/JJl3XcReB/6v6hbyM/zLh/GK+RM9vJ+tf7G/xiW8fVzQcePRqt cYVft9XtoodD03WNVb33cuNEPBj6m9hTPva+PmiSDeOY3ARoCYc25EBryHcng3gusWcZ l0ji5ZuxE0gABDkEoVBI5osMb1OoQXU0zbDiugk9K8FITqYB+CRpMlaUMEWctPaxuopH r4lm/sWnwpFud7PU/WuWDFyfRoJTiqTID0XZTGZsm96/y/zCa6YqtjEPoxvrLigk0s6b X9LoJscb4RhBiV9tNsjtGQBoAIEl0wn9onuoWT3WF1BxAb2lxk1cEVwWyxi44o549b0b d06Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=RhOMv6RX; 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 31si21394956pld.245.2019.07.16.23.19.16; Tue, 16 Jul 2019 23:19:16 -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=RhOMv6RX; 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 S1726906AbfGQGS0 (ORCPT + 29 others); Wed, 17 Jul 2019 02:18:26 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:62956 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbfGQGSZ (ORCPT ); Wed, 17 Jul 2019 02:18:25 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5Ok009435; Wed, 17 Jul 2019 15:18:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5Ok009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344291; bh=QrjfI2RnWCz+plNxdKJS2TlPRyyWoZjdUiaEuuPNZUY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RhOMv6RXHKjoConPQ2URQSQTdnZRFSrzvfvIf1DK4Rg0PVzh8dciowkQj8RbrsSoK 2wBPXSQ+PSQwPz+CRMJzfpfoJqm1E8fiemM+PtpvXj8rKtaD9TkRbbOmDv2JD337LO OwYFGY6gHi/UdCwSy2Ns1y14LJ5ms9CHxqFWaayM6oe+eXaTkGNwMBSkbWY64wwxA5 dXhbdtgCrhLUqSthM6jDjEhpa+6SBfwQvRgDRTNbnC3JnG77VW3DaBdBjIePmTzq1q ShBwXCyUmSWNC6H3a+6v2KIvVTIs+nEr56zsusIL24qq3XeOUr1EKf372QIxf8HtOT gIgiSpL7geW6Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v3 08/12] kbuild: export_report: read modules.order instead of .tmp_versions/*.mod Date: Wed, 17 Jul 2019 15:17:56 +0900 Message-Id: <20190717061800.10018-9-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Towards the goal of removing MODVERDIR aka .tmp_versions, read out modules.order to get the list of modules to be processed. This is simpler than parsing *.mod files in .tmp_versions. Signed-off-by: Masahiro Yamada --- Changes in v3: - New patch Changes in v2: None scripts/export_report.pl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/scripts/export_report.pl b/scripts/export_report.pl index 0f604f62f067..7d3030d03a25 100755 --- a/scripts/export_report.pl +++ b/scripts/export_report.pl @@ -52,13 +52,12 @@ sub usage { sub collectcfiles { my @file; - while (<.tmp_versions/*.mod>) { - open my $fh, '<', $_ or die "cannot open $_: $!\n"; - push (@file, - grep s/\.ko/.mod.c/, # change the suffix - grep m/.+\.ko/, # find the .ko path - <$fh>); # lines in opened file + open my $fh, '< modules.order' or die "cannot open modules.order: $!\n"; + while (<$fh>) { + s/\.ko$/.mod.c/; + push (@file, $_) } + close($fh); chomp @file; return @file; } From patchwork Wed Jul 17 06:17:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169097 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp530158ilk; Tue, 16 Jul 2019 23:18:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqypFh7ULZPfGffuATl1YAZdOgWFHjwUHyvqCN/no2XI/mrEJ8ry7Bi36U10i4ZZkAMyO5rP X-Received: by 2002:a63:7e55:: with SMTP id o21mr32902830pgn.200.1563344334865; Tue, 16 Jul 2019 23:18:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344334; cv=none; d=google.com; s=arc-20160816; b=q/GkHkDnjlMGz2v5UcAjohB3nYmNj80be3zZIfwHOk4sb2jITMf9ijNLd0g1esy2yT xpFu1I+U84DU2ec1C35cw5byk6o26XR03maCBlhlDCJCXBr7mRcj7C+mU51RWsqJpdZ7 IAW2caypZ7S4MyhlgmxHja1bmtoRMC6tDatHkJ4MKMRb+WSwiSoUuOTG2IxvvTCmwHLp SwA/Pfq3HPTIWbYpgA4hiTxamYd8XtZbl+R4GOQewS8ycYgLEFSLnGa7kRMYpfN7Rukj 3FoJjwOZrFyISllnKLisl2xM3gOHVZ8U+nhXncL6RPKDCAK/GrgqFP+HhyJQQFY1isev 677A== 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=krZ6W+tHWJH7GffyTlc7LmZ013xkArEQ4cWHwqkczlI=; b=ibuLxo6ImUlaEHoFfwSc664F2mXKqTsetzLsfxa2vzjF9UG+y2BYrgfF09xJtqpc12 YpYyqunvZhvJwcJuga6hbk+1S/CHUvehTd6/VDBGUAniCTLEesEz/nLrWDFfbgE2Npw5 OCh92bVFzqqBfTjwftQED+gvQ4mNgEdy4nZATek3/hlDer4jkM//LYfT9//GvxIXGkSo FgNMf2i3Iph43wJSo/pgK3oBncYSbGogmMTWVP/84g+kFyaeuw+6DulZfiOrBVbM2ItA 9IrYFCOK1LGN+mWbs4g885YtyMlsajbEQ2+fSe4dUmwOYaIiOvs0KThqmoFvjWqUU814 PE9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=t1UUbokf; 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 p12si22257728pgj.437.2019.07.16.23.18.54; Tue, 16 Jul 2019 23:18: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=t1UUbokf; 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 S1728286AbfGQGSx (ORCPT + 29 others); Wed, 17 Jul 2019 02:18:53 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:63477 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbfGQGSq (ORCPT ); Wed, 17 Jul 2019 02:18:46 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5Ol009435; Wed, 17 Jul 2019 15:18:12 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5Ol009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344292; bh=krZ6W+tHWJH7GffyTlc7LmZ013xkArEQ4cWHwqkczlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t1UUbokfuSiom8ybRWL4NLaySYXk9YGt5C6zZmBwZrHiNY25DkHy9ZCk3z9Ax+bB9 FIeWNPbolvDXCso6FTpmEtCTN3La8KWotw7YxepnqAfbxZR4e3VsYeuS0CJSuZUirY wNvi9UE5dpfFdO8FR1mcSyBoWqImXIQF2L9gBdkAGN/GvfuIwZ/rZr4m702R7+HgbJ ta2xoY73n7Yz1CwgqxTos+tNOY8dWfFfEWeWyifbtv31DrNC7Jm0ku2o/zQ4OLf2wg EQpWQ8HlASCNVxsyiQ12NIezVkPfz91Heb7vyhcIj1Yy7Kw8RBv7Ztxng+pAz8LHGF LwvF99gkXXpKw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , Jonathan Corbet , Michal Marek , Shuah Khan , Thomas Renninger , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v3 09/12] kbuild: create *.mod with full directory path and remove MODVERDIR Date: Wed, 17 Jul 2019 15:17:57 +0900 Message-Id: <20190717061800.10018-10-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While descending directories, Kbuild produces objects for modules, but do not link final *.ko files; it is done in the modpost. To keep track of modules, Kbuild creates a *.mod file in $(MODVERDIR) for every module it is building. Some post-processing steps read the necessary information from *.mod files. This avoids descending into directories again. This mechanism was introduced in 2003 or so. Later, commit 551559e13af1 ("kbuild: implement modules.order") added modules.order. So, we can simply read it out to know all the modules with directory paths. This is easier than parsing the first line of *.mod files. $(MODVERDIR) has a flat directory structure, that is, *.mod files are named only with base names. This is based on the assumption that the module name is unique across the tree. This assumption is really fragile. Stephen Rothwell reported a race condition caused by a module name conflict: https://lkml.org/lkml/2019/5/13/991 In parallel building, two different threads could write to the same $(MODVERDIR)/*.mod simultaneously. Non-unique module names are the source of all kind of troubles, hence commit 3a48a91901c5 ("kbuild: check uniqueness of module names") introduced a new checker script. However, it is still fragile in the build system point of view because this race happens before scripts/modules-check.sh is invoked. If it happens again, the modpost will emit unclear error messages. To fix this issue completely, create *.mod with full directory path so that two threads never attempt to write to the same file. $(MODVERDIR) is no longer needed. Since modules with directory paths are listed in modules.order, Kbuild is still able to find *.mod files without additional descending. I also killed cmd_secanalysis; scripts/mod/sumversion.c computes MD4 hash for modules with MODULE_VERSION(). When CONFIG_DEBUG_SECTION_MISMATCH=y, it occurs not only in the modpost stage, but also during directory descending, where sumversion.c may parse stale *.mod files. It would emit 'No such file or directory' warning when an object consisting a module is renamed, or when a single-obj module is turned into a multi-obj module or vice versa. Signed-off-by: Masahiro Yamada Acked-by: Nicolas Pitre --- Changes in v3: - Fix build error of allnoconfig - Remove cmd_secanalysis - Fix up comment in scripts/adjust_autoksyms.sh - Fix up tools/power/cpupower/debug/kernel/Makefile Changes in v2: - Remove -r of xargs, which is a GNU extension - Add '--' for extra safety .gitignore | 1 + Documentation/dontdiff | 1 + Makefile | 20 +++----------------- lib/Kconfig.debug | 12 +----------- scripts/Makefile.build | 15 +++------------ scripts/Makefile.modpost | 4 ++-- scripts/adjust_autoksyms.sh | 14 +++++--------- scripts/mod/sumversion.c | 16 +++------------- scripts/package/mkspec | 2 +- tools/power/cpupower/debug/kernel/Makefile | 4 ++-- 10 files changed, 22 insertions(+), 67 deletions(-) -- 2.17.1 diff --git a/.gitignore b/.gitignore index 7587ef56b92d..8f5422cba6e2 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ *.lz4 *.lzma *.lzo +*.mod *.mod.c *.o *.o.* diff --git a/Documentation/dontdiff b/Documentation/dontdiff index 5eba889ea84d..9f4392876099 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff @@ -30,6 +30,7 @@ *.lzo *.mo *.moc +*.mod *.mod.c *.o *.o.* diff --git a/Makefile b/Makefile index 396cd5e525d1..9ad9f8d1130d 100644 --- a/Makefile +++ b/Makefile @@ -486,11 +486,6 @@ export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL export KBUILD_ARFLAGS -# When compiling out-of-tree modules, put MODVERDIR in the module -# tree rather than in the kernel tree. The kernel tree might -# even be read-only. -export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions - # Files to ignore in find ... statements export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \ @@ -1029,8 +1024,8 @@ vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS) # Recurse until adjust_autoksyms.sh is satisfied PHONY += autoksyms_recursive -autoksyms_recursive: $(vmlinux-deps) ifdef CONFIG_TRIM_UNUSED_KSYMS +autoksyms_recursive: $(vmlinux-deps) modules.order $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \ "$(MAKE) -f $(srctree)/Makefile vmlinux" endif @@ -1113,7 +1108,6 @@ endif prepare1: prepare3 outputmakefile asm-generic $(version_h) $(autoksyms_h) \ include/generated/utsrelease.h - $(cmd_crmodverdir) archprepare: archheaders archscripts prepare1 scripts @@ -1371,7 +1365,7 @@ endif # CONFIG_MODULES # make distclean Remove editor backup files, patch leftover files and the like # Directories & files removed with 'make clean' -CLEAN_DIRS += $(MODVERDIR) include/ksym +CLEAN_DIRS += include/ksym CLEAN_FILES += modules.builtin.modinfo # Directories & files removed with 'make mrproper' @@ -1641,7 +1635,6 @@ PHONY += $(clean-dirs) clean $(clean-dirs): $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) -clean: rm-dirs := $(MODVERDIR) clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers PHONY += help @@ -1655,8 +1648,6 @@ help: @echo '' PHONY += prepare -prepare: - $(cmd_crmodverdir) endif # KBUILD_EXTMOD clean: $(clean-dirs) @@ -1667,7 +1658,7 @@ clean: $(clean-dirs) -o -name '*.ko.*' \ -o -name '*.dtb' -o -name '*.dtb.S' -o -name '*.dt.yaml' \ -o -name '*.dwo' -o -name '*.lst' \ - -o -name '*.su' \ + -o -name '*.su' -o -name '*.mod' \ -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ -o -name '*.lex.c' -o -name '*.tab.[ch]' \ -o -name '*.asn1.[ch]' \ @@ -1796,11 +1787,6 @@ quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \ $(KERNELRELEASE) -# Create temporary dir for module support files -# clean it up only when building all modules -cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ - $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) - # read saved command lines for existing targets existing-targets := $(wildcard $(sort $(targets))) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 4ac4ca21a30a..cde5675340ba 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -353,23 +353,13 @@ config DEBUG_SECTION_MISMATCH which results in the code/data being placed in specific sections. The section mismatch analysis is always performed after a full kernel build, and enabling this option causes the following - additional steps to occur: + additional step to occur: - Add the option -fno-inline-functions-called-once to gcc commands. When inlining a function annotated with __init in a non-init function, we would lose the section information and thus the analysis would not catch the illegal reference. This option tells gcc to inline less (but it does result in a larger kernel). - - Run the section mismatch analysis for each module/built-in.a file. - When we run the section mismatch analysis on vmlinux.o, we - lose valuable information about where the mismatch was - introduced. - Running the analysis for each module/built-in.a file - tells where the mismatch happens much closer to the - source. The drawback is that the same mismatch is - reported at least twice. - - Enable verbose reporting from modpost in order to help resolve - the section mismatches that are reported. config SECTION_MISMATCH_WARN_ONLY bool "Make section mismatch errors non-fatal" diff --git a/scripts/Makefile.build b/scripts/Makefile.build index be32a3752de4..c6dfcc028f56 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -67,8 +67,6 @@ ifeq ($(CONFIG_MODULES)$(need-modorder),y1) modorder-target := $(obj)/modules.order endif -# We keep a list of all modules in $(MODVERDIR) - __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ $(if $(KBUILD_MODULES),$(obj-m) $(modorder-target)) \ $(subdir-ym) $(always) @@ -87,11 +85,6 @@ ifneq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),) cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $< endif -# Do section mismatch analysis for each module/built-in.a -ifdef CONFIG_DEBUG_SECTION_MISMATCH - cmd_secanalysis = ; scripts/mod/modpost $@ -endif - # Compile C sources (.c) # --------------------------------------------------------------------------- @@ -278,13 +271,11 @@ $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE $(call cmd,force_checksrc) $(call if_changed_rule,cc_o_c) -# Single-part modules are special since we need to mark them in $(MODVERDIR) - $(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE $(call cmd,force_checksrc) $(call if_changed_rule,cc_o_c) @{ echo $(@:.o=.ko); echo $@; \ - $(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod) + $(cmd_undef_syms); } > $(patsubst %.o,%.mod,$@) quiet_cmd_cc_lst_c = MKLST $@ cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && \ @@ -461,12 +452,12 @@ endif # module is turned into a multi object module, $^ will contain header file # dependencies recorded in the .*.cmd file. quiet_cmd_link_multi-m = LD [M] $@ -cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) $(cmd_secanalysis) + cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) $(multi-used-m): FORCE $(call if_changed,link_multi-m) @{ echo $(@:.o=.ko); echo $(filter %.o,$^); \ - $(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod) + $(cmd_undef_syms); } > $(patsubst %.o,%.mod,$@) $(call multi_depend, $(multi-used-m), .o, -objs -y -m) targets += $(multi-used-m) diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 5841508ffca9..6b19c1a4eae5 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -6,8 +6,8 @@ # Stage one of module building created the following: # a) The individual .o files used for the module # b) A .o file which is the .o files above linked together -# c) A .mod file in $(MODVERDIR)/, listing the name of the -# the preliminary .o file, plus all .o files +# c) A .mod file, listing the name of the preliminary .o file, +# plus all .o files # d) modules.order, which lists all the modules # Stage 2 is handled by this file and does the following diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh index aab4e299d7a2..2e4a7320bfb4 100755 --- a/scripts/adjust_autoksyms.sh +++ b/scripts/adjust_autoksyms.sh @@ -8,8 +8,7 @@ # # Create/update the include/generated/autoksyms.h file from the list -# of all module's needed symbols as recorded on the third line of -# .tmp_versions/*.mod files. +# of all module's needed symbols as recorded on the third line of *.mod files. # # For each symbol being added or removed, the corresponding dependency # file's timestamp is updated to force a rebuild of the affected source @@ -47,13 +46,10 @@ cat > "$new_ksyms_file" << EOT */ EOT -[ "$(ls -A "$MODVERDIR")" ] && -for mod in "$MODVERDIR"/*.mod; do - sed -n -e '3{s/ /\n/g;/^$/!p;}' "$mod" -done | sort -u | -while read sym; do - echo "#define __KSYM_${sym} 1" -done >> "$new_ksyms_file" +sed 's/ko$/mod/' modules.order | +xargs -n1 sed -n -e '3{s/ /\n/g;/^$/!p;}' -- | +sort -u | +sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$new_ksyms_file" # Special case for modversions (see modpost.c) if [ -n "$CONFIG_MODVERSIONS" ]; then diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index 0f6dcb4011a8..166f3fa247a9 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c @@ -396,21 +396,11 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen) unsigned long len; struct md4_ctx md; char *sources, *end, *fname; - const char *basename; char filelist[PATH_MAX + 1]; - char *modverdir = getenv("MODVERDIR"); - if (!modverdir) - modverdir = "."; - - /* Source files for module are in .tmp_versions/modname.mod, - after the first line. */ - if (strrchr(modname, '/')) - basename = strrchr(modname, '/') + 1; - else - basename = modname; - snprintf(filelist, sizeof(filelist), "%s/%.*s.mod", modverdir, - (int) strlen(basename) - 2, basename); + /* objects for a module are listed in the second line of *.mod file. */ + snprintf(filelist, sizeof(filelist), "%.*smod", + (int)strlen(modname) - 1, modname); file = grab_file(filelist, &len); if (!file) diff --git a/scripts/package/mkspec b/scripts/package/mkspec index 2d29df4a0a53..8640c278f1aa 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -29,7 +29,7 @@ fi PROVIDES="$PROVIDES kernel-$KERNELRELEASE" __KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g") -EXCLUDES="$RCS_TAR_IGNORE --exclude=.tmp_versions --exclude=*vmlinux* \ +EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \ --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ --exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s" diff --git a/tools/power/cpupower/debug/kernel/Makefile b/tools/power/cpupower/debug/kernel/Makefile index c23e5a6ceb7e..7b5c43684be1 100644 --- a/tools/power/cpupower/debug/kernel/Makefile +++ b/tools/power/cpupower/debug/kernel/Makefile @@ -12,8 +12,8 @@ default: $(MAKE) -C $(KDIR) M=$(CURDIR) clean: - - rm -rf *.o *.ko .tmp-versions .*.cmd .*.mod.* *.mod.c - - rm -rf .tmp_versions* Module.symvers modules.order + - rm -rf *.o *.ko .*.cmd .*.mod.* *.mod.c + - rm -rf Module.symvers modules.order install: default install -d $(KMISC) From patchwork Wed Jul 17 06:17:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169093 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp529894ilk; Tue, 16 Jul 2019 23:18:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5VMLyh3/YD44e5Io+3YQ/yt1ycAdS6yxipm0WLuEfyIn5I2Mvm5E4fq5ZAKpveh8DYfJj X-Received: by 2002:a17:902:9a95:: with SMTP id w21mr40733828plp.126.1563344317992; Tue, 16 Jul 2019 23:18:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344317; cv=none; d=google.com; s=arc-20160816; b=xQABCGtZOtNC0VUM3qK8Vs608cIsdyuOlwnaAFEdOqxp9ZLdjAvRAsMxjYSlCMjAvw 80e2gDpKdnIKqxYuxczgpN8Z1l1sgZCbMQscvr38dkxiMhE2WLMGuuOpjGV0yb9BP6aS eF5yMT1Q9r38eTNuKZyT9/VFoOUVmXokyqzVbJNr2YfRv9b0cyqgzY1oICnhEkNwLKPa LBjmePhICej7gnHqtbFGjNqw2rjJHh2lAbniiZSlMwdMMaG3ad4b0wJUKXn62S7pCOs7 NAjHBTQgDYCuvicacO2BGpQB8xcj78sPx6da1ou8PCgnq8NbTvx9lZlYHsuqQiB9ecRV orRQ== 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=B9SttnFocZkaw85nY/WsYdTlcQPEuOC6fxc7lk7URcI=; b=Z7QCYlF11gv7XbDb0HjVoDQZUYbOyMCLbseCX7vq2PcnkdDQ+SbYHEkn5sGBCq0ja0 4saHwb+tLrVCuEr7q9+/OoFGlhqyTQFFohRNqGdolas9CFZP6GEHlwpYbNL0qyQrYzQJ f9OzBMwpHvyknBdYlySE/o6TGossXPPIF4ouqJpzfZCjA5FMP43o29PSrBfFumbDzNIk cnLBZw1g8gPJJP2GY5AZSHPrJ04nXzgxTAAJLHpJWS2kMJgCe05a6YAOz7+2ouZfipAJ xg8TzzTonZVLlSTGZf05Uo3lfw85ZEjcqmEDS7BZK8FnwiMou3cpDV4uRMZAfDzlGTHh EpeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=iDak+bFR; 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 d9si16559388pgv.577.2019.07.16.23.18.37; Tue, 16 Jul 2019 23:18:37 -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=iDak+bFR; 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 S1727109AbfGQGSc (ORCPT + 29 others); Wed, 17 Jul 2019 02:18:32 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:62965 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfGQGS0 (ORCPT ); Wed, 17 Jul 2019 02:18:26 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5Om009435; Wed, 17 Jul 2019 15:18:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5Om009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344293; bh=B9SttnFocZkaw85nY/WsYdTlcQPEuOC6fxc7lk7URcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iDak+bFRPZmHuYZvEyyq/s/hPKNCDZedK7pJo9U8iUjoysVU9yiTm4HIVB9aZjg5g 6fAC+dm0kH79vQLtcROucgJCIHL4OxLTZk+J4YwadfCJ0j+jSN0GPC+31Fo53IeMZF M2wVHGBEsDUnpvdj89gfrAB8NLvAku+copGimnfe0AnbST5ebrf1Z3mjUfRuvZmn/m vtb8I/MIobOMwhbcg/K7DodmX3jOMIpxr/qaPeS6KRl1OBWyUyKIPYm+EC0qUQF5ez lyheVWA/O8qLXfycNNI/JFiq/3Ba00j6WvyFc0PHmBAkPlSPk139PKwycdVmRA9EO8 x95UeKoBzPSuA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v3 10/12] kbuild: remove the first line of *.mod files Date: Wed, 17 Jul 2019 15:17:58 +0900 Message-Id: <20190717061800.10018-11-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current format of *.mod is like this: line 1: directory path to the .ko file line 2: a list of objects linked into this module line 3: unresolved symbols (only when CONFIG_TRIM_UNUSED_KSYMS=y) Now that *.mod and *.ko are created in the same directory, the line 1 provides no valuable information. It can be derived by replacing the extension .mod with .ko. In fact, nobody uses the first line any more. Cut down the first line. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None scripts/Makefile.build | 4 ++-- scripts/adjust_autoksyms.sh | 4 ++-- scripts/mod/sumversion.c | 9 ++------- 3 files changed, 6 insertions(+), 11 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.build b/scripts/Makefile.build index c6dfcc028f56..9f37f203882f 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -274,7 +274,7 @@ $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE $(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE $(call cmd,force_checksrc) $(call if_changed_rule,cc_o_c) - @{ echo $(@:.o=.ko); echo $@; \ + @{ echo $@; \ $(cmd_undef_syms); } > $(patsubst %.o,%.mod,$@) quiet_cmd_cc_lst_c = MKLST $@ @@ -456,7 +456,7 @@ quiet_cmd_link_multi-m = LD [M] $@ $(multi-used-m): FORCE $(call if_changed,link_multi-m) - @{ echo $(@:.o=.ko); echo $(filter %.o,$^); \ + @{ echo $(filter %.o,$^); \ $(cmd_undef_syms); } > $(patsubst %.o,%.mod,$@) $(call multi_depend, $(multi-used-m), .o, -objs -y -m) diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh index 2e4a7320bfb4..a904bf1f5e67 100755 --- a/scripts/adjust_autoksyms.sh +++ b/scripts/adjust_autoksyms.sh @@ -8,7 +8,7 @@ # # Create/update the include/generated/autoksyms.h file from the list -# of all module's needed symbols as recorded on the third line of *.mod files. +# of all module's needed symbols as recorded on the second line of *.mod files. # # For each symbol being added or removed, the corresponding dependency # file's timestamp is updated to force a rebuild of the affected source @@ -47,7 +47,7 @@ cat > "$new_ksyms_file" << EOT EOT sed 's/ko$/mod/' modules.order | -xargs -n1 sed -n -e '3{s/ /\n/g;/^$/!p;}' -- | +xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- | sort -u | sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$new_ksyms_file" diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index 166f3fa247a9..63062024ce0e 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c @@ -398,7 +398,7 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen) char *sources, *end, *fname; char filelist[PATH_MAX + 1]; - /* objects for a module are listed in the second line of *.mod file. */ + /* objects for a module are listed in the first line of *.mod file. */ snprintf(filelist, sizeof(filelist), "%.*smod", (int)strlen(modname) - 1, modname); @@ -407,13 +407,8 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen) /* not a module or .mod file missing - ignore */ return; - sources = strchr(file, '\n'); - if (!sources) { - warn("malformed versions file for %s\n", modname); - goto release; - } + sources = file; - sources++; end = strchr(sources, '\n'); if (!end) { warn("bad ending versions file for %s\n", modname); From patchwork Wed Jul 17 06:17: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: 169098 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp530174ilk; Tue, 16 Jul 2019 23:18:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSJMotZtyOSvMXJTLW6gnr0mivys/JQ/M8PB0nJ8Q9UZbVLJOUIx84S0Bv+OQbOtkIM5Eq X-Received: by 2002:a17:902:28c9:: with SMTP id f67mr1212067plb.19.1563344336689; Tue, 16 Jul 2019 23:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344336; cv=none; d=google.com; s=arc-20160816; b=TbeV19kEIjqmcEMB9DQli4a1z2YptpRCE7XbXBxcZazlm/TSBp9vdywPM1TrwtID4Z K9lcE4zpjEs6whx95wpNvPfvopXDvNIP6bOoJha47djcik3BYur+NjDPYqoM55nQySiB hAEscVABqK/EV28caseLqIfRCkW+ehEAK+XBsAp5znYWDRhISRG+tAxKIvgbMSnCCluJ 7eXcOKaBj/JWg69exPusEjCdZMonm7M4Nq25Jh2dw1AZKwjIJO032lFXDZbY94RbNOSe IRp2saln8e89gbBeD0+9l7Jc0RuAlzDBu2626ZOIA0utrQ8pfBvOQaOsH0Ni9YGgeXGM oTOA== 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=JAReFU+lVkqbhjScMSMVCxd0MDAvCgo6xXsG/5QGEaA=; b=elSAii3tkfsV2wqgHR+NWgDNuvnNT9UqDYt3s4kBOGmSMrTqcyqP9BlVISYcDs0ss8 qokRBw8fLobH1G+Io02miaCRXgz26nhO0NsxNhAZCxFPozKYpCi9M9XXFJNzxYvO7OzX 3vZnzlVGg3Bu2dCSmn07bdqicqDiF+KVGEGJFAtT2ZO9YKPHexqHX/2GX6QD5mx8MlCa LjnZVkgJOlmpWXxMyeMthTNVO78Vyz47miGrH+VHq5LjFomJm4UeIeakW2XnTektvVCn VYN5A4b4MMkIHfKA4Gx8iKRHTAmMD5pKGOHbPgPgM9uGAT5XhsIq5cL7IID4hhxH6q5n nQdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=fiUZUEF5; 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 p12si22257728pgj.437.2019.07.16.23.18.56; Tue, 16 Jul 2019 23:18:56 -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=fiUZUEF5; 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 S1728037AbfGQGSv (ORCPT + 29 others); Wed, 17 Jul 2019 02:18:51 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:62958 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbfGQGS0 (ORCPT ); Wed, 17 Jul 2019 02:18:26 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5On009435; Wed, 17 Jul 2019 15:18:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5On009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344294; bh=JAReFU+lVkqbhjScMSMVCxd0MDAvCgo6xXsG/5QGEaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fiUZUEF5fl5qklYXBblKJnRbIXqghD8awTynEfSPiby8opkhdmR4tM2/Hafmep9ko xuCHkXPFCVunevTa4NVxFr7rRAFT2k0jZnbEXQcARzs8wDQMazoLw0xhDmcWdrUcD1 rJuvVW3/o2m4t0wCZ2HRJsd4rjk/sqRZeXK6Sqqisv6TglRRJ4CdPGc66lZJtMiPIT xKmwYmdHYaY53xAJfK+iYuFw2fD9V+OmbfcctUxqtGYgu3A0CeLO8DbSv997rLQB21 pZaYdN6jMso7Bv/V5GwM6VBYiasJBf9WoJOB6QwdoydAg10rK4JnyMPamAzUGbJsAJ ZOlvPjIt+wymg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v3 11/12] kbuild: remove 'prepare1' target Date: Wed, 17 Jul 2019 15:17:59 +0900 Message-Id: <20190717061800.10018-12-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that there is no rule for 'prepare1', it can go away. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index 9ad9f8d1130d..14458ab3d6a8 100644 --- a/Makefile +++ b/Makefile @@ -1089,7 +1089,7 @@ scripts: scripts_basic scripts_dtc # archprepare is used in arch Makefiles and when processed asm symlink, # version.h and scripts_basic is processed / created. -PHONY += prepare archprepare prepare1 prepare3 +PHONY += prepare archprepare prepare3 # prepare3 is used to check if we are building in a separate output directory, # and if so do: @@ -1106,10 +1106,8 @@ ifdef building_out_of_srctree fi; endif -prepare1: prepare3 outputmakefile asm-generic $(version_h) $(autoksyms_h) \ - include/generated/utsrelease.h - -archprepare: archheaders archscripts prepare1 scripts +archprepare: archheaders archscripts scripts prepare3 outputmakefile \ + asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h prepare0: archprepare $(Q)$(MAKE) $(build)=scripts/mod From patchwork Wed Jul 17 06:18: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: 169096 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp530074ilk; Tue, 16 Jul 2019 23:18:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzivGctNmWJkuow/tal1FQmod+udPDKS0Mou0D130yhYSGPV0T8crD4PHc+2p3H+ks0451 X-Received: by 2002:a17:902:424:: with SMTP id 33mr41096829ple.151.1563344330025; Tue, 16 Jul 2019 23:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344330; cv=none; d=google.com; s=arc-20160816; b=t5nAfFU+LOozQYPsg5mpZvHQEef4g0dV2EIqwEtxteyz72vBf5h4dco20/00MI3GQP hUsevjuMIMNwSAvVU3FA0JG8n3T8/jjILNr2BjVTuydi+2B4nwWORqtWKqyCTVIKYZx/ 116IndaHcqN0YwgX5F21B5cRhW1PY/+9h388Gcle/9qHhF3SnrF1FRYYkKVDkpSrGNle QDhwKWoyrLGM20pvuMkYdD20WNtAH+KeltoqIEnABdj4lsqLkToDGlV8075vLF7FCfys Ujgc3ybk2TMzZRwp1LEliFru0/r2iAvrEHQbi468u0L3DJFvN2a1K2RKOYAQuLLOfEZk vVlA== 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=tV8Id8UQty/9yTwTbnWxEz0ZVA1NCDaDyk+FEo41GJ4=; b=v4MjmublN6k/DQujgcea5hSOCyg8RmnETShoJ4fs0Gm49va0YQmN/1dHL0QxqAyf0O TIz/oIZs6yf96ddIZEwyusBjMcNZRrXb/0gDrGmx9ZJ49AiMXNt2L8ASKw93EDpSrM6s y5QCd+esonLz9B1SRxeKYgitOuSZheS74Ctm2BKyBk287paqka1VvpnI93AZ2iLEtFT9 Xtj3rgWE5j5FjHbf9AclbdHlF4thIiHsy5f2rWK/+mUh7Gn/iQ0BggOE7RpJQv5oBK84 3sccbSBHcs3KWR9dum2YRcLONa+4c0jToyX5U6NMbUK9SxAW1b3Qi+4uPJkoJQr9tAI9 Lcpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=mxgVQSXY; 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 73si3413138pgg.72.2019.07.16.23.18.49; Tue, 16 Jul 2019 23:18:50 -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=mxgVQSXY; 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 S1727739AbfGQGSs (ORCPT + 29 others); Wed, 17 Jul 2019 02:18:48 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:62971 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbfGQGS0 (ORCPT ); Wed, 17 Jul 2019 02:18:26 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5Oo009435; Wed, 17 Jul 2019 15:18:14 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5Oo009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344294; bh=tV8Id8UQty/9yTwTbnWxEz0ZVA1NCDaDyk+FEo41GJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mxgVQSXY/Pk6U50rixL3JiIl5umcvl3ak0EkcZYWJm2Bvw3YzLcQ+7+MW/rxVyEeb VMe1qVqxi8RvoAI+EOASzPXbD71nHD8vEc1f7NPQr67qFp2QVEdPtwGB4kBW2TtpEp dJrFbYjtJmfnAcdqbRnNQ+dxXvQutkdtYmPvolLDFG3ygku5QOVWeBcuMi8Drx0LIP Yc9ANZTaSgQGtKvu3P7RXCm55Zngn3oo27LQelPxYvrsAj6y4g2BsFpLq0g9Bpkpf3 BaBcb+jikDZua+PlQULSUVSasuUixwZzQT1ROkdwOhKgBbImJfJKO5HjiT5pXdJx25 /N4o4EtG/7VcA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v3 12/12] kbuild: split out *.mod out of {single, multi}-used-m rules Date: Wed, 17 Jul 2019 15:18:00 +0900 Message-Id: <20190717061800.10018-13-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, *.mod is created as a side-effect of obj-m. Split out *.mod as a dedicated build rule, which allows to unify the %.c -> %.o rule, and remove the single-used-m rule. This also makes the incremental build of allmodconfig faster because it saves $(NM) invocation when there is no change in the module. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None scripts/Makefile.build | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 9f37f203882f..0d434d0afc0b 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -67,8 +67,10 @@ ifeq ($(CONFIG_MODULES)$(need-modorder),y1) modorder-target := $(obj)/modules.order endif +mod-targets := $(patsubst %.o, %.mod, $(obj-m)) + __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ - $(if $(KBUILD_MODULES),$(obj-m) $(modorder-target)) \ + $(if $(KBUILD_MODULES),$(obj-m) $(mod-targets) $(modorder-target)) \ $(subdir-ym) $(always) @: @@ -261,7 +263,7 @@ endef # List module undefined symbols (or empty line if not enabled) ifdef CONFIG_TRIM_UNUSED_KSYMS -cmd_undef_syms = $(NM) $@ | sed -n 's/^ *U //p' | xargs echo +cmd_undef_syms = $(NM) $< | sed -n 's/^ *U //p' | xargs echo else cmd_undef_syms = echo endif @@ -271,11 +273,15 @@ $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE $(call cmd,force_checksrc) $(call if_changed_rule,cc_o_c) -$(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE - $(call cmd,force_checksrc) - $(call if_changed_rule,cc_o_c) - @{ echo $@; \ - $(cmd_undef_syms); } > $(patsubst %.o,%.mod,$@) +cmd_mod = { \ + echo $(if $($*-objs)$($*-y)$($*-m), $(addprefix $(obj)/, $($*-objs) $($*-y) $($*-m)), $(@:.mod=.o)); \ + $(cmd_undef_syms); \ + } > $@ + +$(obj)/%.mod: $(obj)/%.o FORCE + $(call if_changed,mod) + +targets += $(mod-targets) quiet_cmd_cc_lst_c = MKLST $@ cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && \ @@ -456,8 +462,6 @@ quiet_cmd_link_multi-m = LD [M] $@ $(multi-used-m): FORCE $(call if_changed,link_multi-m) - @{ echo $(filter %.o,$^); \ - $(cmd_undef_syms); } > $(patsubst %.o,%.mod,$@) $(call multi_depend, $(multi-used-m), .o, -objs -y -m) targets += $(multi-used-m)