[PATCH] D16940: Fix build LLVM with -D LLVM_USE_INTEL_JITEVENTS:BOOL=ON on Windows

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 17:04:03 PST 2016


andrew.w.kaylor created this revision.
andrew.w.kaylor added reviewers: rafael, lhames.
andrew.w.kaylor added a subscriber: llvm-commits.
andrew.w.kaylor set the repository for this revision to rL LLVM.

This patch updates the CMakeLists.txt file for the LLVM Intel JIT event listener to fix a problem I encountered when building on Windows.  It also incorporates changes from D16883 which I was preparing for commit when I encountered the Windows problem (see https://llvm.org/bugs/show_bug.cgi?id=26433).

Rafael, I am asking you to review this because you authored the previous change which introduced the pthread and libdl dependencies (which are needed on Linux but cause failures on Windows).  I've tested this on Windows and on Linux (with and without the -DBUILD_SHARED_LIBS=ON option on Linux), but I'm always finding new subtleties in the build system that I've overlooked so I figure it's worth having you take a look to make sure I didn't re-break something you fixed with the previous change.

I'm hoping these changes can be made in the 3.8 branch as well.

Repository:
  rL LLVM

http://reviews.llvm.org/D16940

Files:
  lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt

Index: lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
===================================================================
--- lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
+++ lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
@@ -1,8 +1,18 @@
 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
 
+set(LLVM_INTEL_JIT_LIBS)
+if( HAVE_LIBDL )
+    set(LLVM_INTEL_JIT_LIBS ${CMAKE_DL_LIBS})
+endif()
+if( HAVE_LIBPTHREAD )
+    set(LLVM_INTEL_JIT_LIBS pthread ${LLVM_INTEL_JIT_LIBS})
+endif()
+
 add_llvm_library(LLVMIntelJITEvents
   IntelJITEventListener.cpp
   jitprofiling.c
 
-  LINK_LIBS pthread ${CMAKE_DL_LIBS}
+  LINK_LIBS ${LLVM_INTEL_JIT_LIBS}
 )
+
+add_dependencies(LLVMIntelJITEvents intrinsics_gen)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16940.47065.patch
Type: text/x-patch
Size: 739 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160206/ede33ce5/attachment.bin>


More information about the llvm-commits mailing list