<html>
<head>
<base href="http://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 --- - clang produces different typeinfo than MinGW 4.8.2"
href="http://llvm.org/bugs/show_bug.cgi?id=18730">18730</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang produces different typeinfo than MinGW 4.8.2
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>yaron.keren@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=12008" name="attach_12008" title="batch file to compile">attachment 12008</a> <a href="attachment.cgi?id=12008&action=edit" title="batch file to compile">[details]</a></span>
batch file to compile
I have a problem when linking C++ DLLs compiled with MinGW 4.8.2 with
clang-produced object file. The linker complains about multiple definitions for
several typeinfos. The scenario is rather complex but I had reduced the issue
to differences between the typeinfos emitted for a simple testcase.
The same include files and libraries were used, MinGW 4.8.2 MinGW-w64 rev2 with
trivial compilation flags. Attached is a simple batch file to reproduce the
issue. Clang is svn few days old, gcc is MinGW-w64 rev2, the latest.
The source code is:
#include <stdexcept>
int main() { throw std::exception(); return 0; }
When compiling with clang, nm --demangle e_clang.o =
00000000 d .eh_frame
00000000 t .text
00000000 t .text
00000001 a @feat.00
U __cxa_allocate_exception
U __cxa_throw
U __main
00000000 T std::exception::exception()
U std::exception::~exception()
U typeinfo for std::exception
U vtable for std::exception
00000000 T main
but with gcc, nm --demangle e_gcc.o
00000000 b .bss
00000000 d .data
00000000 r .eh_frame
00000000 r .eh_frame$_ZNSt9exceptionC1Ev
00000000 r .rdata$_ZTISt9exception
00000000 r .rdata$_ZTSSt9exception
00000000 r .rdata$zzz
00000000 t .text
00000000 t .text$_ZNSt9exceptionC1Ev
U __cxa_allocate_exception
U __cxa_throw
U __main
00000000 T std::exception::exception()
U std::exception::~exception()
00000000 R typeinfo for std::exception
00000000 R typeinfo name for std::exception
U vtable for __cxxabiv1::__class_type_info
U vtable for std::exception
00000000 T main
there are couple of differences:
* clang producing U typeinfo for std::exception whereas gcc produces R typeinfo
for std::exception.
* The R typeinfo name for std::exception is not produced by clang.
* r .rdata$ records are also not produced by clang.
One or more of these differences causes typeinfos merging failure while linking
the above object files with C++ DLLs compiled with MinGW.
I suspect the first difference is the critical one.
In any case, clang output of typeinfos should match gcc.</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>