I get the following compile error on Mac OS X, deployment target set to 10.5 and using the (default) Apple LLVM 4.2 compiler in Xcode 4.6.2:
ld: targeted OS version does not support use of thread local variables in __ZNK4juce16ThreadLocalValueIPNS_6ThreadEE3getEv for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thread local variables are controlled using this code in juce_ThreadLocalValue.h:
// (NB: on win32, native thread-locals aren't possible in a dynamically loaded DLL in XP).
#if ! ((JUCE_MSVC && (JUCE_64BIT || ! defined (JucePlugin_PluginCode))) \
|| (JUCE_MAC && JUCE_CLANG && defined (MAC_OS_X_VERSION_10_7) \
&& MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7))
#define JUCE_NO_COMPILER_THREAD_LOCAL 1
It seems for the above combination this does not correctly set JUCE_NO_COMPILER_THREAD_LOCAL to 1. Not sure how to fix this preprocessor statement correctly but if I force JUCE_NO_COMPILER_THREAD_LOCAL to 1 everything compiles fine.