[llvm] 3500d3b - [llvm-exegesis] Explicitly link llvm-exegesis unit tests against librt

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 13:27:53 PDT 2023


Author: Aiden Grossman
Date: 2023-06-26T20:27:36Z
New Revision: 3500d3ba1cd97df58776a79ed61e0d1946a085c2

URL: https://github.com/llvm/llvm-project/commit/3500d3ba1cd97df58776a79ed61e0d1946a085c2
DIFF: https://github.com/llvm/llvm-project/commit/3500d3ba1cd97df58776a79ed61e0d1946a085c2.diff

LOG: [llvm-exegesis] Explicitly link llvm-exegesis unit tests against librt

On some platforms such as PPC shm_open is in librt and it isn't
automatically linked against. This patch explicitly links against librt
in the unittests which should hopefully fix the symbol resolution
errors.

Added: 
    

Modified: 
    llvm/unittests/tools/llvm-exegesis/X86/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/tools/llvm-exegesis/X86/CMakeLists.txt b/llvm/unittests/tools/llvm-exegesis/X86/CMakeLists.txt
index bf8951f3b1148..29100265bbd05 100644
--- a/llvm/unittests/tools/llvm-exegesis/X86/CMakeLists.txt
+++ b/llvm/unittests/tools/llvm-exegesis/X86/CMakeLists.txt
@@ -26,6 +26,12 @@ add_llvm_exegesis_unittest_link_components(
   X86
   )
 
+set(libs)
+if(HAVE_LIBRT)
+  list(APPEND libs rt)
+endif()
+
 add_llvm_exegesis_unittest_link_libraries(
   LLVMExegesisX86
+  ${libs}
   )


        


More information about the llvm-commits mailing list