From 65f29a73448564ad120168fbfd7f4e76ef63f4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 2 Oct 2026 04:16:43 +0200 Subject: [PATCH] libcxx: fix OpenBSD build failure due to missing __get_locale_encoding() https://github.com/llvm/llvm-project/pull/228306 --- lib/libcxx/include/__locale_dir/support/openbsd.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/libcxx/include/__locale_dir/support/openbsd.h b/lib/libcxx/include/__locale_dir/support/openbsd.h index 0ec5b12f2ebdde33772c303d0390d9f9dfa053f5..1fcae994b3aaef3e012397412b3ed8a5f49817fa 100644 --- a/lib/libcxx/include/__locale_dir/support/openbsd.h +++ b/lib/libcxx/include/__locale_dir/support/openbsd.h @@ -24,6 +24,9 @@ # include # include #endif +#if defined(_LIBCPP_BUILDING_LIBRARY) +# include +#endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -74,6 +77,10 @@ inline __lconv_t* __localeconv(__locale_t& __loc) { __locale_guard __current(__loc); return ::localeconv(); } + +inline _LIBCPP_HIDE_FROM_ABI const char* __get_locale_encoding(__locale_t __loc) { + return ::nl_langinfo_l(CODESET, __loc); +} #endif // _LIBCPP_BUILDING_LIBRARY // -- 2.54.0