Hi,
While building elfutils on musl with different features enabled I hit this.
Curiously this also affects glibc if you explicitly build without optimizations.
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 <par...@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 <par...@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