llvm-libc declares the GNU strerror_r, which returns the string, when
_GNU_SOURCE is defined, as glibc does.

--- a/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/posix/safe_strerror.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/posix/safe_strerror.cc
@@ -18,7 +18,7 @@
 
 namespace partition_alloc::internal::base {
 
-#if defined(__GLIBC__)
+#if defined(__GLIBC__) || (defined(__LLVM_LIBC__) && defined(_GNU_SOURCE))
 #define USE_HISTORICAL_STRERROR_R 1
 // Post-L versions of bionic define the GNU-specific strerror_r if _GNU_SOURCE
 // is defined, but the symbol is renamed to __gnu_strerror_r which only exists
--- a/base/posix/safe_strerror.cc
+++ b/base/posix/safe_strerror.cc
@@ -18,7 +18,7 @@
 
 namespace base {
 
-#if defined(__GLIBC__)
+#if defined(__GLIBC__) || (defined(__LLVM_LIBC__) && defined(_GNU_SOURCE))
 #define USE_HISTORICAL_STRERROR_R 1
 // Post-L versions of bionic define the GNU-specific strerror_r if _GNU_SOURCE
 // is defined, but the symbol is renamed to __gnu_strerror_r which only exists
