[llvm-dev] using llvm DataFlowSanitizer error
吕涛 via llvm-dev
llvm-dev at lists.llvm.org
Sat Mar 31 05:50:54 PDT 2018
Hi. I'm using llvm DataFlowSanitizer. I add such code in library libtiff.
dfsan_label lt_label = dfsan_create_label("buf_offset", 0);
dfsan_set_label(lt_label, (unsigned char *)buf, size);
But when i compile libtiff with "-fsanitize=dataflow" option, then there is an error as follows:
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_enc_init'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_write_tables'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_suppress_tables'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$inflateReset'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_read_scanlines'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_set_quality'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_dec_init'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$inflateEnd'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_start_decompress'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$deflateReset'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_read_raw_data'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_read_header'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_enc_free'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$inflateInit_'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_CreateDecompress'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_dec_getimage'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_strerror'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_write_scanlines'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_finish_compress'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_abort'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_dec_getsize'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_CreateCompress'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$inflate'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_dec_free'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_destroy'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_finish_decompress'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_resync_to_restart'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_enc_out'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jbg_dec_in'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$deflateParams'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$deflate'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_start_compress'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_set_defaults'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$deflateInit_'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$deflateEnd'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$inflateSync'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_set_colorspace'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_write_raw_data'
../libtiff/libtiff.so.5.2.5: undefined reference to `dfs$jpeg_std_error'
clang-7.0: error: linker command failed with exit code 1 (use -v to see invocation)
tools/CMakeFiles/tiff2ps.dir/build.make:100: recipe for target 'tools/tiff2ps' failed
make[2]: *** [tools/tiff2ps] Error 1
CMakeFiles/Makefile2:311: recipe for target 'tools/CMakeFiles/tiff2ps.dir/all' failed
make[1]: *** [tools/CMakeFiles/tiff2ps.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
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
So i try to use cmake to recompile the llvm. There is an error again.
[ 52%] Building ASM object projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_linux_x86_64.S.o
cc1: error: -Werror=date-time: no option -Wdate-time
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
make[2]: *** [projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_linux_x86_64.S.o] Error 1
CMakeFiles/Makefile2:20521: recipe for target 'projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/all' failed
make[1]: *** [projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
Can anyone help me to solve this problem? Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180331/fe8c66bf/attachment.html>
More information about the llvm-dev
mailing list