[cfe-dev] Problem compiling with -fsanitize=dataflow

Frederico Araujo araujof at gmail.com
Tue May 27 07:17:24 PDT 2014


Hi Csaba,


On Tue, May 27, 2014 at 2:57 AM, Csaba Raduly <rcsaba at gmail.com> wrote:

> Hi Frederico,
>
> Unfortunately, you did not provide enough information to allow
> diagnosing your problem.
> You did not show us the commands you ran; you did not show us the
> error messages.


Sorry, my bad. I should have replied this message to my previous email
which contains the error messages from config.log.


>
> On Mon, May 26, 2014 at 5:41 PM, Frederico Araujo  wrote:
> > Dear list,
> >
> > Have anybody compile a project using GNU configure with clang as compiler
> > and with the dataflow sanitizer option enabled? I tried compiling several
> > open source projects (e.g., Apache Httpd, Apache APR, Nginx) with dfsan
> and
> > all fail on the configure step when performing the usual checks for
> system
> > types, functions, etc.
>
> What was the error message? Did you check config.log?
>

Just in case someone else makes the same mistake, the problem is that I had
two versions of clang installed in my system, one compiled with
configure/make and the other with cmake. I mistakenly used the former,
which does not build the ABI list, as explained by Peter in a previous
message. That's why the compilation step failed when trying to run
configure for any of my applications. Please correct me if this is not
accurate.

>
> >
> > Interestingly, compiling with other sanitizers such as "memory" or
> "address"
> > work fine. These are the variables I set for compilation:
> >
> > CC=<path-to-my-clang installation, compiled with cmake>
> > CFLAGS="-fsanitize=dataflow"
>
> Did you run "make install" and use /usr/local/bin/clang, or did you
> just point CC at 'Release+Asserts/bin/clang' ?
>

I did not run install. I included on my PATH both the bin and lib folders
from my local compilation of clang. Is that a problem? I did that because I
was learning clang and had more than one compiled version of it (one
compiled with gnu configure/make and another with cmake). I will probably
stick with the cmake-generated version for now.


>
> >
> > Notes: when using dfsan, I have to specify -S for the configure script to
>
> How did you specify -S to the configure script? It does not have such an
> option:
>
> $ ./configure -S
> configure: error: unrecognized option: `-S'
> Try `./configure --help' for more information
>
> > pass the C compiler check, otherwise the compiler check fails. With -S
> flag
> > specified, the GNU configure script fails on the sanity checks for system
>
> Did you mean 'with' or 'without' ?
>
>
Actually, I meant -S option to the clang compiler, to generate textual
 assembly rather than binary assembly. But this was a wrong. The problem is
that I was using the wrong version of clang, as mentioned before.

Thanks a lot for your comments,
Fred


> > functions and types. With the other sanitizers I don't need this and
> > everything works fine. I also tried setting the configure script LDLIBS
> with
> > the dfsan libraries, again without success.
>
> Csaba
> --
> GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
> The Tao of math: The numbers you can count are not the real numbers.
> Life is complex, with real and imaginary parts.
> "Ok, it boots. Which means it must be bug-free and perfect. " -- Linus
> Torvalds
> "People disagree with me. I just ignore them." -- Linus Torvalds
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140527/02593694/attachment.html>


More information about the cfe-dev mailing list