From 758a3961b5703c4b737eb0b06f002016771f25b4 Mon Sep 17 00:00:00 2001 From: AustinBenoit Date: Tue, 30 Jun 2026 12:04:29 -0400 Subject: [PATCH 1/3] Add weak __libcpp_verbose_abort definition to app on iOS On older iOS versions (iOS 15 and 16), the system libc++.1.dylib does not contain the `std::__1::__libcpp_verbose_abort` symbol. Since we build the Firebase C++ SDK binaries using a newer Xcode version (which references this symbol for standard library assertions), apps linking our static libraries will crash at startup on these older OS versions with a "Symbol not found" dynamic linker error. To resolve this: - Added a weak definition of `__libcpp_verbose_abort` to `app/src/app_ios.mm` so it is packaged into `libfirebase_app.a` and statically resolved for any linking application. - Removed the now-redundant temporary workaround definition from `testing/sample_framework/src/app_framework.cc`. Fixes #1872 --- app/src/app_ios.mm | 30 +++++++++++++++++ testing/sample_framework/src/app_framework.cc | 32 +------------------ 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/app/src/app_ios.mm b/app/src/app_ios.mm index 36a2382fe3..2a55c957ef 100644 --- a/app/src/app_ios.mm +++ b/app/src/app_ios.mm @@ -30,6 +30,36 @@ #include "app/src/util.h" #include "app/src/util_ios.h" +#include +#include +#include + +// Workaround for Xcode 15+ / Swift 5.10+ Concurrency and C++ verbose abort +// crash on older iOS versions (iOS 15/16). +// By providing this symbol in our own binary, we prevent dyld from +// crashing when it is missing from the system libc++ on older OSs. +#if defined(_LIBCPP_VERBOSE_ABORT_NOEXCEPT) +#define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT _LIBCPP_VERBOSE_ABORT_NOEXCEPT +#elif defined(__apple_build_version__) && \ + __apple_build_version__ >= 16000000 && __apple_build_version__ < 20000000 +#define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT +#else +#define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT noexcept +#endif + +namespace std { +inline namespace __1 { +__attribute__((weak)) void __libcpp_verbose_abort(const char* format, ...) + FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT { + va_list list; + va_start(list, format); + vfprintf(stderr, format, list); + va_end(list); + abort(); +} +} // namespace __1 +} // namespace std + #include "FIROptions.h" @interface FIRApp () diff --git a/testing/sample_framework/src/app_framework.cc b/testing/sample_framework/src/app_framework.cc index 96c0a6b21c..a581c0a73c 100644 --- a/testing/sample_framework/src/app_framework.cc +++ b/testing/sample_framework/src/app_framework.cc @@ -26,37 +26,7 @@ #include #include -#if defined(__APPLE__) -#include -// Workaround for Xcode 15 / Swift 5.10 Concurrency and C++ verbose abort -// crash on older iOS versions (iOS 15/16). -// By providing these symbols in our own binary, we prevent dyld from -// crashing when they are missing from the system libraries on older OSs. - -// In Xcode 16, libc++ removed the noexcept specifier from -// __libcpp_verbose_abort. -#if defined(_LIBCPP_VERBOSE_ABORT_NOEXCEPT) -#define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT _LIBCPP_VERBOSE_ABORT_NOEXCEPT -#elif defined(__apple_build_version__) && \ - __apple_build_version__ >= 16000000 && __apple_build_version__ < 20000000 -#define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT -#else -#define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT noexcept -#endif - -namespace std { -inline namespace __1 { -__attribute__((weak)) void __libcpp_verbose_abort(const char* format, ...) - FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT { - va_list list; - va_start(list, format); - vfprintf(stderr, format, list); - va_end(list); - abort(); -} -} // namespace __1 -} // namespace std -#endif + namespace app_framework { From b44220583166853050e4bcabca8aed3903481a4e Mon Sep 17 00:00:00 2001 From: AustinBenoit Date: Tue, 30 Jun 2026 12:14:15 -0400 Subject: [PATCH 2/3] Add in release notes --- release_build_files/readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 62cfb27116..8846a4b9d8 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -613,6 +613,10 @@ workflow use only during the development of your app, not for publicly shipping code. ## Release Notes +### Upcoming +- Changes + - General (iOS): Fixed a startup crash on iOS 15 and 16 due to a missing `__libcpp_verbose_abort` symbol. + ### 13.9.0 - Changes - General (Android): Update to Firebase Android BoM version 34.15.0. From 81c2b7b2fecbb907cc341a673a04e7292602db7d Mon Sep 17 00:00:00 2001 From: AustinBenoit Date: Tue, 30 Jun 2026 12:46:19 -0400 Subject: [PATCH 3/3] Address code review comments on app_ios.mm --- app/src/app_ios.mm | 28 +++++++++++-------- testing/sample_framework/src/app_framework.cc | 2 -- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/src/app_ios.mm b/app/src/app_ios.mm index 2a55c957ef..653c0c2043 100644 --- a/app/src/app_ios.mm +++ b/app/src/app_ios.mm @@ -30,9 +30,9 @@ #include "app/src/util.h" #include "app/src/util_ios.h" -#include -#include -#include +#include +#include +#include // Workaround for Xcode 15+ / Swift 5.10+ Concurrency and C++ verbose abort // crash on older iOS versions (iOS 15/16). @@ -40,24 +40,28 @@ // crashing when it is missing from the system libc++ on older OSs. #if defined(_LIBCPP_VERBOSE_ABORT_NOEXCEPT) #define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT _LIBCPP_VERBOSE_ABORT_NOEXCEPT -#elif defined(__apple_build_version__) && \ - __apple_build_version__ >= 16000000 && __apple_build_version__ < 20000000 +#elif defined(__apple_build_version__) && __apple_build_version__ >= 16000000 && \ + __apple_build_version__ < 20000000 #define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT #else #define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT noexcept #endif +#ifndef _LIBCPP_ABI_NAMESPACE +#define _LIBCPP_ABI_NAMESPACE __1 +#endif + namespace std { -inline namespace __1 { -__attribute__((weak)) void __libcpp_verbose_abort(const char* format, ...) - FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT { - va_list list; +inline namespace _LIBCPP_ABI_NAMESPACE { +__attribute__((weak)) void __libcpp_verbose_abort(const char* format, + ...) FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT { + std::va_list list; va_start(list, format); - vfprintf(stderr, format, list); + std::vfprintf(stderr, format, list); va_end(list); - abort(); + std::abort(); } -} // namespace __1 +} // namespace _LIBCPP_ABI_NAMESPACE } // namespace std #include "FIROptions.h" diff --git a/testing/sample_framework/src/app_framework.cc b/testing/sample_framework/src/app_framework.cc index a581c0a73c..892eb917e0 100644 --- a/testing/sample_framework/src/app_framework.cc +++ b/testing/sample_framework/src/app_framework.cc @@ -26,8 +26,6 @@ #include #include - - namespace app_framework { // Base logging methods, implemented by platform-specific files.