Commit 4a2c6336 by Derek Mauro Committed by GitHub

Disable ABSL_ATTRIBUTE_TRIVIAL_ABI in open-source builds (#1606)

Since compiler support for this attribute differs, if for example
system libraries compiled with GCC are mixed with libraries compiled
with Clang, types will have different ideas about their ABI.

PiperOrigin-RevId: 600467146
parent ad73c6dc
...@@ -843,15 +843,11 @@ ...@@ -843,15 +843,11 @@
// See also the upstream documentation: // See also the upstream documentation:
// https://clang.llvm.org/docs/AttributeReference.html#trivial-abi // https://clang.llvm.org/docs/AttributeReference.html#trivial-abi
// //
#if ABSL_HAVE_CPP_ATTRIBUTE(clang::trivial_abi) // b/321691395 - This is currently disabled in open-source builds since
#define ABSL_ATTRIBUTE_TRIVIAL_ABI [[clang::trivial_abi]] // compiler support differs. If system libraries compiled with GCC are mixed
#define ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI 1 // with libraries compiled with Clang, types will have different ideas about
#elif ABSL_HAVE_ATTRIBUTE(trivial_abi) // their ABI, leading to hard to debug crashes.
#define ABSL_ATTRIBUTE_TRIVIAL_ABI __attribute__((trivial_abi))
#define ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI 1
#else
#define ABSL_ATTRIBUTE_TRIVIAL_ABI #define ABSL_ATTRIBUTE_TRIVIAL_ABI
#endif
// ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS // ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS
// //
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment