<div dir="ltr">Hi,<div><br></div><div>I'm trying to compile the example program from the DataFlow Sanitizer page (<a href="http://clang.llvm.org/docs/DataFlowSanitizer.html">http://clang.llvm.org/docs/DataFlowSanitizer.html</a>) without success. I receive a number of errors when trying to compile the example with clang:</div>

<div><br></div><div><div>/> clang -fsanitize=dataflow -o labelprop labelprop.c </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>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 2 has invalid symbol index 2</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 3 has invalid symbol index 2</div>

<div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 4 has invalid symbol index 11</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 5 has invalid symbol index 13</div>

<div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 6 has invalid symbol index 13</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 7 has invalid symbol index 13</div>

<div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 8 has invalid symbol index 12</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 9 has invalid symbol index 13</div>

<div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 10 has invalid symbol index 13</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 11 has invalid symbol index 13</div>

<div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 12 has invalid symbol index 13</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 13 has invalid symbol index 13</div>

<div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 14 has invalid symbol index 13</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 15 has invalid symbol index 13</div>

<div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 16 has invalid symbol index 13</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 17 has invalid symbol index 13</div>

<div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 18 has invalid symbol index 13</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 19 has invalid symbol index 22</div>

<div>/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_line): relocation 0 has invalid symbol index 2</div><div>/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':</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>/usr/local/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a(sanitizer_deadlock_detector1.o):(.<a href="http://data.rel.ro">data.rel.ro</a>+0x60): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'</div>

<div>/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'</div>

<div>/usr/local/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a(sanitizer_symbolizer.o):(.data.rel.ro._ZTIN11__sanitizer10SymbolizerE[_ZTIN11__sanitizer10SymbolizerE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'</div>

<div>/usr/local/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a(sanitizer_symbolizer_posix_libcdep.o):(.data.rel.ro._ZTIN11__sanitizer27ExternalSymbolizerInterfaceE[_ZTIN11__sanitizer27ExternalSymbolizerInterfaceE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'</div>

<div>/usr/local/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a(sanitizer_symbolizer_posix_libcdep.o):(.data.rel.ro._ZTIN11__sanitizer13Addr2LinePoolE[_ZTIN11__sanitizer13Addr2LinePoolE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'</div>

<div>/usr/local/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a(sanitizer_symbolizer_posix_libcdep.o):(.data.rel.ro._ZTIN11__sanitizer17SymbolizerProcessE[_ZTIN11__sanitizer17SymbolizerProcessE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'</div>

<div>/usr/local/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a(sanitizer_symbolizer_posix_libcdep.o):(.data.rel.ro._ZTIN11__sanitizer16Addr2LineProcessE[_ZTIN11__sanitizer16Addr2LineProcessE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'</div>

<div>/usr/local/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a(sanitizer_symbolizer_posix_libcdep.o):(.data.rel.ro._ZTIN11__sanitizer21LLVMSymbolizerProcessE[_ZTIN11__sanitizer21LLVMSymbolizerProcessE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'</div>

<div>/usr/local/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a(sanitizer_symbolizer_posix_libcdep.o):(.data.rel.ro._ZTIN11__sanitizer15POSIXSymbolizerE[_ZTIN11__sanitizer15POSIXSymbolizerE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'</div>

<div>/usr/local/llvm/build/Debug+Asserts/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a(sanitizer_thread_registry.o):(.data.rel.ro._ZTIN11__sanitizer17ThreadContextBaseE[_ZTIN11__sanitizer17ThreadContextBaseE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'</div>

<div>/tmp/labelprop-bfe82e.o: In function `dfs$main':</div><div>labelprop.c:(.text+0x78): undefined reference to `dfs$dfsan_create_label'</div><div>labelprop.c:(.text+0xcc): undefined reference to `dfs$dfsan_set_label'</div>

<div>labelprop.c:(.text+0x108): undefined reference to `dfs$dfsan_create_label'</div><div>labelprop.c:(.text+0x145): undefined reference to `dfs$dfsan_set_label'</div><div>labelprop.c:(.text+0x181): undefined reference to `dfs$dfsan_create_label'</div>

<div>labelprop.c:(.text+0x1bf): undefined reference to `dfs$dfsan_set_label'</div><div>labelprop.c:(.text+0x2c1): undefined reference to `dfs$dfsan_get_label'</div><div>labelprop.c:(.text+0x303): undefined reference to `dfs$dfsan_has_label'</div>

<div>labelprop.c:(.text+0x341): undefined reference to `dfs$__assert_fail'</div><div>labelprop.c:(.text+0x36c): undefined reference to `dfs$dfsan_has_label'</div><div>labelprop.c:(.text+0x3aa): undefined reference to `dfs$__assert_fail'</div>

<div>labelprop.c:(.text+0x3d5): undefined reference to `dfs$dfsan_has_label'</div><div>labelprop.c:(.text+0x413): undefined reference to `dfs$__assert_fail'</div><div>labelprop.c:(.text+0x5e2): undefined reference to `dfs$dfsan_get_label'</div>

<div>labelprop.c:(.text+0x624): undefined reference to `dfs$dfsan_has_label'</div><div>labelprop.c:(.text+0x662): undefined reference to `dfs$__assert_fail'</div><div>labelprop.c:(.text+0x68d): undefined reference to `dfs$dfsan_has_label'</div>

<div>labelprop.c:(.text+0x6cb): undefined reference to `dfs$__assert_fail'</div><div>labelprop.c:(.text+0x6f6): undefined reference to `dfs$dfsan_has_label'</div><div>labelprop.c:(.text+0x734): undefined reference to `dfs$__assert_fail'</div>

<div>clang: error: linker command failed with exit code 1 (use -v to see invocation)</div></div><div><br></div><div>I also tried to use the prepackaged distribution of clang/llvm for Ubuntu and obtained the same error.</div>

<div><br></div><div>I'm running on Ubuntu Trusty, gcc 4.8.2 and I specified -fsanitize=dataflow when compiling with clang. </div><div>Anything wrong? Any help will be appreciated! </div><div><br></div><div>Thanks,</div>

<div>Frederico</div><div><div><br></div></div></div>