llvm-project/clang/lib/Basic
Ulrich Weigand b038a5268f [SystemZ] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros
Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_[1248] macros on SystemZ.

This fixes a miscompile of GCC C++11 standard library headers
due to use of those macros in an ABI-changing manner.

See e.g. /usr/include/c++/4.8.5/ext/concurrence.h:

  // Compile time constant that indicates prefered locking policy in
  // the current configuration.
  static const _Lock_policy __default_lock_policy =
#ifdef __GTHREADS
#if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) \
     && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4))
  _S_atomic;
#else
  _S_mutex;
#endif
#else
  _S_single;
#endif

A different choice of __default_lock_policy causes different
sizes of several of the C++11 data structures, which are then
incompatible when inlined in clang-compiled code with what the
(GCC-compiled) external library expects.

This in turn leads to various crashes when using std::thread
in code compiled with clang, as see e.g. via the ThreadPool
unit tests.  See PR 26473 for an example.

llvm-svn: 259931
2016-02-05 21:34:28 +00:00
..
Attributes.cpp Ignore the "novtable" declspec when not using the Microsoft C++ ABI. 2015-07-20 22:57:31 +00:00
Builtins.cpp Recommit: R258773 [OpenCL] Pipe builtin functions 2016-01-26 04:03:48 +00:00
CMakeLists.txt Add `-verify-ignore-unexpected` option to ignore unexpected diagnostics in VerifyDiagnosticsConsumer 2015-06-13 07:11:40 +00:00
CharInfo.cpp CharInfo: Add missing "using namespace clang::charinfo" in .cpp file. 2013-02-08 22:37:49 +00:00
Diagnostic.cpp [Diagnostics] Call setMapping on the correct diagnostic states in a few places. GetCurDiagState() was being used when it shouldn't be. 2015-11-26 05:51:54 +00:00
DiagnosticIDs.cpp Add an unnecessary makeArrayRef I add earlier. I didn't realize range-based for loops worked with arrays. 2015-10-18 05:29:23 +00:00
DiagnosticOptions.cpp Add `-verify-ignore-unexpected` option to ignore unexpected diagnostics in VerifyDiagnosticsConsumer 2015-06-13 07:11:40 +00:00
FileManager.cpp Remove the egregious PCHContainer layering hack that doesn't seem to be necessary anymore. 2016-02-01 13:22:39 +00:00
FileSystemStatCache.cpp [cleanup] Remove some unused #ifdef's 2015-06-11 23:34:13 +00:00
IdentifierTable.cpp [modules] Separately track whether an identifier's preprocessor information and 2016-02-05 19:03:40 +00:00
LangOptions.cpp [Driver] Add support for -fno-builtin-foo options. 2016-01-06 14:35:46 +00:00
Module.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
ObjCRuntime.cpp Watch and TV OS: wire up basic ABI choices 2015-10-30 16:30:36 +00:00
OpenMPKinds.cpp [OpenMP] Parsing + sema for target parallel for directive. 2016-02-03 15:46:42 +00:00
OperatorPrecedence.cpp [OpenCL] Adding reserved operator logical xor for OpenCL 2016-02-03 15:17:14 +00:00
SanitizerBlacklist.cpp Replace double-negated !SourceLocation.isInvalid() with SourceLocation.isValid(). 2015-10-03 05:15:57 +00:00
Sanitizers.cpp Pull trivial SanitizerSet methods into the header. 2015-07-14 15:34:19 +00:00
SourceLocation.cpp Removing spurious semi colons; NFC. 2015-06-09 12:04:17 +00:00
SourceManager.cpp Fix isBeforeInTranslationUnit to not abort on macros defined in cmdline. 2016-01-28 09:28:18 +00:00
TargetInfo.cpp Do not honor explicit alignment attribute on fields for PS4. 2016-02-05 20:50:02 +00:00
Targets.cpp [SystemZ] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros 2016-02-05 21:34:28 +00:00
TokenKinds.cpp [C++11] Use 'nullptr'. 2014-05-08 06:41:40 +00:00
Version.cpp Revert r223578, perf data collection depends on the old symbol name. 2014-12-10 23:49:03 +00:00
VersionTuple.cpp MS ABI: Implement driver-level support for thread-safe statics 2015-03-22 08:39:22 +00:00
VirtualFileSystem.cpp [vfs] Normalize working directory if requested. 2016-01-09 16:33:16 +00:00
Warnings.cpp Use -Rblah, not -Wblah, to control remark diagnostics. This was always the 2014-08-07 00:24:21 +00:00