<div dir="ltr"><br><div>This happens with LLVM 4.0, too. Is it a bug I am hitting, by any chance?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 14 June 2017 at 17:00, Dipanjan Das <span dir="ltr"><<a href="mailto:mail.dipanjan.das@gmail.com" target="_blank">mail.dipanjan.das@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div>I am using pre-built LLVM/Clang 3.8.0 binaries on Ubuntu 16.04.2, 64 bit. I tried to lift a minimal program to LLVM IR, then link the IR to DataFlowSanitizer libraries to produce executable code. In the second step, the process throws a bunch of linker errors.<div><br></div><div>==============================<wbr>===========</div><div><br></div><div><div>#include <sanitizer/dfsan_interface.h></div><div>#include <assert.h></div><div><br></div><div>int main(void) {</div><div>  int i = 1;</div><div>  </div><div>  dfsan_label i_label = dfsan_create_label("i", 0);</div><div>  dfsan_set_label(i_label, &i, sizeof(i));</div><div><br></div><div>  return 0;</div><div>}</div><div><br></div><div>==============================<wbr>===========<br></div><div><br></div><div>clang -c -emit-llvm -fsanitize=dataflow test.c -o test.bc<br></div><div><br></div><div><div>clang -fsanitize=dataflow test2.bc -o test2</div><div><br></div><div>/usr/lib/gcc/x86_64-linux-gnu/<wbr>5.4.0/../../../x86_64-linux-<wbr>gnu/Scrt1.o: In function `_start':                   </div><div>(.text+0x20): undefined reference to `main'                                                                                       </div><div>/tmp/test2-c642ef.o: In function `dfs$main':                                                                                       </div><div>test2.bc:(.text+0x96): undefined reference to `dfs$dfsan_create_label'                                             </div><div>test2.bc:(.text+0xeb): undefined reference to `dfs$dfsan_set_label'                                                  </div><div>/tmp/test2-c642ef.o: In function `dfs$dfsw$dfsan_create_label':                                                        </div><div>test2.bc:(.text+0x16e): undefined reference to `dfs$dfsan_create_label'                                           </div><div>/tmp/test2-c642ef.o: In function `dfs$dfsw$dfsan_set_label':                                                             </div><div>test2.bc:(.text+0x1e4): undefined reference to `dfs$dfsan_set_label'                                                </div><div>clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation)</div></div><div><br></div><div>==============================<wbr>===========<br></div><div><br></div><div>Any idea what might I be doing wrong?</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-1536513879465304325gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</div>