mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] logo: spell out CONFIG_ options for fixdep
@ 2025-06-02  6:02 Ahmad Fatoum
  2025-06-02  7:47 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-06-02  6:02 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

To avoid rebuilding nearly the whole project when a header changes,
fixdep collects referenced CONFIG_ symbols in every file and prunes the
dependency list accordingly. This only works when we don't hide CONFIG_
symbols with preprocessor text substitution shenanigans.

logo.c does just that triggering a compile failure, when logos are
removed in config without touching the file. Spell out the config
symbols to fix this.

This is the only instance currently of /CONFIG_.*##/, so I believe we
don't have this bug elsewhere.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 lib/logo/logo.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/lib/logo/logo.c b/lib/logo/logo.c
index a64f489939eb..b8f7ae028e83 100644
--- a/lib/logo/logo.c
+++ b/lib/logo/logo.c
@@ -20,10 +20,8 @@
 	extern char __bblogo_barebox_logo_w##width##_start[];			\
 	extern char __bblogo_barebox_logo_w##width##_end[];			\
 										\
-	static void load_logo_##width(void)					\
+	static __maybe_unused void load_logo_##width(void)			\
 	{									\
-		if (!IS_ENABLED(CONFIG_BAREBOX_LOGO_##width))			\
-			return;							\
 		load_logo(width, __bblogo_barebox_logo_w##width##_start,	\
 				__bblogo_barebox_logo_w##width##_end);		\
 	}
@@ -60,11 +58,15 @@ static int logo_init(void)
 	if (ret)
 		return ret;
 
-	load_logo_64();
-	load_logo_240();
-	load_logo_320();
-	load_logo_400();
-	load_logo_640();
+	/*
+	 * fixdep depends on CONFIG_ symbols being listed in the file
+	 * as-is with no preprocessor magic involved
+	 */
+	IF_ENABLED(CONFIG_BAREBOX_LOGO_64,  load_logo_64());
+	IF_ENABLED(CONFIG_BAREBOX_LOGO_240, load_logo_240());
+	IF_ENABLED(CONFIG_BAREBOX_LOGO_320, load_logo_320());
+	IF_ENABLED(CONFIG_BAREBOX_LOGO_400, load_logo_400());
+	IF_ENABLED(CONFIG_BAREBOX_LOGO_640, load_logo_640());
 
 	return 0;
 }
-- 
2.39.5




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

* Re: [PATCH] logo: spell out CONFIG_ options for fixdep
  2025-06-02  6:02 [PATCH] logo: spell out CONFIG_ options for fixdep Ahmad Fatoum
@ 2025-06-02  7:47 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-06-02  7:47 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Mon, 02 Jun 2025 08:02:45 +0200, Ahmad Fatoum wrote:
> To avoid rebuilding nearly the whole project when a header changes,
> fixdep collects referenced CONFIG_ symbols in every file and prunes the
> dependency list accordingly. This only works when we don't hide CONFIG_
> symbols with preprocessor text substitution shenanigans.
> 
> logo.c does just that triggering a compile failure, when logos are
> removed in config without touching the file. Spell out the config
> symbols to fix this.
> 
> [...]

Applied, thanks!

[1/1] logo: spell out CONFIG_ options for fixdep
      https://git.pengutronix.de/cgit/barebox/commit/?id=dfd981b5808f (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2025-06-02  7:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-02  6:02 [PATCH] logo: spell out CONFIG_ options for fixdep Ahmad Fatoum
2025-06-02  7:47 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox