<div dir="ltr">Hi,<div><br></div><div>When  trying to use the function <i>dfsan_add_label</i> defined in the dataflow sanitizer interface I get an undefined reference error. Other functions such as <i>dfsan_create_label</i> and <i>dfsan_set_label</i> work fine. I can emulate this function by using dfsan_union and fsan_set_label, but I'm curious to understand why it's undefined. Any ideas?</div>

<div><br></div><div>Here is the output of compilation with -v flag:<br></div><div><br></div><div><div>clang version 3.5.0 (208131)</div><div>Target: x86_64-unknown-linux-gnu</div><div>Thread model: posix</div><div>Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8</div>

<div>Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.2</div><div>Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9</div><div>Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.0</div>

<div>Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8</div><div> "/usr/local/llvm/cmakebuild/bin/clang-3.5" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name mrpoc.c -mrelocation-model pic -pic-level 2 -pie-level 2 -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -v -resource-dir /usr/local/llvm/cmakebuild/bin/../lib/clang/3.5.0 -internal-isystem /usr/local/include -internal-isystem /usr/local/llvm/cmakebuild/bin/../lib/clang/3.5.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /home/frederico/dev/tests/llvm/mr -ferror-limit 19 -fmessage-length 116 -fsanitize=dataflow -fsanitize-blacklist=/usr/local/llvm/cmakebuild/bin/../lib/clang/3.5.0/dfsan_abilist.txt -mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/mrpoc-da2ec3.o -x c mrpoc.c</div>

<div>clang -cc1 version 3.5.0 based upon LLVM 3.5.0svn default target x86_64-unknown-linux-gnu</div><div>ignoring nonexistent directory "/include"</div><div>#include "..." search starts here:</div><div>

#include <...> search starts here:</div><div> /usr/local/include</div><div> /usr/local/llvm/cmakebuild/bin/../lib/clang/3.5.0/include</div><div> /usr/include/x86_64-linux-gnu</div><div> /usr/include</div><div>End of search list.</div>

<div> "/usr/bin/ld" -whole-archive /usr/local/llvm/cmakebuild/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a -no-whole-archive -pie -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o mrpoc /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. -L/usr/local/llvm/cmakebuild/bin/../lib -L/lib -L/usr/lib /tmp/mrpoc-da2ec3.o -lpthread -lrt -lm -ldl --dynamic-list=/usr/local/llvm/cmakebuild/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.dfsan-x86_64.a.syms -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.8/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o</div>

<div>/tmp/mrpoc-da2ec3.o: In function `main':</div><div>mrpoc.c:(.text+0xb3): undefined reference to `dfsan_add_label'</div><div>/tmp/mrpoc-da2ec3.o: In function `dfsw$dfsan_add_label':</div><div>mrpoc.c:(.text.dfsw$dfsan_add_label[dfsw$dfsan_add_label]+0xb): undefined reference to `dfsan_add_label'</div>

<div>clang-3.5: error: linker command failed with exit code 1 </div></div><div><br></div><div>Thanks,</div><div>Fred</div></div>