summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Derek Mauro <761129+derekmauro@users.noreply.github.com>2024-01-22 12:59:25 -0500
committerGravatar GitHub <noreply@github.com>2024-01-22 12:59:25 -0500
commit4a2c63365eff8823a5221db86ef490e828306f9d (patch)
tree62589478f86ac8e05ab28e0dd5cfb67353c5597d
parentad73c6dc1a253203c1c8b529cda18f2138d49df0 (diff)
Disable ABSL_ATTRIBUTE_TRIVIAL_ABI in open-source builds (#1606)20240116.rc220240116.0
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
-rw-r--r--absl/base/attributes.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/absl/base/attributes.h b/absl/base/attributes.h
index f21dcb3c..d4f67a12 100644
--- a/absl/base/attributes.h
+++ b/absl/base/attributes.h
@@ -843,15 +843,11 @@
// See also the upstream documentation:
// https://clang.llvm.org/docs/AttributeReference.html#trivial-abi
//
-#if ABSL_HAVE_CPP_ATTRIBUTE(clang::trivial_abi)
-#define ABSL_ATTRIBUTE_TRIVIAL_ABI [[clang::trivial_abi]]
-#define ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI 1
-#elif ABSL_HAVE_ATTRIBUTE(trivial_abi)
-#define ABSL_ATTRIBUTE_TRIVIAL_ABI __attribute__((trivial_abi))
-#define ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI 1
-#else
+// b/321691395 - This is currently disabled in open-source builds since
+// compiler support differs. If system libraries compiled with GCC are mixed
+// with libraries compiled with Clang, types will have different ideas about
+// their ABI, leading to hard to debug crashes.
#define ABSL_ATTRIBUTE_TRIVIAL_ABI
-#endif
// ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS
//