diff --git a/src/ndk/bionic_runtime.cpp b/src/ndk/bionic_runtime.cpp index e208a797..c5b6ff3b 100644 --- a/src/ndk/bionic_runtime.cpp +++ b/src/ndk/bionic_runtime.cpp @@ -4414,6 +4414,11 @@ static_assert(offsetof(DowncallBlock, depth) == 0 && // without a first-use check. thread_local DowncallBlock t_downcall_block; +// Outside the unnamed namespace: GCC up to 15 gives a variable declared +// `extern "C"` inside one internal linkage and a mangled name, and the +// assembly below, which names these by their C names, does not link. (Clang +// and GCC 16 use the C name there; functions get it from all of them.) +} // namespace extern "C" { // Read by acl_ndk_downcall_common, which cannot name what is in the anonymous // namespace: the distance from the glibc thread pointer to t_bionic_fs, to @@ -4432,6 +4437,7 @@ acl_ndk_downcall_overflow() { std::abort(); } } // extern "C" +namespace { #define ACL_NDK_STR2(x) #x #define ACL_NDK_STR(x) ACL_NDK_STR2(x)