Skip to content

thread_local is completely broken on WASI SDK 31 #610

Description

@whitequark

Reproducer:

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)

The likely cause is a regression in libcxxabi in LLVM 22 caused by this commit: llvm/llvm-project@3c100d5#diff-dbd1a25cfceec4576394ed83e2d85cdf7108370b5132f5911a2c074d67ef216cR109. I assume this was a mistake or a misunderstanding since the commit seems like it was meant as an "NFC" one...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions