<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Different symbols export with g++ and clang"
   href="https://llvm.org/bugs/show_bug.cgi?id=30441">30441</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Different symbols export with g++ and clang
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Object
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sylvestre@debian.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17310" name="attach_17310" title="testcase.cpp">attachment 17310</a> <a href="attachment.cgi?id=17310&action=edit" title="testcase.cpp">[details]</a></span>
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@Base 0.4.33-3
+
_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_M_constructIPKwEEvT_S8_St20forward_iterator_tag@Base
0.4.33-3

Full log:
<a href="http://clang.debian.net/logs/2015-03-25/libzen_0.4.29-1_unstable_clang.log">http://clang.debian.net/logs/2015-03-25/libzen_0.4.29-1_unstable_clang.log</a>

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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>