From ee2ba599e7b0aa002dc7257458c19bdb64fd6252 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Thu, 20 Oct 2016 16:51:21 +0200 Subject: 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 --- wscript | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'wscript') diff --git a/wscript b/wscript index ccdf3a9fdc..9fa00b01f0 100644 --- a/wscript +++ b/wscript @@ -185,6 +185,10 @@ main_dependencies = [ 'name': 'c11-tls', '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', -- cgit v1.2.3