[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 12 08:38:49 PDT 2018

labath planned changes to this revision.
labath added a comment.

Right, so this will not work for the BUILD_SHARED_LIBS case, and there doesn't seem to be an easy way to make it work from this end. I'm going to try fixing this from the llvm side and come back to this if we still need the pthread/dl fixes.

Comment at: cmake/modules/LLDBConfig.cmake:354
+  check_library_exists(dl dlopen "" HAVE_LIBDL)
+  if (HAVE_LIBDL)
krytarowski wrote:
> mgorny wrote:
> > krytarowski wrote:
> > > A more portable form of this:
> > > 
> > > ```
> > > foreach(lib ${CMAKE_DL_LIBS})
> > > list(APPEND system_libs -l${lib})
> > > endforeach()
> > > ```
> > > 
> > > Haiku needs 2 libraries, other Unices can use `-lldl` or similar.
> > Didn't this raise the problem of cmake using full paths on some systems? 
> No.
Do you have some reference for the portability claim? (mainly because I'm trying to learn more about how cmake works, but also because I'd rather let cmake figure out when to prepend -l instead of doing it myself).

I don't see how the "two libraries" thingy comes into play here. It could be a problem if we are mismatching lists and strings but I don't see why that would necessitate manually tagging with -l.


More information about the lldb-commits mailing list