[PATCH] D65255: [yaml2obj] Move core yaml2obj code into lib and include for use in unit tests
Alex Brachet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 1 00:14:35 PDT 2019
abrachet marked 3 inline comments as done.
abrachet added inline comments.
================
Comment at: llvm/lib/ObjectYAML/CMakeLists.txt:1
add_llvm_library(LLVMObjectYAML
CodeViewYAMLDebugSections.cpp
----------------
labath wrote:
> rupprecht wrote:
> > 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?
> Would this mean that we can also remove some entries from LLVM_LINK_COMPONENTS for the yaml2obj tool itself, now that it does not reference some of these libraries directly?
Thank you @rupprecht that worked :)
Oh yeah. Thanks @labath :)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65255/new/
https://reviews.llvm.org/D65255
More information about the llvm-commits
mailing list