[Openmp-commits] [openmp] 836992a - [NFC][libomptarget] Build elf_common with PIC.

Vyacheslav Zakharin via Openmp-commits openmp-commits at lists.llvm.org
Fri Jun 18 09:21:26 PDT 2021


Author: Vyacheslav Zakharin
Date: 2021-06-18T09:20:10-07:00
New Revision: 836992ab9a42b8b5f6cb0339b98d31f46794af7e

URL: https://github.com/llvm/llvm-project/commit/836992ab9a42b8b5f6cb0339b98d31f46794af7e
DIFF: https://github.com/llvm/llvm-project/commit/836992ab9a42b8b5f6cb0339b98d31f46794af7e.diff

LOG: [NFC][libomptarget] Build elf_common with PIC.

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

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 f588053d8818..9dfc969c4575 100644
--- a/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
+++ b/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
@@ -12,6 +12,8 @@
 
 add_library(elf_common OBJECT elf_common.cpp)
 
+# Build elf_common with PIC to be able to link it with plugin shared libraries.
+set_property(TARGET elf_common PROPERTY POSITION_INDEPENDENT_CODE ON)
 llvm_update_compile_flags(elf_common)
 set(LINK_LLVM_LIBS LLVMBinaryFormat LLVMObject LLVMSupport)
 target_link_libraries(elf_common INTERFACE ${LINK_LLVM_LIBS} ${LIBOMPTARGET_DEP_LIBELF_LIBRARIES})


        


More information about the Openmp-commits mailing list