[cfe-users] Address Sanitizer Link Error

Peter Caspers pcaspers1973 at gmail.com
Tue May 6 02:36:56 PDT 2014


yes, I use clang with the sanitize option to link. I have the
following libs installed

peter at peter-ThinkPad-W520:/usr/local/lib/clang/3.5.0/lib/linux$ ls
libclang_rt.asan-x86_64.a   libclang_rt.lsan-x86_64.a
libclang_rt.san-x86_64.a        libclang_rt.ubsan-x86_64.a
libclang_rt.dfsan-x86_64.a  libclang_rt.msan-x86_64.a
libclang_rt.tsan-x86_64.a
libclang_rt.full-x86_64.a   libclang_rt.profile-x86_64.a
libclang_rt.ubsan_cxx-x86_64.a

You think that should work then ?
Thanks
Peter

---------- Forwarded message ----------
From: Hans Wennborg <hans at chromium.org>
Date: 6 May 2014 00:15
Subject: Re: [cfe-users] Address Sanitizer Link Error
To: Peter Caspers <pcaspers1973 at gmail.com>
Cc: David Blaikie <dblaikie at gmail.com>, "cfe-users at cs.uiuc.edu"
<cfe-users at cs.uiuc.edu>


On Sun, May 4, 2014 at 11:32 PM, Peter Caspers <pcaspers1973 at gmail.com> wrote:
> yes. The whole build process is clean except for the warnings below (I
> am on Linux/Ubuntu 13.10, x86-64). Is there any way I can explicitly
> check if the necessary libraries for the address sanitizer are in
> place ?

They should be installed in $PREFIX/lib/clang/3.5.0/lib/linux/

Do you invoke the linker manually, or via clang? If you use "clang
-fsanitize=address" to link, I think it should be adding the ASan
runtime to the link line automagically.

 - Hans


> make[4]: Entering directory `/home/peter/llvm/tools/clang/runtime/compiler-rt'
> warning: clang_darwin.mk: dropping arch 'i386' from lib 'eprintf' (ld
> does not support it)
> warning: clang_darwin.mk: dropping arch 'i386' from lib '10.4' (ld
> does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64' from lib '10.4' (ld
> does not support it)
> warning: clang_darwin.mk: dropping arch 'i386' from lib 'ios' (ld does
> not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64' from lib 'ios' (ld
> does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64h' from lib 'ios' (ld
> does not support it)
> warning: clang_darwin.mk: dropping arch 'armv7' from lib 'ios' (ld
> does not support it)
> warning: clang_darwin.mk: dropping arch 'i386' from lib 'osx' (ld does
> not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64' from lib 'osx' (ld
> does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64h' from lib 'osx' (ld
> does not support it)
> warning: clang_darwin.mk: dropping arch 'armv7' from lib 'cc_kext' (ld
> does not support it)
> warning: clang_darwin.mk: dropping arch 'i386' from lib 'cc_kext' (ld
> does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64' from lib 'cc_kext'
> (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64h' from lib 'cc_kext'
> (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64' from lib
> 'cc_kext_ios5' (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64h' from lib
> 'cc_kext_ios5' (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'armv7' from lib
> 'cc_kext_ios5' (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'i386' from lib 'profile_osx'
> (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64' from lib
> 'profile_osx' (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64h' from lib
> 'profile_osx' (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'i386' from lib 'profile_ios'
> (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64' from lib
> 'profile_ios' (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64h' from lib
> 'profile_ios' (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'armv7' from lib 'profile_ios'
> (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'i386' from lib
> 'asan_osx_dynamic' (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64' from lib
> 'asan_osx_dynamic' (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64h' from lib
> 'asan_osx_dynamic' (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'i386' from lib 'ubsan_osx'
> (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64' from lib 'ubsan_osx'
> (ld does not support it)
> warning: clang_darwin.mk: dropping arch 'x86_64h' from lib 'ubsan_osx'
> (ld does not support it)
>
> On 4 May 2014 21:57, David Blaikie <dblaikie at gmail.com> wrote:
>> Did you checkout the llvm/project/compiler-rt project and
>> build/install that too?
>>
>> On Sun, May 4, 2014 at 12:31 PM, Peter Caspers <pcaspers1973 at gmail.com> wrote:
>>> Hi,
>>>
>>> I built clang from the svn repository. It works fine, except when using
>>>
>>> -fsanitize=address
>>>
>>> during linking I get messages like
>>>
>>> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_algobase.h:372:
>>> undefined reference to `__asan_memmove'
>>>
>>> Anybody has an idea what I did wrong ?
>>>
>>> Thanks
>>> Peter
>>> _______________________________________________
>>> cfe-users mailing list
>>> cfe-users at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users
> _______________________________________________
> cfe-users mailing list
> cfe-users at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users



More information about the cfe-users mailing list