[libcxx-commits] [PATCH] D57872: [CMake] Split linked libraries for shared and static libc++

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 14 00:56:44 PST 2019


EricWF added a comment.

>   combining these together in LIBCXX_LIBRARIES and LIBCXX_INTERFACE_LIBRARIES can introduce unnecessary dependencies.

Can you provide an example? And elaborate on the introducing unused libraries on the link line?



================
Comment at: libcxx/lib/CMakeLists.txt:48
 if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
-  add_library_flags("-Wl,--whole-archive" "-Wl,-Bstatic")
-  add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
-  add_library_flags("-Wl,-Bdynamic" "-Wl,--no-whole-archive")
+  list(APPEND LIBCXX_SHARED_LIBRARIES "-Wl,--whole-archive" "-Wl,-Bstatic")
+  list(APPEND LIBCXX_SHARED_LIBRARIES "${LIBCXX_CXX_ABI_LIBRARY}")
----------------
These are flags. Not shared libraries.

 


================
Comment at: libcxx/lib/CMakeLists.txt:52
 elseif (LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS)
-  add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
+  list(APPEND LIBCXX_SHARED_LIBRARIES "${LIBCXX_CXX_ABI_LIBRARY}")
 else ()
----------------
Does this make it an interface library? because that's incorrect. 


================
Comment at: libcxx/lib/CMakeLists.txt:98
 if (LIBCXXABI_USE_LLVM_UNWINDER)
-  if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR HAVE_LIBUNWIND))
-    add_interface_library(unwind_shared)
-  elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR HAVE_LIBUNWIND))
-    add_interface_library(unwind_static)
+  if (NOT LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY AND (TARGET unwind_shared OR HAVE_LIBUNWIND))
+    list(APPEND LIBCXX_SHARED_LIBRARIES unwind_shared)
----------------
If you're renaming this, can you double-check there are no buildbot configurations using it on zorg?

Maybe set up a bot or two? You can use the `libcxx-cloud` workers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57872





More information about the libcxx-commits mailing list