[PATCH] D34212: docs: Document binary compatibility issue due to bug in gcc

Tom Stellard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 14 10:26:03 PDT 2017

tstellar created this revision.

Reported in PR33161.



Index: docs/BinaryCompatibilityWithOtherCompilers.rst
--- /dev/null
+++ docs/BinaryCompatibilityWithOtherCompilers.rst
@@ -0,0 +1,39 @@
+Binary compatibility with other compilers
+This document describes some of the known binary compatibility problems
+when mixing object files built by clang with object files built by
+other compilers.
+If you run into a compatibility issue, please file a bug at bugs.llvm.org.
+gcc C++ ABI bug with variadic templates
+Older versions of gcc incorrectly mangle variadic class/function templates,
+which can lead to undefined symbol errors when linking gcc built objects
+with clang built objects.
+gcc does emit the correct symbol name as an alias for the incorrect one,
+so libraries built by gcc are not affected by this bug.  You can only
+hit this bug if you have a library built by clang and you try to link
+against it with a gcc built object that uses a variadic class/function
+template from the library.
+* Use gcc 5.1.0 or newer.
+* Pass the -fabi-version=6 option to gcc when using versions < 5.1.0.
+gcc bug report:
+llvm bug report:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34212.102570.patch
Type: text/x-patch
Size: 1465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170614/c73fb66a/attachment.bin>

More information about the cfe-commits mailing list