From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20CBB199938; Sat, 3 May 2025 17:25:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746293160; cv=none; b=FtaIvkjdx9xjreN+YPU7zI9M6U5ym4ELRClpDBL2oQxh9bMJ4Xwb6vlO12QVUzVeFM3WntOet+qKQCjdpyunB1QiVAbfnq5gtsAEkOJBhAMbrAQI3vXi1OrYVCw3JvAc9I77IrRBWxG8RVJjsVWRww8CkZegMVmbgeuXO3lwV2o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746293160; c=relaxed/simple; bh=1aNojnjh6f9aU4lE8/vPeP3Xp57U1BRGOjwQrSWxDeU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UVcm6yOzoIvfRIg/ph+NSMIesC7pM9tiDHvKcJk5kdPGyQWgBAyutxd9yW30jVnP3q81YIA4gczhOWO53kb8watZcK7rM3hlBkYJhcdaDnn05xlLXSIM9Drr/ECa4aHKj/1X6cf9yRJwrVP+1XzN2XPgjtJtiJiRDXxNU7X2WZM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JdNJhVm6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JdNJhVm6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80E39C4CEE3; Sat, 3 May 2025 17:25:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746293159; bh=1aNojnjh6f9aU4lE8/vPeP3Xp57U1BRGOjwQrSWxDeU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JdNJhVm6jdIKAVlpABA8UMGIS8+VUrbTFo5CUu7dgwPhmWSYSYKfXJKKXj4K1S2g7 Uqs08o5DPnzAMA6R1xzjtUyDfs1gcOUs3kv6HcIjJAdxMxc8dcCY0hw29/r1F5V7mG rDbTnKkslrFMEGYI8UeS5XgghGCc6pBWGbU5fmuz0Z1XUXDlxKLX6UqEC3p69eDtGg QW7dcHB1Rs6aCsi9DHe8nImjWWi0OjTYSzTLxXRyERcHCshNiCU/b/zFaFQQ6hHXrt 5xgtnE6RDWzSaroCCZIUkb0w+na1w4fZhxnVxN1n5cnlTx/cwi1qLQuG/5t14gupN5 tGHSIclpEysNw== Date: Sat, 3 May 2025 10:25:57 -0700 From: Kees Cook To: Masahiro Yamada Cc: Nathan Chancellor , Nicolas Schier , linux-hardening@vger.kernel.org, linux-kbuild@vger.kernel.org, Petr Pavlu , Sebastian Andrzej Siewior , Justin Stitt , Marco Elver , Andrey Konovalov , Andrey Ryabinin , Richard Weinberger , Anton Ivanov , Johannes Berg , 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 Message-ID: <202505031023.BC44DC842@keescook> References: <20250502224512.it.706-kees@kernel.org> <20250502225416.708936-1-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sat, May 03, 2025 at 03:12:23PM +0900, Masahiro Yamada wrote: > On Sat, May 3, 2025 at 7:54 AM Kees Cook 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