I think LLVMTestingSupport should never be a shared lib, what do you think?<br><br>I can’t fix this until tomorrow but if you need an immediate workaround you can pass TestMainArgv0 to the function instead.  Could you please check that in for me?<br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 5, 2018 at 5:56 PM Fangrui Song via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">MaskRay added a comment.<br>
<br>
For `-DBUILD_SHARED_LIBS=on` users,<br>
<br>
  % ninja libLLVMTestingSupport.so<br>
  ............. -Wl,-z,defs  ..........<br>
  ld.lld: error: undefined symbol: TestMainArgv0<br>
  >>> referenced by SupportHelpers.cpp<br>
  >>>               lib/Testing/Support/CMakeFiles/LLVMTestingSupport.dir/SupportHelpers.cpp.o:(llvm::unittest::getInputFileDirectory())<br>
  clang-8: error: linker command failed with exit code 1 (use -v to see invocation)<br>
  ninja: build stopped: subcommand failed.<br>
<br>
Now libLLVMTestingSupport.so references a symbol in `utils/unittest/UnitTestMain/TestMain.cpp`<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D51561" rel="noreferrer" target="_blank">https://reviews.llvm.org/D51561</a><br>
<br>
<br>
<br>
</blockquote></div>