From ffd6682a8b35b8582d5ae3ead88f9b94f4a1d75a Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 4 Aug 2018 08:25:09 +0100 Subject: [PATCH] No need to define BOOST_NO_CXX11_THREAD_LOCAL for recent libc++ versions on Linux. Fixes https://github.com/boostorg/config/issues/231. --- include/boost/config/stdlib/libcpp.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/boost/config/stdlib/libcpp.hpp b/include/boost/config/stdlib/libcpp.hpp index a051dbb7..9b450550 100644 --- a/include/boost/config/stdlib/libcpp.hpp +++ b/include/boost/config/stdlib/libcpp.hpp @@ -111,10 +111,16 @@ # define BOOST_NO_CXX11_THREAD_LOCAL #endif -#if defined(__linux__) && !defined(BOOST_NO_CXX11_THREAD_LOCAL) +#if defined(__linux__) && (_LIBCPP_VERSION < 4000) && !defined(BOOST_NO_CXX11_THREAD_LOCAL) // After libc++-dev is installed on Trusty, clang++-libc++ almost works, // except uses of `thread_local` fail with undefined reference to // `__cxa_thread_atexit`. +// +// clang's libc++abi provides an implementation by deferring to the glibc +// implementation, which may or may not be available (it is not on Trusty). +// clang 4's libc++abi will provide an implementation if one is not in glibc +// though, so thread local support should work with clang 4 and above as long +// as libc++abi is linked in. # define BOOST_NO_CXX11_THREAD_LOCAL #endif