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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to