[cfe-dev] Problem linking example program with DataFlow Sanitizer

Frederico Araujo araujof at gmail.com
Wed May 7 15:52:25 PDT 2014


Hi Peter,

Thank you for your reply.

I'm still having problems even after using cmake. Please see my comments
below.

On Wed, May 7, 2014 at 4:16 PM, Peter Collingbourne <peter at pcc.me.uk> wrote:

> Hi Frederico,
>
> On Wed, May 07, 2014 at 03:43:07PM -0500, Frederico Araujo wrote:
> > Hi,
> >
> > I'm trying to compile the example program from the DataFlow Sanitizer
> page (
> > http://clang.llvm.org/docs/DataFlowSanitizer.html) without success. I
> > receive a number of errors when trying to compile the example with clang:
> >
> > /> clang -fsanitize=dataflow -o labelprop labelprop.c
> [...]
> > /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/Scrt1.o: In
> > function `_start':
> > (.text+0x20): undefined reference to `main'
> [...]
> > /tmp/labelprop-bfe82e.o: In function `dfs$main':
> > labelprop.c:(.text+0x78): undefined reference to `dfs$dfsan_create_label'
>
> It looks like DFSan wasn't able to find the ABI list file. Unfortunately
> only the CMake build system currently supports building the ABI list.
> Can you please try again with CMake?
>

I created this simple CMake list file:

cmake_minimum_required (VERSION 2.6)
project (EXAMPLE)
add_executable(labelprop labelprop.c)
SET (CMAKE_C_COMPILER   "/usr/bin/clang")
SET (CMAKE_C_FLAGS "-fsanitize=dataflow")

After building the project with the above configuration, I still get the
same errors as before. Anything missing? Perhaps I should say that I'm new
to cmake :)
I forgot to ask in my first email: is there any step-by-step instructions
on how to compile and get the dataflow sanitizer example working?


>
> >
> /usr/local/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a(sanitizer_deadlock_detector1.o):(.data.rel.ro._ZTIN11__sanitizer9DDetectorE[_ZTIN11__sanitizer9DDetectorE]+0x0):
> > undefined reference to `vtable for __cxxabiv1::__class_type_info'
>
> This would appear to indicate that your sanitizer runtimes were built with
> RTTI, which is a little surprising. Did you do anything in particular to
> enable RTTI?
>

Well, no. I just followed the instructions on the clang webpage on how to
compile llvm and clang. I used the trunk versions of everything. I also
compiled the optional projects. Could it be the -fsanitizer-dataflow option?


>
> Thanks,
> --
> Peter
>

Thanks!
Frederico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140507/ebd7a15b/attachment.html>


More information about the cfe-dev mailing list