From patchwork Sat Apr 2 04:32:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 64913 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp169291lbc; Fri, 1 Apr 2016 21:32:58 -0700 (PDT) X-Received: by 10.66.146.39 with SMTP id sz7mr36606206pab.76.1459571578186; Fri, 01 Apr 2016 21:32:58 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si25013609pfa.186.2016.04.01.21.32.57; Fri, 01 Apr 2016 21:32:58 -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; 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 S1751615AbcDBEcz (ORCPT + 29 others); Sat, 2 Apr 2016 00:32:55 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:30911 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750715AbcDBEcx (ORCPT ); Sat, 2 Apr 2016 00:32:53 -0400 X-Greylist: delayed 148450 seconds by postgrey-1.27 at vger.kernel.org; Sat, 02 Apr 2016 00:32:53 EDT Received: from mail-yw0-f180.google.com (mail-yw0-f180.google.com [209.85.161.180]) (authenticated) by conssluserg-06.nifty.com with ESMTP id u324WeRd012729; Sat, 2 Apr 2016 13:32:41 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com u324WeRd012729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1459571561; bh=OPSYJv0hAz5G8as1UisCfstUWIeQnk8TOy0f9cLX9bI=; h=In-Reply-To:References:Date:Subject:From:To:Cc:From; b=q2iFG5HPTvrVMhnWJ6zc0yJgmBBq53Drfb26KobZCQzuYXnxi/ZOQLhVMngICZ5b2 jmMLcGcmMRALfiUqPKUO5jXMyPoDgHCbKlyr6JLiyJZAB4WLvwC62buDwstFUEOaGf 8TN9jNKGb8hgZRwovIQ676XKhDqjuWN4B1qEkZM9s9shoHEssff8utldNgjFV3TFTi 5GP0EiDb624pfA2/nJDUdZWq2lIAFAAzdGA1zcxtplQY9KtEoJ8Ofc4W4nlrt85FnK pC5Mtj+fBUO2SJ6yuCMk6q7sO7nP5kFORYa503bCRnGYYz2hoj0pBGWMV5U/6f8Psi YXJY/IvuAHPvQ== X-Nifty-SrcIP: [209.85.161.180] Received: by mail-yw0-f180.google.com with SMTP id g3so197510869ywa.3; Fri, 01 Apr 2016 21:32:41 -0700 (PDT) X-Gm-Message-State: AD7BkJJFjFl8ygebWFUvQfsB/WYnWbRXmIzj/L/Dj0+Dr6US2PBJDPcAfySccBO4u2+jodWbMF5c49/gbxZlOg== MIME-Version: 1.0 X-Received: by 10.37.12.195 with SMTP id 186mr13935609ybm.154.1459571560295; Fri, 01 Apr 2016 21:32:40 -0700 (PDT) Received: by 10.37.82.9 with HTTP; Fri, 1 Apr 2016 21:32:40 -0700 (PDT) In-Reply-To: <20160327230913.bbbd9951fddca197b9b13b23@gmail.com> References: <20160307000208.1bec3e7dc874489d1b4fcbb4@gmail.com> <20160307000427.c82f18670568e1e656fc9532@gmail.com> <20160324010749.f7e547e1df12b4944c5fa490@gmail.com> <20160327230913.bbbd9951fddca197b9b13b23@gmail.com> Date: Sat, 2 Apr 2016 13:32:40 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 2/5] GCC plugin infrastructure From: Masahiro Yamada To: Emese Revfy Cc: Linux Kbuild mailing list , pageexec@freemail.hu, spender@grsecurity.net, kernel-hardening@lists.openwall.com, Michal Marek , Kees Cook , Rasmus Villemoes , fengguang.wu@intel.com, Dmitry Vyukov , Linux Kernel Mailing List Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Emese, Sorry for my late reply. > Thanks for the patch. I tested it and there is a problem when I run a parallel make. > The plugins are compiled later than needed (e.g., scripts/mod/empty.o). There is a lot of important > code under scripts/mod which may need the plugins. Ah, I missed that. > If the plugins were compiled when the "scripts_basic" > target runs it would be good but unfortunately the config symbol CONFIG_GCC_PLUGINS doesn't seem to be defined yet. > Could you please help me solve this problem? How about this? It should apply on commit 0b005b886bde6c4b9134d01f830d88d464911a65 of your tree. -- Best Regards Masahiro Yamada diff --git a/Makefile b/Makefile index 1c7a379..d3518e0 100644 --- a/Makefile +++ b/Makefile @@ -550,7 +550,7 @@ ifeq ($(KBUILD_EXTMOD),) # in parallel PHONY += scripts scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \ - asm-generic + asm-generic gcc-plugins $(Q)$(MAKE) $(build)=$(@) # Objects we will link into vmlinux / subdirs we need to visit @@ -625,6 +625,13 @@ endif # Tell gcc to never replace conditional load with a non-conditional one KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) +PHONY += gcc-plugins +gcc-plugins: scripts_basic +ifdef CONFIG_GCC_PLUGINS + $(Q)$(MAKE) $(build)=scripts/gcc-plugins +endif + @: + include scripts/Makefile.gcc-plugins ifdef CONFIG_READABLE_ASM @@ -1008,7 +1015,7 @@ archprepare: archheaders archscripts prepare1 scripts_basic prepare0: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS) prepare0: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS) -prepare0: archprepare FORCE +prepare0: archprepare gcc-plugins FORCE $(Q)$(MAKE) $(build)=. # All the preparing.. diff --git a/scripts/Makefile b/scripts/Makefile index 0ba652c..1d80897 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -45,7 +45,6 @@ subdir-y += mod subdir-$(CONFIG_SECURITY_SELINUX) += selinux subdir-$(CONFIG_DTC) += dtc subdir-$(CONFIG_GDB_SCRIPTS) += gdb -subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins # Let clean descend into subdirs -subdir- += basic kconfig package +subdir- += basic kconfig package gcc-plugins