<div dir="ltr">Hi,<div><br></div><div>I've tried to compile Apache Httpd (and several other open source projects) with clang using the dataflow sanitizer. I set the CC environment variable to point to my clang installation and I specified the "-fsanitize=dataflow" in the CFLAGS and/or LDFLAGS environment variables.</div>
<div><br></div><div>However, the configure script fails when running its C compiler tests (in Apache's case, the first problem occurs for the APR library). The following is an excerpt of the config.log output: <br></div>
<div><br></div><div>(...)</div><div>configure:5409: checking whether the C compiler works</div><div>configure:5431: /usr/local/llvm/build/Debug+Asserts/bin/clang -fsanitize=dataflow conftest.c >&5</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 0 has invalid symbol index 11</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 1 has invalid symbol index 12</div><div>(...)</div><div>/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':<br>
</div><div>(.text+0x20): undefined reference to `main'</div><div>/usr/local/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a(dfsan_interceptors.o): In function `InitializeInterceptors':</div>
<div>/usr/local/llvm/projects/compiler-rt/lib/dfsan/dfsan_interceptors.cc:40: undefined reference to `__interception::GetRealFunctionAddress(char const*, unsigned long*, unsigned long, unsigned long)'</div><div>/usr/local/llvm/projects/compiler-rt/lib/dfsan/dfsan_interceptors.cc:41: undefined reference to `__interception::GetRealFunctionAddress(char const*, unsigned long*, unsigned long, unsigned long)'</div>
<div>(...)(.data.rel.ro._ZTIN11__sanitizer17ThreadContextBaseE[_ZTIN11__sanitizer17ThreadContextBaseE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'<br></div><div>clang: error: linker command failed with exit code 1 (use -v to see invocation)</div>
<div>configure:5435: $? = 1</div><div>configure:5473: result: no</div><div>configure: failed program was:</div><div>| /* confdefs.h */</div><div>| #define PACKAGE_NAME ""</div><div>| #define PACKAGE_TARNAME ""</div>
<div>| #define PACKAGE_VERSION ""</div><div>| #define PACKAGE_STRING ""</div><div>| #define PACKAGE_BUGREPORT ""</div><div>| #define PACKAGE_URL ""</div><div>| /* end confdefs.h. */</div>
<div>| </div><div>| int</div><div>| main ()</div><div>| {</div><div>| </div><div>| ;</div><div>| return 0;</div><div>| } </div><div>(...)</div><div><br></div><div>I tested clang with dfsan on my machine and it works. I also tested the above conftest.c for compilation and everything looks fine. (On a side note, I tested compiling the same projects with clang only + the same configure scripts and it works.)</div>
<div><br></div><div>Any ideas? Can clang + dfsan be used with autotools configure scripts? </div><div><br></div><div>Thanks,</div><div>Fred</div></div>