Received: by 10.192.165.156 with SMTP id m28csp900468imm; Wed, 11 Apr 2018 08:59:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx48oGoz8y5qwd03Ucn1iOHIwZWSQksTg7ZzmPRfxi8mWHhafp3Q1PMSFXVuGfjKBs9alMu5l X-Received: by 10.101.68.68 with SMTP id e4mr3911413pgq.421.1523462398093; Wed, 11 Apr 2018 08:59:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523462398; cv=none; d=google.com; s=arc-20160816; b=ZkTkxSnDaD4hBeWD2UTfWnHcmfa0owWZBxv5LoOIBNaqsS/9LzuaAqp0E8LL41k69v K7eAPkxllNQzRTzVAi2qP3rb4uSa+NFRjabDBvSKX61msQQtRQC0evrn+MlR6RLxSrCU YJtWwUTudp91iMU4HYTV/Qe38Ote9GpzDgFdZqi9t7ZU58iFGzBFYG3bwWPGcooGaLNm /KwOV+813KDu3G/ZQjYVxrTw4ZctzPav9miIs1ni3z1E8Cz8cyka+uDqB2V11QkRVDiJ U6tsiGL+xZMEaKQwq1wrrqzMVuww2ckSmvJeoLacTGm0EV6OpSjgt5XrsxvVwXTPaeXZ Zpag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=boqVQ0fR/sunlCscYVt+naWYRu/09vo6eQOZEDRCPJw=; b=PlvYbdCJUVadCIlT+T0lU/tPojVHPIxK3qeyJRQSiMz3BRZHAC/yDfRn/d6Ef9g5Cs gQFnYDrY4M0BW1ZYrA1S74TpCXNxwEj5yO8oOGSWdxO9c+mySO7jPDEHzI2KmNNC8x/v PZhjFmy2W32ziGiEVOnXvQ2861Nc3iQCZDAY/dD0hwQTfwqHOgezLeJ646svs7F7thm4 qClFgcXv9psa0Zbmr+1z1HotABG4nuZu26foLzobgWxjjxtkDdbLIFfo7ZXiUA9D+5JW q0yQp86Tj10LADSXTrc6aSopT5m9Ip9K8bC5HT5MCslxGhCBCVF08gV1hVeQPvkbn0WM 8IJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=wliRaM8M; 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 d6si826786pgn.48.2018.04.11.08.59.15; Wed, 11 Apr 2018 08:59: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 header.s=dec2015msa header.b=wliRaM8M; 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 S1753597AbeDKP4C (ORCPT + 99 others); Wed, 11 Apr 2018 11:56:02 -0400 Received: from conssluserg-03.nifty.com ([210.131.2.82]:45471 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753402AbeDKP4A (ORCPT ); Wed, 11 Apr 2018 11:56:00 -0400 Received: from mail-ua0-f169.google.com (mail-ua0-f169.google.com [209.85.217.169]) (authenticated) by conssluserg-03.nifty.com with ESMTP id w3BFtldR011532; Thu, 12 Apr 2018 00:55:47 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com w3BFtldR011532 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1523462148; bh=boqVQ0fR/sunlCscYVt+naWYRu/09vo6eQOZEDRCPJw=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=wliRaM8MXDkYGES3SAKSyYirlG2e+Ru2euxno05LyMHSj7tyQKCcsCnfHSIf9j2sB tBEC6/QzCuqqh8Twdhn5tTcR2RLkq6wfZmXaJLzb98yT9/380FLs51DzbnCfIo8Ww+ hyH5aAxrqtCQ3lvitbNenqoK1Lk69kTSs8rzXxA7YD8sdy2V2tfdIfqsslR0g4p2Tp gvCPR6XxroVHdVV7mQt0c5Pegmzb4FbAghhK7zam7kC/RlFJXOIvxWHZSQxrQrzxuY vyH+8xX627AfLccsaRUGaA+yYrKuUhxFD9mTUKhu12mO3MWWSKmljpvs06nOnzY4xT DY18J+pV4LrwA== X-Nifty-SrcIP: [209.85.217.169] Received: by mail-ua0-f169.google.com with SMTP id q26so1477052uab.0; Wed, 11 Apr 2018 08:55:47 -0700 (PDT) X-Gm-Message-State: ALQs6tBXhde0rnxVsIxfXnilVmne4JK9cZc9oh6b4u+H4/4QXerOrTso 3NvIvfmIForLxIkcpC1rnKLUdXTb02GlRpfyzLk= X-Received: by 10.159.58.238 with SMTP id q46mr3702486uag.52.1523462146262; Wed, 11 Apr 2018 08:55:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.29.150 with HTTP; Wed, 11 Apr 2018 08:55:05 -0700 (PDT) In-Reply-To: References: <1522128575-5326-1-git-send-email-yamada.masahiro@socionext.com> <1522128575-5326-20-git-send-email-yamada.masahiro@socionext.com> From: Masahiro Yamada Date: Thu, 12 Apr 2018 00:55:05 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 19/21] gcc-plugins: test GCC plugin support in Kconfig To: Kees Cook Cc: linux-kbuild , Sam Ravnborg , Linus Torvalds , Arnd Bergmann , Ulf Magnusson , Thomas Gleixner , Greg Kroah-Hartman , Randy Dunlap , "Luis R . Rodriguez" , Nicolas Pitre , LKML , Kernel Hardening , Emese Revfy Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-03-28 20:44 GMT+09:00 Kees Cook : > On Mon, Mar 26, 2018 at 10:29 PM, Masahiro Yamada > wrote: >> Run scripts/gcc-plugin.sh from Kconfig. Users can enable GCC_PLUGINS >> only when it is supported. >> >> Signed-off-by: Masahiro Yamada >> --- >> >> Changes in v2: None >> >> arch/Kconfig | 4 +++ >> scripts/Makefile.gcc-plugins | 82 ++++++++++++++++---------------------------- >> scripts/gcc-plugin.sh | 1 - >> 3 files changed, 33 insertions(+), 54 deletions(-) >> >> diff --git a/arch/Kconfig b/arch/Kconfig >> index b42378d..88cc925 100644 >> --- a/arch/Kconfig >> +++ b/arch/Kconfig >> @@ -407,9 +407,13 @@ config HAVE_GCC_PLUGINS >> An arch should select this symbol if it supports building with >> GCC plugins. >> >> +config CC_HAS_GCC_PLUGINS >> + bool >> + > > This doesn't seem used anywhere? > >> menuconfig GCC_PLUGINS >> bool "GCC plugins" >> depends on HAVE_GCC_PLUGINS >> + depends on $(success $srctree/scripts/gcc-plugin.sh $HOSTCXX $CC) >> depends on !COMPILE_TEST >> help >> GCC plugins are loadable modules that provide extra features to the >> diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins >> index 25da4c0..19d0d5b 100644 >> --- a/scripts/Makefile.gcc-plugins >> +++ b/scripts/Makefile.gcc-plugins >> [...] >> -# If plugins aren't supported, abort the build before hard-to-read compiler >> -# errors start getting spewed by the main build. >> -PHONY += gcc-plugins-check >> -gcc-plugins-check: FORCE >> -ifdef CONFIG_GCC_PLUGINS >> - ifeq ($(PLUGINCC),) >> - ifneq ($(GCC_PLUGINS_CFLAGS),) >> - $(Q)$(srctree)/scripts/gcc-plugin.sh --show-error $(HOSTCXX) $(CC) || true >> - @echo "Cannot use CONFIG_GCC_PLUGINS: your gcc installation does not support plugins, perhaps the necessary headers are missing?" >&2 && exit 1 > > As mentioned in the other email, we lose the error reporting. Now the > lack of plugins is just a silent =n in menuconfig. This is the right thing to do. Features unsupported by the compiler should be silently disable. > Keeping > --show-error in the Kconfig call and retaining stderr would be nice. No. There is no problem to use a compiler without plugin support. If a user does not want to use plugin in the first place, why does he/she need to be bothered by such information in stderr? > I need to do some further testing with SANCOV, but otherwise this all > looks correct, and my testing shows it behaving correctly. > > -Kees > > -- > Kees Cook > Pixel Security > -- > To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Best Regards Masahiro Yamada