[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.
This commit is contained in:
Joseph Huber 2025-05-27 13:43:07 -05:00 committed by GitHub
parent 7e9d708be0
commit 20f9f1fc02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 13 deletions

View File

@ -322,14 +322,6 @@ else()
endif()
endmacro()
if(OPENMP_STANDALONE_BUILD OR TARGET omp)
# Check LIBOMP_HAVE_VERSION_SCRIPT_FLAG
include(LLVMCheckCompilerLinkerFlag)
if(NOT APPLE)
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)
endif()
endif()
# OMPT support for libomptarget
# Follow host OMPT support and check if host support has been requested.
# LIBOMP_HAVE_OMPT_SUPPORT indicates whether host OMPT support has been implemented.

View File

@ -14,8 +14,8 @@ foreach(plugin IN LISTS LIBOMPTARGET_PLUGINS_TO_BUILD)
target_link_libraries(LLVMOffload PRIVATE omptarget.rtl.${plugin})
endforeach()
if(LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
target_link_libraries(LLVMOffload PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
if(LLVM_HAVE_LINK_VERSION_SCRIPT)
target_link_libraries(LLVMOffload PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
endif()
target_include_directories(LLVMOffload PUBLIC

View File

@ -44,9 +44,8 @@ target_include_directories(omptarget PRIVATE
${LIBOMPTARGET_INCLUDE_DIR} ${LIBOMPTARGET_BINARY_INCLUDE_DIR}
)
if (LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
target_link_libraries(omptarget PRIVATE
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
if(LLVM_HAVE_LINK_VERSION_SCRIPT)
target_link_libraries(omptarget PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
endif()
# Define the TARGET_NAME and DEBUG_PREFIX.