public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kbuild@vger.kernel.org
Subject: Re: [PATCH 2/2] gcc-plugins: disable plugins when gmp.h is unavailable
Date: Tue, 12 Mar 2024 14:53:46 -0700	[thread overview]
Message-ID: <202403121452.701C91AF6E@keescook> (raw)
In-Reply-To: <20240312-gcc-plugins-gmp-v1-2-c5e082437b9e@linutronix.de>

On Tue, Mar 12, 2024 at 04:03:30PM +0100, Thomas Weißschuh wrote:
> The header gmp.h is meant to be picked up from the host system.
> 
> When it is unavailable the plugin build fails:
> 
> In file included from ../crosstools/gcc-13.2.0-nolibc/i386-linux/bin/../lib/gcc/i386-linux/13.2.0/plugin/include/gcc-plugin.h:28,
>                  from ../scripts/gcc-plugins/gcc-common.h:7,
>                  from ../scripts/gcc-plugins/stackleak_plugin.c:30:
> ../crosstools/gcc-13.2.0-nolibc/i386-linux/bin/../lib/gcc/i386-linux/13.2.0/plugin/include/system.h:703:10: fatal error: gmp.h: No such file or directory
>   703 | #include <gmp.h>
>       |          ^~~~~~~
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
>  scripts/gcc-plugins/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/gcc-plugins/Kconfig b/scripts/gcc-plugins/Kconfig
> index e383cda05367..a664fb5cdde5 100644
> --- a/scripts/gcc-plugins/Kconfig
> +++ b/scripts/gcc-plugins/Kconfig
> @@ -10,6 +10,7 @@ menuconfig GCC_PLUGINS
>  	depends on HAVE_GCC_PLUGINS
>  	depends on CC_IS_GCC
>  	depends on $(success,test -e $(shell,$(CC) -print-file-name=plugin)/include/plugin-version.h)
> +	depends on $(host-cc-option,-include gmp.h)

Why does the prior depends not fail? That's where plugin detection is
happening.

-- 
Kees Cook

  reply	other threads:[~2024-03-12 21:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 15:03 [PATCH 0/2] gcc-plugins: disable plugins when gmp.h is unavailable Thomas Weißschuh
2024-03-12 15:03 ` [PATCH 1/2] kbuild: add host-cc-option helper Thomas Weißschuh
2024-03-12 15:03 ` [PATCH 2/2] gcc-plugins: disable plugins when gmp.h is unavailable Thomas Weißschuh
2024-03-12 21:53   ` Kees Cook [this message]
2024-03-13  3:47     ` Masahiro Yamada
2024-03-13 14:42       ` Thomas Weißschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202403121452.701C91AF6E@keescook \
    --to=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox