Bug ID: 30441
           Summary: Different symbols export with g++ and clang
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Object
    Classification: Unclassified

Created attachment 17310

Trying to rebuild the Debian archive using clang 3.8, I noticed a recurrent
issue (not new).
clang exports some different symbols than gcc when generating object files (and

As many Debian packages export and compare symbol list to follow API/ABI
changes in libraries, this is breaking the builds of the packages as they
detect a change in the libraries (which should probably be ignored).

For example, on the attached testcase, the Debian system will failing with:
--- debian/libzen0v5.symbols (libzen0v5_0.4.33-3_amd64)
+++ dpkg-gensymbolsV5S5js    2016-09-19 15:27:16.501781071 +0200
@@ -1,5 +1,7 @@ libzen0v5 #MINVER#
- (c++)"ZenLib::ZtringListList::~ZtringListList()@Base" 0.4.23
+#MISSING: 0.4.33-3# (c++)"ZenLib::ZtringListList::~ZtringListList()@Base"
  (c++)"ZenLib::ZtringListListF::ZtringListListF()@Base" 0.4.23
  (c++)"ZenLib::ZtringListListF::bar()@Base" 0.4.23
  (c++)"ZenLib::ZtringListListF::foo()@Base" 0.4.23
+ _ZN6ZenLib14ZtringListList9push_backEPKw@Base 0.4.33-3

Full log:

With the testcase (sorry, this can be probably shorter)
clang++    -g -O2    -o testcase.cpp.clang.o -c testcase.cpp 
g++     -g -O2    -o testcase.cpp.gcc.o -c testcase.cpp 
nm testcase.cpp.gcc.o > gcc.out
nm testcase.cpp.clang.o > clang.out
diff -u gcc.out clang.out 

--- gcc.out    2016-09-19 15:38:56.235948300 +0200
+++ clang.out    2016-09-19 15:39:02.428002875 +0200
@@ -1,12 +1,17 @@
+0000000000000000 r GCC_except_table2
+0000000000000020 r GCC_except_table3
                  U __gxx_personality_v0
                  U _Unwind_Resume
                  U wcslen
                  U wmemcpy
                  U _ZdlPv
+0000000000000000 W _ZN6ZenLib14ZtringListList9push_backEPKw
                  U _ZN6ZenLib14ZtringListList9push_backERKNS_6ZtringE
                  U _ZN6ZenLib14ZtringListListC2Ev
 0000000000000000 T _ZN6ZenLib15ZtringListListF3barEv
 0000000000000020 T _ZN6ZenLib15ZtringListListF3fooEv
 0000000000000010 T _ZN6ZenLib15ZtringListListFC1Ev
 0000000000000010 T _ZN6ZenLib15ZtringListListFC2Ev
+0000000000000000 W
+                 U _ZSt19__throw_logic_errorPKc

I am not sure why push_back shows in the clang list and why the destructor is

I am getting the same issue with clang 3.9 or 4.0.

In order to improve the compatiblity with gcc, we should probably fix that.

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to