From patchwork Fri Nov 23 04:51:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 151830 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1599093ljp; Thu, 22 Nov 2018 20:51:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/X4hTypKr29sNTZ4rGirWCTCF9r+3gsvzmLHguCgZjwjauvvY5ZHgHRsY+hnTV8HKKGWyn/ X-Received: by 2002:a17:902:7e44:: with SMTP id a4mr14161219pln.338.1542948709059; Thu, 22 Nov 2018 20:51:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542948709; cv=none; d=google.com; s=arc-20160816; b=q6uQ971wLB8eMmvslo+gCiJICZEUjwvFyJOWldrZ+Vz2Wr9/icGNIzoIIzJ+MTUuXu WGcgqYZhNOhDtdrXi7fA1jHBsTebqbWIQ644g0mZ4rBR93ZHBrB8hBKr4Z6Smt6PfesX EDxPmYpfLRPQlXN3jqZ+9alu88gUHCPtZDLGpdCBUpnFmrYNJVwCUzg9Q5z41DoiM940 wzaG06stC+vKv+OC9q9arvI8DYEu09NEGgKGnCyYh0y3doF7SkIvu+K0lBvxagZtAuhU cdm0WULIo7Ct4BxCEKjlyeaUOBv9Iy1qM4HgHphu7fXLa8Sup8AyfSoxgLsyHxDUEZhK jIyA== 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=dOs9bDoO5WsxGBpwTJjGsltucWemOPc7mrzxRG/Ehnc=; b=JQ84kGXQgfiM6K8biqxCYSzQGvZTT43xjlpEW0a+xPUdCdd1OqfFPAv75VA/t/0OYa +MownE+rvhxADS3O5h9bCkJpcVq8EeQfoO5iWZF/gG218yHHNbVrBHucSonMiOXyN/Id dXlWcGWz+ffMRTn0z1kW1s51JyIduBn24z27WYvfVUXctc6oX4JlWkb2/UgFK2cUC1aQ 8EWV7fHVzn5B6D3qTbi0x7L/mST2ymFnR4CYklDi+m80hu88+iPkoOBrsQG/F+kEs09e Vqe6b6TMktmZ4Ln8rgb88FvieJtw4HHYcGsFiG2F2C7lwYTF3WObMZPCVjHXtnKN0PZ1 enVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="1HjJs/1w"; 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 x24si17840939plr.379.2018.11.22.20.51.48; Thu, 22 Nov 2018 20:51:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="1HjJs/1w"; 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 S2393207AbeKWPeU (ORCPT + 32 others); Fri, 23 Nov 2018 10:34:20 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:48170 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730451AbeKWPeU (ORCPT ); Fri, 23 Nov 2018 10:34:20 -0500 Received: from grover.tkatk1.zaq.ne.jp (zaqdadce369.zaq.ne.jp [218.220.227.105]) (authenticated) by conuserg-10.nifty.com with ESMTP id wAN4pTNM020182; Fri, 23 Nov 2018 13:51:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com wAN4pTNM020182 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1542948689; bh=dOs9bDoO5WsxGBpwTJjGsltucWemOPc7mrzxRG/Ehnc=; h=From:To:Cc:Subject:Date:From; b=1HjJs/1wyjGni0ShlOn6fBLgUbJV/NCtILmQjzNujlVLwb6vbcpz/s6QOhZ4TuUGD eE+OSNSdnruBNxAmUD/s8SXhpT3dtWNFWnsvVZmbP/98y30R3e+cOwKnpA9Ha81xJJ a55uanI437JNgHwWyoOtdmV6gDDMttcdFCA1CVLY7k4OGcio6JNMyXOlXQwWw3jFCf i/tpaZqYygbOIxPiznzVZ/mSkmB23cCGh48s1qi4H0kPCjku2lwutpsqH1/ZSwdQnB qVtkpFmjrlSdIMH6FZOpzBKgO1q/w9clr0f3qRbIZ1JKP4Biq+L4fBVZsaVbVBJlBE mCHXrMx7XQVng== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] kbuild: make 'scripts' depend on 'prepare0' Date: Fri, 23 Nov 2018 13:51:26 +0900 Message-Id: <1542948687-7326-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Before start descending, Kbuild needs to run 'prepare' and 'scripts', which were orthogonal to each other prior to this commit. Let's consider 'scripts' is a part of the preparation. This will allow more cleanups. Move 'scripts' to the prerequisite of 'prepare0', which starts compiling target *.c files. Signed-off-by: Masahiro Yamada --- Makefile | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 36f3f0e..cee4cec 100644 --- a/Makefile +++ b/Makefile @@ -1062,7 +1062,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; # Error messages still appears in the original language PHONY += $(vmlinux-dirs) -$(vmlinux-dirs): prepare scripts +$(vmlinux-dirs): prepare $(Q)$(MAKE) $(build)=$@ need-builtin=1 define filechk_kernel.release @@ -1114,7 +1114,7 @@ macroprepare: prepare1 archmacros archprepare: archheaders archscripts macroprepare scripts_basic -prepare0: archprepare gcc-plugins +prepare0: scripts archprepare gcc-plugins $(Q)$(MAKE) $(build)=scripts/mod $(Q)$(MAKE) $(build)=. @@ -1286,7 +1286,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) # Target to prepare building external modules PHONY += modules_prepare -modules_prepare: prepare scripts +modules_prepare: prepare # Target to install modules PHONY += modules_install @@ -1604,11 +1604,9 @@ help: @echo ' clean - remove generated files in module directory only' @echo '' -# Dummies... -PHONY += prepare scripts +PHONY += prepare prepare: $(cmd_crmodverdir) -scripts: ; endif # KBUILD_EXTMOD clean: $(clean-dirs) @@ -1712,33 +1710,33 @@ else target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) endif -%.s: %.c prepare scripts FORCE +%.s: %.c prepare FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.i: %.c prepare scripts FORCE +%.i: %.c prepare FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.o: %.c prepare scripts FORCE +%.o: %.c prepare FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.lst: %.c prepare scripts FORCE +%.lst: %.c prepare FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.s: %.S prepare scripts FORCE +%.s: %.S prepare FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.o: %.S prepare scripts FORCE +%.o: %.S prepare FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.symtypes: %.c prepare scripts FORCE +%.symtypes: %.c prepare FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.ll: %.c prepare scripts FORCE +%.ll: %.c prepare FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) # Modules -/: prepare scripts FORCE +/: prepare FORCE $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) # Make sure the latest headers are built for Documentation Documentation/ samples/: headers_install -%/: prepare scripts FORCE +%/: prepare FORCE $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) -%.ko: prepare scripts FORCE +%.ko: prepare FORCE $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) $(@:.ko=.o) $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost From patchwork Fri Nov 23 04:51:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 151831 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1599531ljp; Thu, 22 Nov 2018 20:52:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/VzeY4RRy+AyTlvf+HJTtCxh9HYuEy7JI5e3uOsfVaBkysDrLP5rnfzzwKNHEGmh7L8JM3y X-Received: by 2002:a65:58ca:: with SMTP id e10mr11620659pgu.99.1542948748475; Thu, 22 Nov 2018 20:52:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542948748; cv=none; d=google.com; s=arc-20160816; b=aqhNKRM+G7FgaplKrSyglxh4r95n4+Z4LqpNdtGX7avP0YgrNghZhSYVtOYidmU8od 0UgF9QAuQ8b8TCadEQHMD1ur8NZjy9lES5Ow5kG4AfixVIy3HNJqkpg7oDvVkeVVCKN/ scrFRSmswE5fNOx4kf3MaFagz1DxwBN4dG73b5SWEtzCe3cU2UeLJS9dm8GNkocKZcz/ HkqDpUYfJPKFbcU+Xo12AwoCaXZBtdz9GNnlXfT5yCIqs0+FvIqtbLPhK1Cn980uTTGU fkWt1aU2N/vMCH62VKpb9GcgRn24VZT9vAmQ/uA7ZJO/Ur9vmNJlepnNW2uCPsMzH6jG wZiQ== 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=aM+gs7PxzxzFrVNFpMVUiiP1VJPNQgasYQmq9JMtCZg=; b=EDG0wjT39Bs3r4RI8Wno1r97gVgVb7moUv2T5XP7yCVTkTr1PhblJf1wYegXLBsdVz zF/fW/WU13VtArHOIjZGJRumvCBDzO0VMV/Egt74CnKG2G+jVpd/waSB5aiAhGucdiFm D1ouXdb9i/eaDJUZ+vAPBg0fFDp48g2biTgTyRvpvwgR8GvuMhsMY8lpDWBMHBX2v3z7 Da2HGN0TbRycJ4GAAaaxMiYqeJltK9rZHzC4EdPAJ7YfruFzirjtHMk3w4CvVopR6sXA EsNchqzQVAwTRHgu6/JDYZSzA7dXg3wJKrhY9aHTIrUTVJJpM4SXJiX3F3AF3a21m0C0 0Phg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Rw30CJTF; 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 i72-v6si49564859pfj.276.2018.11.22.20.52.28; Thu, 22 Nov 2018 20:52:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Rw30CJTF; 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 S2408147AbeKWPe6 (ORCPT + 32 others); Fri, 23 Nov 2018 10:34:58 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:49080 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730451AbeKWPe6 (ORCPT ); Fri, 23 Nov 2018 10:34:58 -0500 Received: from grover.tkatk1.zaq.ne.jp (zaqdadce369.zaq.ne.jp [218.220.227.105]) (authenticated) by conuserg-10.nifty.com with ESMTP id wAN4pTNN020182; Fri, 23 Nov 2018 13:51:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com wAN4pTNN020182 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1542948690; bh=aM+gs7PxzxzFrVNFpMVUiiP1VJPNQgasYQmq9JMtCZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rw30CJTFv99+lViRfCG0ocwdgtzNxGnGp8/vroShy90ESFV1aC1PbJJ4b3SVAw2Zl RdDJg7YVOF+TefhDlP1c1GEGpvO+V/Q7bua6eqfTE1H4xllbQPv1KlySExqGut2N4p o2tzYC4b7Bc5nIPdM8regrT0FfGmOE+DpchSymnBGc1Uh+Y7UO7aL026s29jIVjKGM lj754hl5yV1bwbWlQ63N9ClUPnCzO/n51gHIHggTQVrqAaOwjO2TGrWHl1sr0YDFQk DkIr9KUGzamPza0T1bzYBECgH0RO0hFafUY8pe0erkv1GrKzJG7CDejJhsst5ZRNbB MagAlnZ4mxEjA== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , kernel-hardening@lists.openwall.com, Kees Cook , linux-kernel@vger.kernel.org, Michal Marek , Emese Revfy Subject: [PATCH 2/2] kbuild: descend into scripts/gcc-plugins/ via scripts/Makefile Date: Fri, 23 Nov 2018 13:51:27 +0900 Message-Id: <1542948687-7326-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542948687-7326-1-git-send-email-yamada.masahiro@socionext.com> References: <1542948687-7326-1-git-send-email-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 'prepare0' depends on 'scripts', building GCC plugins can go into scripts/Makefile, which is a more standard way. Signed-off-by: Masahiro Yamada --- Makefile | 2 +- scripts/Makefile | 3 ++- scripts/Makefile.gcc-plugins | 8 -------- 3 files changed, 3 insertions(+), 10 deletions(-) -- 2.7.4 Reviewed-by: Kees Cook diff --git a/Makefile b/Makefile index cee4cec..a8bbe68 100644 --- a/Makefile +++ b/Makefile @@ -1114,7 +1114,7 @@ macroprepare: prepare1 archmacros archprepare: archheaders archscripts macroprepare scripts_basic -prepare0: scripts archprepare gcc-plugins +prepare0: scripts archprepare $(Q)$(MAKE) $(build)=scripts/mod $(Q)$(MAKE) $(build)=. diff --git a/scripts/Makefile b/scripts/Makefile index b48259d..feb1f71 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -36,9 +36,10 @@ PHONY += build_unifdef build_unifdef: $(obj)/unifdef @: +subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins subdir-$(CONFIG_MODVERSIONS) += genksyms subdir-$(CONFIG_SECURITY_SELINUX) += selinux subdir-$(CONFIG_GDB_SCRIPTS) += gdb # Let clean descend into subdirs -subdir- += basic dtc kconfig mod package gcc-plugins +subdir- += basic dtc kconfig mod package diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins index 46c5c68..c36f199 100644 --- a/scripts/Makefile.gcc-plugins +++ b/scripts/Makefile.gcc-plugins @@ -49,11 +49,3 @@ KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS) # All enabled GCC plugins are collected here for building below. GCC_PLUGIN := $(gcc-plugin-y) export GCC_PLUGIN - -# Actually do the build, if requested. -PHONY += gcc-plugins -gcc-plugins: scripts_basic -ifdef CONFIG_GCC_PLUGINS - $(Q)$(MAKE) $(build)=scripts/gcc-plugins -endif - @: