[LLVMbugs] [Bug 20214] New: Linking errors when building with AddressSanitizer and clang-cl

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jul 5 10:00:01 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20214

            Bug ID: 20214
           Summary: Linking errors when building with AddressSanitizer and
                    clang-cl
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ehsan at mozilla.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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

-- 
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/20140705/0347682a/attachment.html>


More information about the llvm-bugs mailing list