Skip to content

Commit 71e3082

Browse files
committed
[OpenMP] Enable position independent code for libomptarget
Summary: This option used to be passed manually by the `-fPIC` option that was always enabled by the LLVM flags. Since we now do this manually we want to specify that these are supposed for use fPIC code.
1 parent 4b7beab commit 71e3082

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

openmp/libomptarget/plugins-nextgen/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "${tmachine}$")
7070
LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}")
7171
set_target_properties("omptarget.rtl.${tmachine_libname}" PROPERTIES
7272
INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/.."
73+
POSITION_INDEPENDENT_CODE ON
7374
CXX_VISIBILITY_PRESET protected)
7475

7576
target_include_directories( "omptarget.rtl.${tmachine_libname}" PRIVATE

openmp/libomptarget/src/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,8 @@ endif()
4646

4747
# libomptarget.so needs to be aware of where the plugins live as they
4848
# are now separated in the build directory.
49-
set_target_properties(omptarget PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/..")
49+
set_target_properties(omptarget PROPERTIES
50+
POSITION_INDEPENDENT_CODE ON
51+
INSTALL_RPATH "$ORIGIN"
52+
BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/..")
5053
install(TARGETS omptarget LIBRARY COMPONENT omptarget DESTINATION "${OPENMP_INSTALL_LIBDIR}")

0 commit comments

Comments
 (0)