<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 --- - Linking errors when building with AddressSanitizer and clang-cl"
href="http://llvm.org/bugs/show_bug.cgi?id=20214">20214</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Linking errors when building with AddressSanitizer and clang-cl
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ehsan@mozilla.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>I'm probably doing something wrong, but not sure what...
$ cat test.cpp
#include <stdlib.h>
int main() {
free(malloc(10));
}
$ clang-cl -c -MD -fsanitize=address test.cpp
$ link -nologo -out:test.exe -pdb:test.pdb test.obj
'..\..\..\..\llvm-objdir\RelWithDebInfo\lib\clang\3.5.0\lib\windows\clang_rt.asan-i386.lib'
'..\..\
..\..\llvm-objdir\RelWithDebInfo\lib\clang\3.5.0\lib\windows\clang_rt.asan_cxx-i386.lib'
-machine:x86
msvcrt.lib(MSVCR110.dll) : error LNK2005: _malloc already defined in
clang_rt.asan-i386.lib(asan_malloc_win.obj)
msvcrt.lib(MSVCR110.dll) : error LNK2005: _free already defined in
clang_rt.asan-i386.lib(asan_malloc_win.obj)
Creating library test.lib and object test.exp
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs;
use /NODEFAULTLIB:library
test.exe : fatal error LNK1169: one or more multiply defined symbols found</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>