Skip to content

Andersw88/thread_local_test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thread_local_test

Repoduces an issue with using thread_local in header only libraries when consumed by shared libraries and the main executable.

Build & Run:
mkdir build
cd build
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release
ninja all
./thread_local_test

Example output gcc (5.4.0 and 8.1):
static int* i; &i:0x7fe8d20ea738, i:(nil)
static int* i; &i:0x7fe8d20ea730, i:(nil)
static int* i; &i:0x7fe8d20ea738, i:0xb99030
static int* i; &i:0x7fe8d20ea730, i:0xb99050

Example output clang:
static int* i; &i:0x7f3352e3e738, i:(nil)
static int* i; &i:0x7f3352e3e738, i:0x2571030
static int* i; &i:0x7f3352e3e738, i:0x2571030
static int* i; &i:0x7f3352e3e738, i:0x2571030

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published