[PATCH] D21478: [build] Link main executable with libpthread

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 14:47:14 PDT 2016


beanz accepted this revision.
beanz added a comment.
This revision is now accepted and ready to land.

One comment below that needs attention. Otherwise LGTM.


================
Comment at: cmake/config-ix.cmake:114
@@ -114,1 +113,3 @@
+  find_package(Threads REQUIRED)
+  set(PTHREAD_LIB ${CMAKE_THREAD_LIBS_INIT})
 endif()
----------------
I'm a little concerned about the use of `CMAKE_THREAD_LIBS_INIT` here. That isn't guaranteed to be pthreads even if we have libpthread. On systems with other thread libraries I believe it prefers the system native library.

I think if you set `CMAKE_THREAD_PREFER_PTHREAD` that will force it to prefer pthreads over a system threading library.


http://reviews.llvm.org/D21478





More information about the llvm-commits mailing list