[PATCH] [LLVM] [sanitizer] add conditionals for libc

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Wed Apr 23 08:28:39 PDT 2014

On 23 April 2014 17:01, Kostya Serebryany <kcc at google.com> wrote:
>> > Are you saying that asan works with uClibc with your patches? Good to
>> > know!
>> > Or it just builds?
>> I did not complete my testing so for a start i'll just say that it builds.
> Beware that asan is a *very* platform dependent beast. tsan/msan/lsan --
> even more so.
> It will most likely not work with a new libc implementation out of the box
> and build failures is the least of concerns.
> I would prefer if you first make sure that at least basic asan tests work
> before submitting any changes.


>> > Second, the build should not require any additional -DHAVE_BLAH -- all
>> > this
>> > logic should be done inside the sources (e.g.
>> > sanitizer_common/sanitizer_platform.h)
>> > We should not do any probes at build time
>> Not probing at build time will not work, i fear. I cannot determine
>> the characteristics
>> of the target otherwise:
>> How do you suggest can i determine if e.g. netrom/netrom.h exists
>> otherwise? I cannot.
> Check some macro defined by uClibc and its version.

Ok, i can do that if you really prefer this over specific build-time
checks, sure.
>> As an alternative to the -DHAVE_BLAH on the command-line, i can use a
>> cmake "configure_file", see
>> http://reviews.llvm.org/D3464#20ab9453
>> What do you think?
> That's the same, it will require changes in other build systems.

I see. So let me play some more with this (i.e. test it) and i will
eventually follow-up with a set of small, self-contained patches that
add preprocessor-conditionals specifically naming the uClibc-feature a
given instrumentation requires (__UCLIBC__ && __UCLIBC_HAS_LFS__ for
e.g. the statfs64 stuff).

Thanks for your help so far!


More information about the llvm-commits mailing list