[llvm-branch-commits] [openmp] 26e2c97 - [openmp] [elf_common] Fix linking against LLVM dylib

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Oct 27 08:35:33 PDT 2021


Author: Michał Górny
Date: 2021-10-27T08:35:14-07:00
New Revision: 26e2c97bf14c1105f8db3a087ea8994c776a18bc

URL: https://github.com/llvm/llvm-project/commit/26e2c97bf14c1105f8db3a087ea8994c776a18bc
DIFF: https://github.com/llvm/llvm-project/commit/26e2c97bf14c1105f8db3a087ea8994c776a18bc.diff

LOG: [openmp] [elf_common] Fix linking against LLVM dylib

The hand-rolled linking logic in elf_common does not account for
the possibility of using LLVM dylib rather than a dozen static
libraries.  Since it does not seem to be easily convertible
to add_llvm_library, just hand-roll support for LLVM_LINK_LLVM_DYLIB.
This is necessary to support stand-alone builds against installed LLVM.

Differential Revision: https://reviews.llvm.org/D111038

(cherry picked from commit 0873b9bef4e03b4cfc44a4946c11103c763055df)

Added: 
    

Modified: 
    openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt b/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
index aad2e14318e05..457aab968556e 100644
--- a/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
+++ b/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
@@ -16,6 +16,9 @@ add_library(elf_common OBJECT elf_common.cpp)
 set_property(TARGET elf_common PROPERTY POSITION_INDEPENDENT_CODE ON)
 llvm_update_compile_flags(elf_common)
 set(LINK_LLVM_LIBS LLVMBinaryFormat LLVMObject LLVMSupport)
+if (LLVM_LINK_LLVM_DYLIB)
+  set(LINK_LLVM_LIBS LLVM)
+endif()
 target_link_libraries(elf_common INTERFACE ${LINK_LLVM_LIBS})
 include_directories(${LIBOMPTARGET_LLVM_INCLUDE_DIRS})
 add_dependencies(elf_common ${LINK_LLVM_LIBS})


        


More information about the llvm-branch-commits mailing list