[llvm-bugs] [Bug 30441] New: Different symbols export with g++ and clang

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 19 06:38:34 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30441

            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
          Assignee: unassignedbugs at nondot.org
          Reporter: sylvestre at debian.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17310
  --> https://llvm.org/bugs/attachment.cgi?id=17310&action=edit
testcase.cpp

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
libraries).

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 @@
 libzen.so.0 libzen0v5 #MINVER#
- (c++)"ZenLib::ZtringListList::~ZtringListList()@Base" 0.4.23
+#MISSING: 0.4.33-3# (c++)"ZenLib::ZtringListList::~ZtringListList()@Base"
0.4.23
  (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 at Base 0.4.33-3
+
_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_M_constructIPKwEEvT_S8_St20forward_iterator_tag at Base
0.4.33-3

Full log:
http://clang.debian.net/logs/2015-03-25/libzen_0.4.29-1_unstable_clang.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
_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_M_constructIPKwEEvT_S8_St20forward_iterator_tag
                  U
_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE9_M_createERmm
+                 U _ZSt19__throw_logic_errorPKc

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

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160919/19be04bd/attachment.html>


More information about the llvm-bugs mailing list