[PATCH] D65255: [yaml2obj] Move core yaml2obj code into lib and include for use in unit tests

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 10:41:01 PDT 2019


rupprecht added inline comments.


================
Comment at: llvm/lib/ObjectYAML/CMakeLists.txt:1
 add_llvm_library(LLVMObjectYAML
   CodeViewYAMLDebugSections.cpp
----------------
abrachet wrote:
> rupprecht wrote:
> > This fails in a `-DBUILD_SHARED_LIBS=On` cmake build; I think you need to add a dep on MC here (or add `set(LLVM_LINK_COMPONENTS MC)`)
> > 
> > 
> > ```
> > FAILED: lib/libLLVMObjectYAML.so.10svn
> > ...
> > ld.lld: error: undefined symbol: llvm::StringTableBuilder::StringTableBuilder(llvm::StringTableBuilder::Kind, unsigned int)                                                                                       
> > >>> referenced by ELFEmitter.cpp:104 (/usr/local/google/home/rupprecht/src/llvm-project/llvm/lib/ObjectYAML/ELFEmitter.cpp:104)                                                                                   
> > >>>               lib/ObjectYAML/CMakeFiles/LLVMObjectYAML.dir/ELFEmitter.cpp.o:(llvm::yaml::yaml2elf(llvm::ELFYAML::Object&, llvm::raw_ostream&))                                                                
> > 
> > ```
> I ended up having to add quite a few more libraries before it would link. Were you just getting the errors you showed here or more than this?
Oh, sorry, this was the wrong suggestion -- the link libraries are controlled by the other build system, LLVMBuild.txt (see http://llvm.org/docs/LLVMBuild.html).
MC is the only one that needed to be added, but by setting `LLVM_LINK_COMPONENTS`, that appears to overwrite what's in LLVMBuild.txt, leading to even more link errors.

Can you undo the change here and add MC to LLVMBuild.txt?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65255/new/

https://reviews.llvm.org/D65255





More information about the llvm-commits mailing list