[PATCH] Do not link the dyndd runtime library against libdl on FreeBSD

Alexey Samsonov vonosmas at gmail.com
Fri Sep 5 13:25:58 PDT 2014


================
Comment at: lib/tsan/dd/CMakeLists.txt:27
@@ +26,3 @@
+# There is no libdl on FreeBSD.
+if(NOT ${CMAKE_SYSTEM_NAME} MATCHES FreeBSD)
+  list(APPEND DD_LINKLIBS dl)
----------------
emaste wrote:
> There are a couple of examples of optionally adding -ldl without relying on the system name, in other llvm projects:
> 
> `lib/Support/CMakeLists.txt`:
> ```
>     if( HAVE_LIBDL )
>       set(system_libs ${system_libs} ${CMAKE_DL_LIBS})
> ```
> 
> `projects/libcxxabi/src/Unwind/CMakeLists.txt`:
> ```
> append_if(libraries LIBCXXABI_HAS_DL_LIB dl)
> ```
> 
Yeah, you should use
  append_if(COMPILER_RT_HAS_LIBDL dl DD_LINKLIBS)
we already have COMPILER_RT_HAS_LIBDL defined. Also, while you're here, use COMPILER_RT_HAS_LIBPTHREAD for pthread as well.

http://reviews.llvm.org/D5207






More information about the llvm-commits mailing list