[libcxx-commits] [libcxx] [libc++] Check for _newlib_version.h instead of picolibc.h (PR #152766)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Aug 8 10:23:48 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: None (inglorion)
<details>
<summary>Changes</summary>
Fixes #<!-- -->152763.
https://github.com/llvm/llvm-project/pull/131921 added some code to pull in a definition of _NEWLIB_VERSION if it exists. It does this by checking __has_include(<picolibc.h>) and including it if so. However, this does not work for systems that have newlib rather than picolibc. This change instead checks for and includes _newlib_version.h, which should work for both newlib and picolibc.
---
Full diff: https://github.com/llvm/llvm-project/pull/152766.diff
1 Files Affected:
- (modified) libcxx/include/__configuration/platform.h (+2-2)
``````````diff
diff --git a/libcxx/include/__configuration/platform.h b/libcxx/include/__configuration/platform.h
index f3c199dee172b..c14089b5fc074 100644
--- a/libcxx/include/__configuration/platform.h
+++ b/libcxx/include/__configuration/platform.h
@@ -45,8 +45,8 @@
// This is required in order for _NEWLIB_VERSION to be defined in places where we use it.
// TODO: We shouldn't be including arbitrarily-named headers from libc++ since this can break valid
// user code. Move code paths that need _NEWLIB_VERSION to another customization mechanism.
-#if __has_include(<picolibc.h>)
-# include <picolibc.h>
+#if __has_include(<_newlib_version.h>)
+# include <_newlib_version.h>
#endif
#ifndef __BYTE_ORDER__
``````````
</details>
https://github.com/llvm/llvm-project/pull/152766
More information about the libcxx-commits
mailing list