<p>
Hi. I'm using llvm DataFlowSanitizer. I add such code in library libtiff.
</p>
<p>
dfsan_label lt_label = dfsan_create_label("buf_offset", 0);
</p>
<p>
dfsan_set_label(lt_label, (unsigned char *)buf, size);
</p>
<p>
But when i compile libtiff with "<span style="color:#DD1144;font-family:Menlo, "font-size:12px;white-space:pre;background-color:#FFFFFF;">-fsanitize=dataflow</span>" option, then there is an error as follows:
</p>
<p>
<br>
</p>
<p>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_enc_init'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_write_tables'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_suppress_tables'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$inflateReset'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_read_scanlines'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_set_quality'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_dec_init'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$inflateEnd'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_start_decompress'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$deflateReset'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_read_raw_data'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_read_header'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_enc_free'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$inflateInit_'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_CreateDecompress'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_dec_getimage'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_strerror'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_write_scanlines'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_finish_compress'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_abort'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_dec_getsize'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_CreateCompress'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$inflate'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_dec_free'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_destroy'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_finish_decompress'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_resync_to_restart'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_enc_out'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_dec_in'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$deflateParams'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$deflate'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_start_compress'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_set_defaults'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$deflateInit_'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$deflateEnd'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$inflateSync'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_set_colorspace'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_write_raw_data'<br>
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_std_error'<br>
clang-7.0: error: linker command failed with exit code 1 (use -v to see invocation)<br>
tools/CMakeFiles/tiff2ps.dir/build.make:100: recipe for target 'tools/tiff2ps' failed<br>
make[2]: *** [tools/tiff2ps] Error 1<br>
CMakeFiles/Makefile2:311: recipe for target 'tools/CMakeFiles/tiff2ps.dir/all' failed<br>
make[1]: *** [tools/CMakeFiles/tiff2ps.dir/all] Error 2<br>
Makefile:138: recipe for target 'all' failed<br>
make: *** [all] Error 2<br>
</p><p>
<br>
</p>
<p>
I search on the internet, and found one answer in http://clang-developers.42468.n3.nabble.com/Problem-linking-example-program-with-DataFlow-Sanitizer-td4039375.html
</p>
<p>
<br>
</p>
<p>
So i try to use cmake to recompile the llvm. There is an error again.
</p>
<p>
<br>
</p>
<p>
[ 52%] Building ASM object projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_linux_x86_64.S.o<br>
cc1: error: -Werror=date-time: no option -Wdate-time<br>
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/build.make:1070: recipe for target 'projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_linux_x86_64.S.o' failed<br>
make[2]: *** [projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_linux_x86_64.S.o] Error 1<br>
CMakeFiles/Makefile2:20521: recipe for target 'projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/all' failed<br>
make[1]: *** [projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/all] Error 2<br>
Makefile:149: recipe for target 'all' failed<br>
make: *** [all] Error 2<br>
</p><div>
<br>
</div>
Can anyone help me to solve this problem? Thank you.