From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A7E9C32750 for ; Tue, 13 Aug 2019 15:00:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1A9C420844 for ; Tue, 13 Aug 2019 15:00:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="HfdlKLK7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729888AbfHMPAz (ORCPT ); Tue, 13 Aug 2019 11:00:55 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:34403 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729424AbfHMPAz (ORCPT ); Tue, 13 Aug 2019 11:00:55 -0400 Received: by mail-pg1-f196.google.com with SMTP id n9so45177351pgc.1 for ; Tue, 13 Aug 2019 08:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Dl4zVREy4GL+zTPrnysS4JlC3AXp76Unucw3J+BxEXY=; b=HfdlKLK7w5ckYWTiIAzA/VwjXyExjaFSKoh7zzeDJPrIWm6F5UJ3581EHNU4Zr+p/p LKtfzmYDqbq8e9GirSLRDUTaIGLRyk//tHb+E/npw4iLXU48CvIEHVjQdaTYHZKekBiB tzmV0Kwef9RmZK+5l0x0sOexOKP018DtqrLJk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Dl4zVREy4GL+zTPrnysS4JlC3AXp76Unucw3J+BxEXY=; b=jBXeYO2+dV4m38zZb1G9PZ4rzMii3ifo5i9XJNpdDZ4AHA/8UlP3WxsMIsNNJJJvD2 jAgVqMMFT/ha6CCt+AQRGkQLuduwdOKRY/xQbZfdvTsZ+kRcfQ18hotg0kFnGTkfSgC4 km2bws28ABxrVMLzOAteQm81vxQ9NupCkvzSy+CQPL6SBvuOgJ33JVucQk8oxGFPWrcm BiqoC2B4z4aRuDnpBkOYsiym21oBK0ChKRZEEu2e8LMOxC+XgGFhDd96jIrnOR5zCVHV g3ttp9/Z/O5LdOyq8Q+k2gtW8+yUS/YLN3YvwU7biKhl7K53N8m18TU3be7EXfqVHc0v bF2g== X-Gm-Message-State: APjAAAXHkDxYPXp57CYg8laervq7ObYEjSFjzVnHl+Yvru2ioI4xi652 Lfz4Vgym0TYvS0Yql6kvA1S5UQ== X-Google-Smtp-Source: APXvYqxUaIs7z51V78IT1RtONuWfId/F36pH8j+pzIUb1yCPTkEy3q7fsBAIl1Cp3wlvwc3MDZRv/A== X-Received: by 2002:a17:90a:9f46:: with SMTP id q6mr2558368pjv.110.1565708454954; Tue, 13 Aug 2019 08:00:54 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j15sm107632196pfr.146.2019.08.13.08.00.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Aug 2019 08:00:54 -0700 (PDT) Date: Tue, 13 Aug 2019 08:00:53 -0700 From: Kees Cook To: zhe.he@windriver.com Cc: re.emese@gmail.com, kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, Masahiro Yamada , linux-kbuild@vger.kernel.org Subject: Re: [PATCH] gcc-plugins: Enable error message print Message-ID: <201908130755.A44C39B46@keescook> References: <1565689489-309136-1-git-send-email-zhe.he@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1565689489-309136-1-git-send-email-zhe.he@windriver.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 13, 2019 at 05:44:49PM +0800, zhe.he@windriver.com wrote: > From: He Zhe > > Instead of sliently emptying CONFIG_PLUGIN_HOSTCC which is the dependency > of a series of configurations, the following error message would be easier > for users to find something is wrong and what is happening. > > scripts/gcc-plugins/gcc-common.h:5:22: fatal error: bversion.h: > No such file or directory > compilation terminated. > > Now that we have already got the error message switch, let's turn it on. > > Signed-off-by: He Zhe Hi! Yeah, this would be helpful, but unfortunately it would be very noisy for many people who don't have the GCC plugins installed. It used to print error messages when it was a selectable Kconfig option but now that it is autodetected, we can't show the errors unconditionally. I would love to have some kind of way to answer the question "why isn't this option available?" in Kconfig. The best place for this might be in the menuconfig search option, but I'm not sure how to wire up other things like it. -Kees > --- > scripts/gcc-plugins/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/gcc-plugins/Kconfig b/scripts/gcc-plugins/Kconfig > index d33de0b..fe28cb9 100644 > --- a/scripts/gcc-plugins/Kconfig > +++ b/scripts/gcc-plugins/Kconfig > @@ -3,7 +3,7 @@ preferred-plugin-hostcc := $(if-success,[ $(gcc-version) -ge 40800 ],$(HOSTCXX), > > config PLUGIN_HOSTCC > string > - default "$(shell,$(srctree)/scripts/gcc-plugin.sh "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" if CC_IS_GCC > + default "$(shell,$(srctree)/scripts/gcc-plugin.sh --show-error "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" if CC_IS_GCC > help > Host compiler used to build GCC plugins. This can be $(HOSTCXX), > $(HOSTCC), or a null string if GCC plugin is unsupported. > -- > 2.7.4 > -- Kees Cook