[cfe-dev] [libcxx] How to compile libcxx with MemorySanitizer in MacOS and Linux

Eric Fiselier eric at efcs.ca
Tue Jul 28 09:27:39 PDT 2015


> Do you know anything about compiling it with the MemorySanitizer under Linux?

Yes. You can use the '-DLLVM_USE_SANITIZER=Memory` or
`-DLLVM_USE_SANITIZER=MemoryWithOrigins`
when building libc++ and libc++ to build using MemorySanitizer.

> It seems that there is a circular dependency between libcxx and libcxxabi but the docs do not really mention
> how to solve this (libcxx docs say it needs libcxxabi and libcxxabi says it needs libcxx).

They both need each other :). However libc++abi only needs the libc++
headers, not the compiled library, so you build libc++abi first and
then build libc++ after.

Better docs are in progress.

/Eric



On Tue, Jul 28, 2015 at 12:17 PM, Gonzalo BG <gonzalobg88 at gmail.com> wrote:
>
> On Tue, Jul 28, 2015 at 5:49 PM, Eric Fiselier <eric at efcs.ca> wrote:
>>
>> MemorySanitizer is not supported on OS X
>> (http://clang.llvm.org/docs/MemorySanitizer.html).
>
>
> I see, thanks for the fast answer!
>
> Do you know anything about compiling it with the MemorySanitizer under
> Linux?
>
> It seems that there is a circular dependency between libcxx and libcxxabi
> but the docs do not really mention how to solve this (libcxx docs say it
> needs libcxxabi and libcxxabi says it needs libcxx).



More information about the cfe-dev mailing list