https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109091
Bug ID: 109091 Summary: AIX: thread_local is not being internally linked Product: gcc Version: 10.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: miladfarca at gmail dot com Target Milestone: --- Sample: 0.cc ``` void check(); namespace { thread_local int num = 0; } int main(){ num = 5; check(); return 0; } ``` 1.cc ``` #include <iostream> namespace { thread_local int num = 0; } void check(){ std::cout << num << std::endl; } ``` Compile with g++ -lpthread 0.cc 1.cc and run. Expected output: 0 Output on AIX: 5