-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[libcxx] Add locale support for llvm libc
#97508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-libcxx Author: Izaak Schroeder (izaakschroeder) Changes
Full diff: https://github.com/llvm/llvm-project/pull/97508.diff 3 Files Affected:
diff --git a/libcxx/include/__config b/libcxx/include/__config
index dfb14fd6a380c..f3dbb8079a1e8 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -914,7 +914,7 @@ typedef __char32_t char32_t;
# endif
# if defined(__BIONIC__) || defined(__NuttX__) || defined(__Fuchsia__) || defined(__wasi__) || \
- defined(_LIBCPP_HAS_MUSL_LIBC) || defined(__OpenBSD__)
+ defined(_LIBCPP_HAS_MUSL_LIBC) || defined(__OpenBSD__) || defined(__LLVM_LIBC__)
# define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
# endif
diff --git a/libcxx/include/locale b/libcxx/include/locale
index 19e81e110b69c..46318683b3cef 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -217,7 +217,7 @@ template <class charT> class messages_byname;
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
// Most unix variants have catopen. These are the specific ones that don't.
-# if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__)
+# if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__) && !defined(__LLVM_LIBC__)
# define _LIBCPP_HAS_CATOPEN 1
# include <nl_types.h>
# endif
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 4efdc63c09661..d114640ab7104 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -34,7 +34,7 @@
# define _CTYPE_DISABLE_MACROS
#endif
-#if !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__) && !defined(__BIONIC__) && !defined(__NuttX__)
+#if !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__) && !defined(__BIONIC__) && !defined(__NuttX__) && !defined(__LLVM_LIBC__)
# include <langinfo.h>
#endif
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
51d04ae to
2822982
Compare
|
Since we plan to have a CI for the LLVM libc and libc++, I'd rather first tackle that instead. As far as I'm aware the only way to get libc + libc++ actually working right now is with some hackery. |
|
@philnik777 |
There are a few configurations I'd like to have in the CI with the LLVM libc, but the main one is "whatever works". Just so we have a baseline of what's already working and a starting point from where to continue. Any other configurations would be primarily to better test the various configurations libc++ supports. |
@philnik777 Anything you want from me to help this along? The |
|
I think this can be closed since it has been landed in smaller bits. I do want Fuchsia to setup pre-commit CI bots since they are using LLVM libc and that's necessary for us to officially support that configuration, but I reached out to @petrhosek about that separately. |
This patch enables building libcxx with LIBCXX_ENABLE_LOCALIZATION=ON when building against LLVM libc. This finishes up llvm#97508.
libcxxcompanion to #97494 and #97191More or less adds
__LLVM_LIBC__in the same places as__Fuchsia__as fuchsia itself relies on parts of LLVMlibcthis seems like the most reasonable choice.