[Buildroot] [PATCH] package/liblog4c-localtime: fix build with GCC 15.x

Thomas Perale thomas.perale at mind.be
Mon Sep 8 10:55:54 UTC 2025


In reply of:
> Add simple patch, submitted upstream, to fix the build with GCC 15.x:
> 
> userloc_formatter.c: In function 'userloc_format':
> userloc_formatter.c:30:5: error: implicit declaration of function 'sd_debug' [-Wimplicit-function-declaration]
>    30 |     sd_debug("Formatter s13_userloc checking location info for userdata %X",a_event->evt_loc->loc_data);
>       |     ^~~~~~~~
> make[4]: *** [Makefile:519: userloc_formatter.lo] Error 1
> 
> Fixes:
> 
>   https://autobuild.buildroot.org/results/dab64025e6a1688d5fadc2b9bd3738a2c886aa9c/
> 
> Considering the level of upstream maintenance, we did hesitate with
> dropping the package, but as the fix was quite simple, we did the fix
> instead.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>

Applied to 2025.02.x & 2025.05.x. Thanks

> ---
>  ...c_formatter.c-drop-usage-of-sd_debug.patch | 42 +++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100644 package/liblog4c-localtime/0006-examples-userloc_formatter.c-drop-usage-of-sd_debug.patch
> 
> diff --git a/package/liblog4c-localtime/0006-examples-userloc_formatter.c-drop-usage-of-sd_debug.patch b/package/liblog4c-localtime/0006-examples-userloc_formatter.c-drop-usage-of-sd_debug.patch
> new file mode 100644
> index 0000000000..8f54d1d6fd
> --- /dev/null
> +++ b/package/liblog4c-localtime/0006-examples-userloc_formatter.c-drop-usage-of-sd_debug.patch
> @@ -0,0 +1,42 @@
> +From 1dfc4a60ebf96766b682c464ae69c453ce15105a Mon Sep 17 00:00:00 2001
> +From: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
> +Date: Tue, 19 Aug 2025 20:04:09 +0200
> +Subject: [PATCH] examples/userloc_formatter.c: drop usage of sd_debug()
> +
> +With recent compilers, log4c-localtime fails to build with:
> +
> +userloc_formatter.c: In function 'userloc_format':
> +userloc_formatter.c:30:5: error: implicit declaration of function 'sd_debug' [-Wimplicit-function-declaration]
> +   30 |     sd_debug("Formatter s13_userloc checking location info for userdata %X",a_event->evt_loc->loc_data);
> +      |     ^~~~~~~~
> +make[4]: *** [Makefile:519: userloc_formatter.lo] Error 1
> +
> +This function seems to be an internal function of the log4c-localtime
> +library, and is not used by any other example application. Since it's
> +only used to print some debugging information, we simply get rid of
> +the problematic code.
> +
> +Upstream: https://github.com/rcmadruga/log4c-localtime/pull/2
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
> +---
> + examples/userloc_formatter.c | 2 --
> + 1 file changed, 2 deletions(-)
> +
> +diff --git a/examples/userloc_formatter.c b/examples/userloc_formatter.c
> +index 4299a48..7bcf0e9 100644
> +--- a/examples/userloc_formatter.c
> ++++ b/examples/userloc_formatter.c
> +@@ -27,10 +27,8 @@ static const char* userloc_format(
> +     static char buffer[4096];
> +     user_locinfo_t* uloc = NULL;
> + 
> +-    sd_debug("Formatter s13_userloc checking location info for userdata %X",a_event->evt_loc->loc_data);
> +     if (a_event->evt_loc->loc_data != NULL)
> +     {
> +-	sd_debug("Formatter s13_userloc getting a valid user location info pointer");
> +         uloc = (user_locinfo_t*) a_event->evt_loc->loc_data;
> +         sprintf(buffer, "[%s][HOST:%s][PID:%i][FILE:%s][LINE:%i][MSG:%s]",
> + 		a_event->evt_category,  
> +-- 
> +2.50.1
> +
> -- 
> 2.50.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot


More information about the buildroot mailing list