[libc++abi] Revert gating of __cxa_thread_atexit on Linux||Fuchsia#186054
[libc++abi] Revert gating of __cxa_thread_atexit on Linux||Fuchsia#186054whitequark wants to merge 1 commit intollvm:mainfrom
__cxa_thread_atexit on Linux||Fuchsia#186054Conversation
|
@llvm/pr-subscribers-libcxxabi Author: Catherine (whitequark) ChangesThis was done in the commit 3c100d5 with the description "Enable -Wmissing-prototypes" which seems incongruent to me. Since then it's made its way into a release and broke the use of // repro.cc
struct c { ~c() {} };
thread_local c v;
int main() { (void)v; }$ ./wasi-sdk-31.0-x86_64-linux/bin/clang++ repro.cc
wasm-ld: error: /tmp/repro-dd1ad7.o: undefined symbol: __cxa_thread_atexit
clang++: error: linker command failed with exit code 1 (use -v to see invocation)Full diff: https://github.com/llvm/llvm-project/pull/186054.diff 1 Files Affected:
diff --git a/libcxxabi/src/cxa_thread_atexit.cpp b/libcxxabi/src/cxa_thread_atexit.cpp
index 402a52c741012..370e76344e89c 100644
--- a/libcxxabi/src/cxa_thread_atexit.cpp
+++ b/libcxxabi/src/cxa_thread_atexit.cpp
@@ -106,7 +106,6 @@ namespace {
#endif // HAVE___CXA_THREAD_ATEXIT_IMPL
-#if defined(__linux__) || defined(__Fuchsia__)
extern "C" {
_LIBCXXABI_FUNC_VIS int __cxa_thread_atexit(Dtor dtor, void* obj, void* dso_symbol) throw() {
@@ -142,5 +141,4 @@ extern "C" {
#endif // HAVE___CXA_THREAD_ATEXIT_IMPL
}
} // extern "C"
-#endif // defined(__linux__) || defined(__Fuchsia__)
} // namespace __cxxabiv1
|
|
cc @philnik777; could you explain a bit more about the rationale for that |
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
d263f09 to
f71fdfc
Compare
Pulls in llvm/llvm-project#186054 and adds a regression test which previously failed. Closes WebAssembly#610
Pulls in llvm/llvm-project#186054 and adds a regression test which previously failed. Closes #610
ad2a084 to
1924b87
Compare
This was done in the commit 3c100d5 with the description "Enable -Wmissing-prototypes" which seems incongruent to me. Since then it's made its way into a release and broke the use of `thread_local` variables with destructors on Wasm/WASI: ```cc // repro.cc struct c { ~c() {} }; thread_local c v; int main() { (void)v; } ``` ```console $ ./wasi-sdk-31.0-x86_64-linux/bin/clang++ repro.cc wasm-ld: error: /tmp/repro-dd1ad7.o: undefined symbol: __cxa_thread_atexit clang++: error: linker command failed with exit code 1 (use -v to see invocation) ```
1924b87 to
a8cc009
Compare
|
FWIW (just trying to build clang 22 on a FreeBSD 10.2, whose stock clang is a 3.4.1…), I'm not really fond of the addition of every OS to the Following up my comment on #116261, I successfully built a full 22.1.2 ecosystem (llvm, clang, libc++, libc++abi, openmp, clang-rt, lld, lldb, flang, flang-rt), both on FreeBSD 10.2 and 15.0 by removing the
Thus the warning (that the CI errors) on non-Linux Unix platforms. So, with the example of my FreeBSD 10.2 and 15.0 sandboxes, wouldn't a cleaner solution be to |
|
My position is that right now an architecture is broken. We should fix that first and then discuss a cleaner solution later. |
|
@whitequark wrote:
I'm semi-agreeing with that: |
This was done in the commit 3c100d5 with the description "Enable -Wmissing-prototypes" which seems incongruent to me.
Since then it's made its way into a release and broke the use of
thread_localvariables with destructors on Wasm/WASI: