Skip to content

Commit 4a2c633

Browse files
authored
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
1 parent ad73c6d commit 4a2c633

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

absl/base/attributes.h

+4-8
Original file line numberDiff line numberDiff line change
@@ -843,15 +843,11 @@
843843
// See also the upstream documentation:
844844
// https://clang.llvm.org/docs/AttributeReference.html#trivial-abi
845845
//
846-
#if ABSL_HAVE_CPP_ATTRIBUTE(clang::trivial_abi)
847-
#define ABSL_ATTRIBUTE_TRIVIAL_ABI [[clang::trivial_abi]]
848-
#define ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI 1
849-
#elif ABSL_HAVE_ATTRIBUTE(trivial_abi)
850-
#define ABSL_ATTRIBUTE_TRIVIAL_ABI __attribute__((trivial_abi))
851-
#define ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI 1
852-
#else
846+
// b/321691395 - This is currently disabled in open-source builds since
847+
// compiler support differs. If system libraries compiled with GCC are mixed
848+
// with libraries compiled with Clang, types will have different ideas about
849+
// their ABI, leading to hard to debug crashes.
853850
#define ABSL_ATTRIBUTE_TRIVIAL_ABI
854-
#endif
855851

856852
// ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS
857853
//

0 commit comments

Comments
 (0)