diff options
author | Dmitrij D. Czarkoff <czarkoff@gmail.com> | 2016-10-20 16:51:21 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-10-20 17:51:57 +0200 |
commit | ee2ba599e7b0aa002dc7257458c19bdb64fd6252 (patch) | |
tree | fe5aa113d758a2d57e72505e11a723a7f6cfebfd /wscript | |
parent | 26458419a79339a186028cb26d842f3b9fa9eb23 (diff) | |
download | mpv-ee2ba599e7b0aa002dc7257458c19bdb64fd6252.tar.bz2 mpv-ee2ba599e7b0aa002dc7257458c19bdb64fd6252.tar.xz |
build: don't rely on "__thread" being always available with GCC
Thread-local storage in GCC is platform-specific, and some platforms that
are otherwise perfectly capable of running mpv may lack TLS support in GCC.
This change adds a test for GCC variant of TLS and relies on its result
instead of assumption.
Provided that LLVM's `__thread` support is similar to GCC, the test is
called "GCC/LLVM TLS".
Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -186,6 +186,10 @@ main_dependencies = [ 'desc': 'C11 TLS support', 'func': check_statement('stddef.h', 'static _Thread_local int x = 0'), }, { + 'name': 'gcc-tls', + 'desc': 'GCC TLS support', + 'func': check_statement('stddef.h', 'static __thread int x = 0'), + }, { 'name': 'librt', 'desc': 'linking with -lrt', 'deps': [ 'pthreads' ], |