1- From f71fdfcbd6fcc7b521c74b5856ebeacdd6cf55d9 Mon Sep 17 00:00:00 2001
1+ From 46301f073b8cc85ad0d2f1dcdda923209bff173b Mon Sep 17 00:00:00 2001
22From: Catherine <whitequark@whitequark.org>
33Date: Thu, 12 Mar 2026 08:19:49 +0000
44Subject: [PATCH] [libc++abi] Revert gating of `__cxa_thread_atexit` on
5- Linux||Fuchsia
5+ Wasm/WASI
66
77This was done in the commit 3c100d5d548d with the description
88"Enable -Wmissing-prototypes" which seems incongruent to me.
@@ -23,26 +23,28 @@ wasm-ld: error: /tmp/repro-dd1ad7.o: undefined symbol: __cxa_thread_atexit
2323clang++: error: linker command failed with exit code 1 (use -v to see invocation)
2424```
2525---
26- libcxxabi/src/cxa_thread_atexit.cpp | 4 +- --
27- 1 file changed, 1 insertion (+), 3 deletions(-)
26+ libcxxabi/src/cxa_thread_atexit.cpp | 5 +++ --
27+ 1 file changed, 3 insertions (+), 2 deletions(-)
2828
2929diff --git a/libcxxabi/src/cxa_thread_atexit.cpp b/libcxxabi/src/cxa_thread_atexit.cpp
30- index 402a52c741012..1bdcb4ef192b4 100644
30+ index 402a52c741012..099be242c6dc6 100644
3131--- a/libcxxabi/src/cxa_thread_atexit.cpp
3232+++ b/libcxxabi/src/cxa_thread_atexit.cpp
33- @@ -106,7 +106,6 @@ namespace {
33+ @@ -106,7 +106,7 @@ namespace {
3434
3535 #endif // HAVE___CXA_THREAD_ATEXIT_IMPL
3636
3737- #if defined(__linux__) || defined(__Fuchsia__)
38+ + #if defined(__linux__) || defined(__Fuchsia__) || defined(__wasm__)
3839 extern "C" {
3940
4041 _LIBCXXABI_FUNC_VIS int __cxa_thread_atexit(Dtor dtor, void* obj, void* dso_symbol) throw() {
41- @@ -141,6 +140,5 @@ extern "C" {
42+ @@ -141,6 +141,7 @@ extern "C" {
4243 }
4344 #endif // HAVE___CXA_THREAD_ATEXIT_IMPL
4445 }
45- - } // extern "C"
46+ +
47+ } // extern "C"
4648- #endif // defined(__linux__) || defined(__Fuchsia__)
47- + } // extern "C"
49+ + #endif // defined(__linux__) || defined(__Fuchsia__) || defined(__wasm__)
4850 } // namespace __cxxabiv1
0 commit comments