[libcxx-commits] [libcxx] 5b3ac20 - Revert "[libc++] Don't try to be compatible with libstdc++ in __libcpp_refstring on iOS (#170816)" (#173099)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 20 01:50:19 PST 2025


Author: Louis Dionne
Date: 2025-12-20T10:50:15+01:00
New Revision: 5b3ac20fc07e1fac8b38b1fe702d9d36ea2af68e

URL: https://github.com/llvm/llvm-project/commit/5b3ac20fc07e1fac8b38b1fe702d9d36ea2af68e
DIFF: https://github.com/llvm/llvm-project/commit/5b3ac20fc07e1fac8b38b1fe702d9d36ea2af68e.diff

LOG: Revert "[libc++] Don't try to be compatible with libstdc++ in __libcpp_refstring on iOS (#170816)" (#173099)

This reverts commit b2ddb909cf. Sadly, I was wrong when I said that
Apple didn't ship libstdc++.dylib on iOS. We actually still do, it's
just not part of the shared cache, which is why I missed it.

Hence, it is still possible to encounter libstdc++.dylib in processes
running on iOS.

Added: 
    

Modified: 
    libcxx/src/include/refstring.h

Removed: 
    


################################################################################
diff  --git a/libcxx/src/include/refstring.h b/libcxx/src/include/refstring.h
index 1c73c60f9ced1..3e0ec7a97c7be 100644
--- a/libcxx/src/include/refstring.h
+++ b/libcxx/src/include/refstring.h
@@ -15,7 +15,7 @@
 #include <cstring>
 #include <stdexcept>
 
-// MacOS used to ship with libstdc++, and still support old applications
+// MacOS and iOS used to ship with libstdc++, and still support old applications
 // linking against libstdc++. The libc++ and libstdc++ exceptions are supposed
 // to be ABI compatible, such that they can be thrown from one library and caught
 // in the other.
@@ -25,7 +25,7 @@
 // string singleton before manipulating the reference count. This is done so that
 // if an exception is created with a zero-length string in libstdc++, libc++abi
 // won't try to delete the memory.
-#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
 #  define _LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE
 #  include <dlfcn.h>
 #  include <mach-o/dyld.h>


        


More information about the libcxx-commits mailing list