Linux Hardening
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nicolas.schier@linux.dev>,
	linux-hardening@vger.kernel.org, linux-kbuild@vger.kernel.org,
	Petr Pavlu <petr.pavlu@suse.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Justin Stitt <justinstitt@google.com>,
	Marco Elver <elver@google.com>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com,
	linux-um@lists.infradead.org
Subject: Re: [PATCH v2 1/3] gcc-plugins: Force full rebuild when plugins change
Date: Sat, 3 May 2025 10:25:57 -0700	[thread overview]
Message-ID: <202505031023.BC44DC842@keescook> (raw)
In-Reply-To: <CAK7LNATs4uHnNHgESXcUEjpONZra=GvkuHMaDwsx0hbyUGY99w@mail.gmail.com>

On Sat, May 03, 2025 at 03:12:23PM +0900, Masahiro Yamada wrote:
> On Sat, May 3, 2025 at 7:54 AM Kees Cook <kees@kernel.org> wrote:
> > +quiet_cmd_gcc_plugins_updated = UPDATE  $@
> > +      cmd_gcc_plugins_updated = echo '/* $^ */' > $(obj)/gcc-plugins-deps.h
> 
> I think 'touch' should be enough.
> 
> If some plugins are disabled, it is detected by the normal if_changed rule.

I kind of likely having the active plugins show up in there, but yes,
"touch" is enough (it's what I started with originally).

> > +$(obj)/gcc-plugins-deps.h: $(plugin-single) $(plugin-multi) FORCE
> > +       $(call if_changed,gcc_plugins_updated)
> > +
> > +always-y += gcc-plugins-deps.h
> > --
> > 2.34.1
> >
> 
> 
> I think it is simpler to place the header
> in include/generated/.

I couldn't figure out how to do this, but thankfully you did! :)

> I attached my suggestion below:
> [...]
> -quiet_cmd_gcc_plugins_updated = UPDATE  $@
> -      cmd_gcc_plugins_updated = echo '/* $^ */' > $(obj)/gcc-plugins-deps.h
> +quiet_cmd_gcc_plugins_updated = TOUCH   $@
> +      cmd_gcc_plugins_updated = touch $@
> 
> -$(obj)/gcc-plugins-deps.h: $(plugin-single) $(plugin-multi) FORCE
> +$(obj)/../../include/generated/gcc-plugins-deps.h: $(plugin-single)
> $(plugin-multi) FORCE
>         $(call if_changed,gcc_plugins_updated)
> 
> -always-y += gcc-plugins-deps.h
> +always-y += ../../include/generated/gcc-plugins-deps.h

Aaagh, thank you! I didn't even consider trying ".." for targets!

Yes, this is SO much better! I will read your other replies and work on
v3...

-- 
Kees Cook

  reply	other threads:[~2025-05-03 17:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-02 22:54 [PATCH v2 0/3] Detect changed compiler dependencies for full rebuild Kees Cook
2025-05-02 22:54 ` [PATCH v2 1/3] gcc-plugins: Force full rebuild when plugins change Kees Cook
2025-05-03  6:12   ` Masahiro Yamada
2025-05-03 17:25     ` Kees Cook [this message]
2025-05-02 22:54 ` [PATCH v2 2/3] randstruct: Force full rebuild when seed changes Kees Cook
2025-05-03  6:13   ` Masahiro Yamada
2025-05-03 17:27     ` Kees Cook
2025-05-02 22:54 ` [PATCH v2 3/3] integer-wrap: Force full rebuild when .scl file changes Kees Cook
2025-05-03  9:39 ` [PATCH v2 0/3] Detect changed compiler dependencies for full rebuild Masahiro Yamada
2025-05-03 17:37   ` Kees Cook
2025-05-08 16:44     ` Masahiro Yamada
2025-05-08 16:56       ` Kees Cook
2025-05-08 23:13         ` Masahiro Yamada
2025-05-08 23:59           ` Kees Cook
2025-05-13 14:52             ` Masahiro Yamada

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=202505031023.BC44DC842@keescook \
    --to=kees@kernel.org \
    --cc=andreyknvl@gmail.com \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=bigeasy@linutronix.de \
    --cc=elver@google.com \
    --cc=johannes@sipsolutions.net \
    --cc=justinstitt@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas.schier@linux.dev \
    --cc=petr.pavlu@suse.com \
    --cc=richard@nod.at \
    --cc=ryabinin.a.a@gmail.com \
    /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