From patchwork Thu Nov 29 03:56:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 152358 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1908297ljp; Wed, 28 Nov 2018 19:57:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/XbNDAOInNZK2LVJ2yS2GLiFqwIDMCgyB6wAXFAq3xoEl0dG9gqmcjR+htP5ri65we2a2WG X-Received: by 2002:a63:db02:: with SMTP id e2mr35902205pgg.419.1543463833610; Wed, 28 Nov 2018 19:57:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543463833; cv=none; d=google.com; s=arc-20160816; b=LRbkSOntamspDFV7+UZX61/sqQ7HSeh0KHUJ2/f5opd+/Aaiv5J/SsDs/golelLCMw k3NYmlOagP91OBgC02KWiE9G7/+7OIajwJ5xOza6s7frxFViZwdAhPLOgASEQ+N1uAmT pP2NWGfu48UiSUumTY4MYR2bUjqpDwY5rcnA5wHGxq1mND1PItl8BkVDvWDRaPk5nBqR xSAx8SQzEf4CIVqE1CI0QMypRR6enCKREvqDtEbiiRPlBnO3MMOPvUUOh9juyrVmo/4T gte0wwQIgyqhHWi8KnXVIMrrgArpVLposfmNTDwddo27E970vOHUaP4zkPYSPennF5Fk aXyQ== 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=C1hzWf0P6ycjbnjTosvtbL7ps9IpR2XwGwVlhQ054q0=; b=cPgx5iKN4xyDtWdIX3bKnr2pl3ta/bGzDRCPtjfmNRzKwJgcOaZRJEwoDoPmCBNqpd 6Tg+DDf8nlZZIuWezvKifQrEW5dqUfwkqE8Ty9pn7LhdBioZ8flFGubYpnCLUotPq6xI uSNz290q8J1qUpsnivbfT8lC2eDw/rJIs6tDtRInWPXTjhNN/y8P6AClyi+Ac/yEcnfq OVgG7FcI2wRvpYFkp1BxApNYahWy+k+7davtTq4cnNQ46UcVGgOErNxkS2sHd3wVOBh/ jFOhqMnn9wu+/xycbKdsWHHnun2GoS9PGeDxkR/8eN96vJFatK/zicUb3/h7mWAn9hF9 swZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=eqQBQSAj; 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 m5si747803pll.58.2018.11.28.19.57.13; Wed, 28 Nov 2018 19:57:13 -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=eqQBQSAj; 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 S1727526AbeK2PBH (ORCPT + 32 others); Thu, 29 Nov 2018 10:01:07 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:35511 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727098AbeK2PBG (ORCPT ); Thu, 29 Nov 2018 10:01:06 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id wAT3uW9g014059; Thu, 29 Nov 2018 12:56:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com wAT3uW9g014059 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1543463793; bh=C1hzWf0P6ycjbnjTosvtbL7ps9IpR2XwGwVlhQ054q0=; h=From:To:Cc:Subject:Date:From; b=eqQBQSAjitC5AfO7C+zE61yDjZWaDlKwP6obMEzDeqWN1c0PW5splXkW3rW8ivY9a YHCbKMaxnqTbLotRumMl2mHT58x3BDgBz7UwCVAkIZESBhV5CL49mbVdU341hVhKiU ALoIs+gsuXxdKbMftvJaPGSOfCMnqOCgVdBZswG/vb1aSn1U/VF6wGbzmhROz0pvmn NR2KitABK5NRDnJ1z9hXaGv3FZZVWc+0i6VL6LkF4aZMx/dTZzbodhxVbUh8UXn0EY Pu2Q3mE0Mf9nLQg0HhnNfaAq4e58Lg7ox5Oy2pyY1vrXGP7DkXpeAIelIP2mtN95T6 3P1raVRO6GanA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Kees Cook , Emese Revfy , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] kbuild: make 'archprepare' depend on 'scripts' Date: Thu, 29 Nov 2018 12:56:30 +0900 Message-Id: <1543463791-18391-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 has been orthogonal to each other. Going forward, let's consider 'scripts' is a part of the preparation. This will allow more cleanups. Move 'scripts' to the prerequisite of 'archprepare', where UML starts compiling target *.c files. Signed-off-by: Masahiro Yamada --- Changes in v2: - It turned out UML + CONFIG_GCC_PLUGINS is broken for a long time. https://patchwork.kernel.org/patch/10703853/ Rebased on the top of the fix-up Makefile | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index f7cc3ee..9eb3f4f 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 @@ -1112,7 +1112,7 @@ prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h macroprepare: prepare1 archmacros -archprepare: archheaders archscripts macroprepare scripts_basic gcc-plugins +archprepare: archheaders archscripts macroprepare scripts gcc-plugins prepare0: archprepare $(Q)$(MAKE) $(build)=scripts/mod @@ -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 Thu Nov 29 03:56:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 152359 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1908463ljp; Wed, 28 Nov 2018 19:57:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/X4ICcRYuN/MrlfCP9WoHuUUkpAzm5yFINjHktIw+ggqtwf9uLSoz7Dnp29mMaTEAZ22Tfv X-Received: by 2002:a63:eb52:: with SMTP id b18mr34734835pgk.213.1543463847545; Wed, 28 Nov 2018 19:57:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543463847; cv=none; d=google.com; s=arc-20160816; b=0rIXj52IndVpVnqOmpxDMXbGAkVww7KOCiFTWjgT9LHxPg4wc3o7yZeuNKRwvJ/QZ8 ziQz+gi/bs5Z37bRKr8ZIntB1u7r7N+8Tq5kNLYkgpwsLnT0sjW9gnqNrxCDizzqszO0 IL8HCZR31mtxacykzKMq5acvYbXoC/x083CQU/vaH6M6x1uyK0f3YNCxg/kHQdpuGTz8 7O3sFCEGk0j20iN0Tr/Q7yfFXSAcALfYi7AmS2xk/NTu9lPiFVvoIgI9dTlnFh/Urt7a 4Ik1ly9KVYizrJ2cE8TTArnc/TDMsahKYFlQSnw1bp+KHIWnn47rEwEnz2QWj9BedYBc fVcw== 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=jenL7MJF+aDHOcehc6CyDTxYWkvnIjepvb/UDlh5RcI=; b=ywZI7K5HFop+394kekMIlTBMSzzuJESo0XJLcxU81EQ/UCmAUBEyHY5BmM4996CBGE qWYD9KGppqxH8hEUSa4pH6u8RNBTozd3291P3jtIk6vjjlg+LzTLpzvVxd1gyfy4+VO0 FkwWzeQVvrN0F+p0M0m6p8+BPQrRtodOQwT9RL+zs5T6YcqPII2/NkDiseuXZ2JDRNcn ueCpveT7J1x7aON0i6u7guCyRHuPDDbctQ2UltNNFqTfsKGalkN0a2KEqJiYESqrCTke +fGRjYyrtW+zt7Y4I1ltN1+iYLBHFEw65bvKWXVCf5+PHMwma1/reF1L7TVuZnJHFSGQ y6gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Gls3K74h; 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 r11si818660pli.175.2018.11.28.19.57.27; Wed, 28 Nov 2018 19:57:27 -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=Gls3K74h; 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 S1727611AbeK2PBV (ORCPT + 32 others); Thu, 29 Nov 2018 10:01:21 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:35915 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727098AbeK2PBV (ORCPT ); Thu, 29 Nov 2018 10:01:21 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id wAT3uW9h014059; Thu, 29 Nov 2018 12:56:33 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com wAT3uW9h014059 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1543463793; bh=jenL7MJF+aDHOcehc6CyDTxYWkvnIjepvb/UDlh5RcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gls3K74hUYeFBajD/srbmUekOfwyf79oeV0RuqBsogpOgjktRfJpaUWgwNgonYyoY CCiyzQI3NL5MScs24puNrvOyWCDRl41gx1lEfKnraZdfRVOWt5FFmm/YanIbVELqsk bdV0d0HuhiU+pWf8d72e1mDNngFZ3QM2odfId5aYQ8j73eXQ5wpdxfe4YEXIOni4LZ iOc8xoZjLnd9sQ4je6ypicCfsx2Xd4rZQ0W2AwMGBdN0FRP9M3wmNfi4/uG6uDEiHm XY63uoosa+E3nrqR2mQptVbZQLvCFscp+T4iwb3biyM/GfYwo2s2yj24ygdDZBF3SR cHX1ElhOIX7Lg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Kees Cook , Emese Revfy , Masahiro Yamada , kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, Michal Marek Subject: [PATCH v2 2/2] kbuild: descend into scripts/gcc-plugins/ via scripts/Makefile Date: Thu, 29 Nov 2018 12:56:31 +0900 Message-Id: <1543463791-18391-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543463791-18391-1-git-send-email-yamada.masahiro@socionext.com> References: <1543463791-18391-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 'archprepare' depends on 'scripts', Kbuild can descend into scripts/gcc-plugins in a more standard way. Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook --- Changes in v2: - It turned out UML + CONFIG_GCC_PLUGINS is broken for a long time. https://patchwork.kernel.org/patch/10703853/ Rebased on the top of the fix-up Makefile | 2 +- scripts/Makefile | 3 ++- scripts/Makefile.gcc-plugins | 8 -------- 3 files changed, 3 insertions(+), 10 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 9eb3f4f..c1f87cf 100644 --- a/Makefile +++ b/Makefile @@ -1112,7 +1112,7 @@ prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h macroprepare: prepare1 archmacros -archprepare: archheaders archscripts macroprepare scripts gcc-plugins +archprepare: archheaders archscripts macroprepare scripts prepare0: archprepare $(Q)$(MAKE) $(build)=scripts/mod 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 - @: