aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Mauro <dmauro@google.com>2024-01-22 08:38:07 -0800
committerCopybara-Service <copybara-worker@google.com>2024-01-22 08:38:53 -0800
commitb21b4898f9f4b967d5faa27f3e090535c4de1422 (patch)
tree699e4d001091b991e14e5e4da80f7ab3947e7ad2
parent2be67701e7a33b45d322064349827e1155953338 (diff)
downloadabseil-b21b4898f9f4b967d5faa27f3e090535c4de1422.tar.gz
abseil-b21b4898f9f4b967d5faa27f3e090535c4de1422.tar.bz2
abseil-b21b4898f9f4b967d5faa27f3e090535c4de1422.zip
Disable ABSL_ATTRIBUTE_TRIVIAL_ABI in open-source builds
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 Change-Id: I5729e54d34176d019a2dee9afc36ed9da1da10fa
-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
//