Kernel-hardening archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] gcc-plugins: Enable error message print
@ 2019-08-13  9:44 zhe.he
  2019-08-13 15:00 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: zhe.he @ 2019-08-13  9:44 UTC (permalink / raw)
  To: keescook, re.emese, kernel-hardening, linux-kernel, zhe.he

From: He Zhe <zhe.he@windriver.com>

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 <zhe.he@windriver.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gcc-plugins: Enable error message print
  2019-08-13  9:44 [PATCH] gcc-plugins: Enable error message print zhe.he
@ 2019-08-13 15:00 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2019-08-13 15:00 UTC (permalink / raw)
  To: zhe.he
  Cc: re.emese, kernel-hardening, linux-kernel, Masahiro Yamada, linux-kbuild

On Tue, Aug 13, 2019 at 05:44:49PM +0800, zhe.he@windriver.com wrote:
> From: He Zhe <zhe.he@windriver.com>
> 
> 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 <zhe.he@windriver.com>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13  9:44 [PATCH] gcc-plugins: Enable error message print zhe.he
2019-08-13 15:00 ` Kees Cook

Kernel-hardening archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernel-hardening/0 kernel-hardening/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernel-hardening kernel-hardening/ https://lore.kernel.org/kernel-hardening \
		kernel-hardening@lists.openwall.com kernel-hardening@archiver.kernel.org
	public-inbox-index kernel-hardening


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/com.openwall.lists.kernel-hardening


AGPL code for this site: git clone https://public-inbox.org/ public-inbox