Skip to content

Commit 08f2e10

Browse files
committed
Revert "[Offload][NFCI] Remove coupling to omp target for version scripting (llvm#141637)"
breaks offload build ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol 'ffi_type_float'; recompile with -fPIC >>> defined in /usr/lib/x86_64-linux-gnu/libffi.a(types.o) This reverts commit 20f9f1f.
1 parent d83ae98 commit 08f2e10

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

offload/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,14 @@ else()
350350
endif()
351351
endmacro()
352352

353+
if(OPENMP_STANDALONE_BUILD OR TARGET omp)
354+
# Check LIBOMP_HAVE_VERSION_SCRIPT_FLAG
355+
include(LLVMCheckCompilerLinkerFlag)
356+
if(NOT APPLE)
357+
llvm_check_compiler_linker_flag(C "-Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/../openmp/runtime/src/exports_test_so.txt" LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
358+
endif()
359+
endif()
360+
353361
# OMPT support for libomptarget
354362
# Follow host OMPT support and check if host support has been requested.
355363
# LIBOMP_HAVE_OMPT_SUPPORT indicates whether host OMPT support has been implemented.

offload/liboffload/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ foreach(plugin IN LISTS LIBOMPTARGET_PLUGINS_TO_BUILD)
1414
target_link_libraries(LLVMOffload PRIVATE omptarget.rtl.${plugin})
1515
endforeach()
1616

17-
if(LLVM_HAVE_LINK_VERSION_SCRIPT)
18-
target_link_libraries(LLVMOffload PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
17+
if(LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
18+
target_link_libraries(LLVMOffload PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
1919
endif()
2020

2121
target_include_directories(LLVMOffload PUBLIC

offload/libomptarget/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ target_include_directories(omptarget PRIVATE
4646
${LIBOMPTARGET_INCLUDE_DIR} ${LIBOMPTARGET_BINARY_INCLUDE_DIR}
4747
)
4848

49-
if(LLVM_HAVE_LINK_VERSION_SCRIPT)
50-
target_link_libraries(omptarget PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
49+
if (LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
50+
target_link_libraries(omptarget PRIVATE
51+
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
5152
endif()
5253

5354
# Don't override an externally defined RPATH

0 commit comments

Comments
 (0)