From dcc919a7374cd0ea2a7587d092eee141f4bb4d41 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 13 Dec 2023 14:41:48 -0800 Subject: [PATCH 1/2] Opt into unstable libcxx ABI and add a custom namespace. We use a statically linked libcxx and don't expose any of the internal symbols. This theoretically allows us to namespace everything to avoid accidentally using the wrong version libcxx. Also, not having to worry about ABI stability allows libcxx to opt into optimized routines. But, since libcxx uses CMake and we don't, the mechanism to generate the __config_site file doesn't exist in GN. Instead, we check in a file that would have been generated for us by CMake. The file we check in though is a default with additional configuration. This version of the file makes it so that we opt into the unstable ABI (and get optimizations) and also namespace everything for Flutter so collisions are immediately flagged. --- build/secondary/third_party/libcxx/config/__config_site | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/secondary/third_party/libcxx/config/__config_site b/build/secondary/third_party/libcxx/config/__config_site index 106c24fc3613b..a1ff5099589d8 100644 --- a/build/secondary/third_party/libcxx/config/__config_site +++ b/build/secondary/third_party/libcxx/config/__config_site @@ -1,8 +1,9 @@ #ifndef _LIBCPP_CONFIG_SITE #define _LIBCPP_CONFIG_SITE -/* #undef _LIBCPP_ABI_VERSION */ -/* #undef _LIBCPP_ABI_UNSTABLE */ +#define _LIBCPP_ABI_VERSION 2 +#define _LIBCPP_ABI_NAMESPACE _fl + /* #undef _LIBCPP_ABI_FORCE_ITANIUM */ /* #undef _LIBCPP_ABI_FORCE_MICROSOFT */ /* #undef _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT */ From 2fda26a6529a997ead43f426760bf67d5fe669a0 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 14 Dec 2023 13:00:17 -0800 Subject: [PATCH 2/2] Set ABI version to 1 to see what happens. --- build/secondary/third_party/libcxx/config/__config_site | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/secondary/third_party/libcxx/config/__config_site b/build/secondary/third_party/libcxx/config/__config_site index a1ff5099589d8..e1a46ff65e409 100644 --- a/build/secondary/third_party/libcxx/config/__config_site +++ b/build/secondary/third_party/libcxx/config/__config_site @@ -1,7 +1,7 @@ #ifndef _LIBCPP_CONFIG_SITE #define _LIBCPP_CONFIG_SITE -#define _LIBCPP_ABI_VERSION 2 +#define _LIBCPP_ABI_VERSION 1 #define _LIBCPP_ABI_NAMESPACE _fl /* #undef _LIBCPP_ABI_FORCE_ITANIUM */