[PATCH] stacktrace: Add missing locale.h
Mark Wielaard
mark@klomp.org
Thu Jan 30 10:59:48 GMT 2025
Hi,
On Thu, Jan 30, 2025 at 12:05:59AM +0000, parona wrote:
> While building elfutils on musl with different features enabled I
> hit this.
>
> Curiously this also affects glibc if you explicitly build without
> optimizations.
Could you show the configure/build flags and the error the compiler
gives? I think the patch is correct, but I have trouble replicating
the issue.
Thanks,
Mark
> I didn't observe any explicit order with the headers, so I just added it after the rest.
> From 4a11af08aea00cbe6362e82a14010ca3ea5fa9e7 Mon Sep 17 00:00:00 2001
> From: Alfred Wingate <parona@protonmail.com>
> Date: Wed, 29 Jan 2025 10:06:22 +0200
> Subject: [PATCH] stacktrace: Add missing locale.h
>
> The missing header is only obvious on musl and on glibc when you don't
> have optimizations enabled.
>
> Normally the header would transitively come from config.h -> ./lib/eu-config.h
> -> glibc libintl.h. with __OPTIMIZE__.
>
> https://sourceware.org/git/?p=glibc.git;a=blob;f=intl/libintl.h;hb=HEAD#l103
>
> Signed-off-by: Alfred Wingate <parona@protonmail.com>
> ---
> src/stacktrace.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/stacktrace.c b/src/stacktrace.c
> index b912ca5d..d8699ce5 100644
> --- a/src/stacktrace.c
> +++ b/src/stacktrace.c
> @@ -77,6 +77,7 @@
> #include <string.h>
> #include <fcntl.h>
> #include <signal.h>
> +#include <locale.h>
>
> #include <system.h>
>
> --
> 2.48.1
>
More information about the Elfutils-devel
mailing list