Skip to content

Conversation

@philnik777
Copy link
Contributor

iOS doesn't provide a libstdc++ dylib anymore, so we can remove the compatiblity check whether we can load the dylib.

@philnik777 philnik777 force-pushed the refstring_remove_ios_libstdcxx_compat branch from 14c9899 to cc98916 Compare December 5, 2025 08:52
@ldionne ldionne marked this pull request as ready for review December 8, 2025 16:20
@ldionne ldionne requested a review from a team as a code owner December 8, 2025 16:20
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Dec 8, 2025
@llvmbot
Copy link
Member

llvmbot commented Dec 8, 2025

@llvm/pr-subscribers-libcxx

Author: Nikolas Klauser (philnik777)

Changes

iOS doesn't provide a libstdc++ dylib anymore, so we can remove the compatiblity check whether we can load the dylib.


Full diff: https://github.com/llvm/llvm-project/pull/170816.diff

1 Files Affected:

  • (modified) libcxx/src/include/refstring.h (+2-2)
diff --git a/libcxx/src/include/refstring.h b/libcxx/src/include/refstring.h
index 3e0ec7a97c7be..1c73c60f9ced1 100644
--- a/libcxx/src/include/refstring.h
+++ b/libcxx/src/include/refstring.h
@@ -15,7 +15,7 @@
 #include <cstring>
 #include <stdexcept>
 
-// MacOS and iOS used to ship with libstdc++, and still support old applications
+// MacOS 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__) || defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
 #  define _LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE
 #  include <dlfcn.h>
 #  include <mach-o/dyld.h>

Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on prior research when discussing #166344, I believe this is fine to do. There shouldn't be iOs apps shipping with libstdc++ anymore since that dylib is not provided on the system.

We can have a separate patch/discussion for macOS, where the situation is different.

@philnik777 philnik777 merged commit b2ddb90 into llvm:main Dec 9, 2025
83 checks passed
@philnik777 philnik777 deleted the refstring_remove_ios_libstdcxx_compat branch December 9, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants