Skip to content

Commit 20f9f1f

Browse files
authored
[Offload][NFCI] Remove coupling to omp target for version scripting (#141637)
Summary: This is a weird dependency on libomp just for testing if version scripts work. We shouldn't need to do this because LLVM already checks for this. I believe this should be available as well in standalone when we call `addLLVM` but I did not test that directly.
1 parent 7e9d708 commit 20f9f1f

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

offload/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,6 @@ else()
322322
endif()
323323
endmacro()
324324

325-
if(OPENMP_STANDALONE_BUILD OR TARGET omp)
326-
# Check LIBOMP_HAVE_VERSION_SCRIPT_FLAG
327-
include(LLVMCheckCompilerLinkerFlag)
328-
if(NOT APPLE)
329-
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)
330-
endif()
331-
endif()
332-
333325
# OMPT support for libomptarget
334326
# Follow host OMPT support and check if host support has been requested.
335327
# 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(LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
18-
target_link_libraries(LLVMOffload PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
17+
if(LLVM_HAVE_LINK_VERSION_SCRIPT)
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: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ target_include_directories(omptarget PRIVATE
4444
${LIBOMPTARGET_INCLUDE_DIR} ${LIBOMPTARGET_BINARY_INCLUDE_DIR}
4545
)
4646

47-
if (LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
48-
target_link_libraries(omptarget PRIVATE
49-
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
47+
if(LLVM_HAVE_LINK_VERSION_SCRIPT)
48+
target_link_libraries(omptarget PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
5049
endif()
5150

5251
# Define the TARGET_NAME and DEBUG_PREFIX.

0 commit comments

Comments
 (0)