Skip to content

[opencl-aot][sycl][CMake][MSVC]: Wrap Linker flags for ICX #15756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion opencl/opencl-aot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ add_llvm_tool(${OPENCL_AOT_PROJECT_NAME} ${TARGET_SOURCES})

if (WIN32)
# 0x2000: exclude CWD from DLL loading path
target_link_options(${OPENCL_AOT_PROJECT_NAME} PRIVATE "/DEPENDENTLOADFLAG:0x2000")
target_link_options(${OPENCL_AOT_PROJECT_NAME} PRIVATE "LINKER:/DEPENDENTLOADFLAG:0x2000")
endif()

if(NOT MSVC)
Expand Down
4 changes: 2 additions & 2 deletions sycl/cmake/modules/SYCLUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ include(CheckLinkerFlag)
# file as ${ARG_TARGET_NAME}.pdb in bin folder.
# NOTE: LLD does not currently support /PDBSTRIPPED so the PDB file is optional.
macro(add_stripped_pdb ARG_TARGET_NAME)
check_linker_flag(CXX "/PDBSTRIPPED:${ARG_TARGET_NAME}.stripped.pdb"
check_linker_flag(CXX "LINKER:/PDBSTRIPPED:${ARG_TARGET_NAME}.stripped.pdb"
LINKER_SUPPORTS_PDBSTRIPPED)
if(LINKER_SUPPORTS_PDBSTRIPPED)
target_link_options(${ARG_TARGET_NAME}
PRIVATE "/PDBSTRIPPED:${ARG_TARGET_NAME}.stripped.pdb")
PRIVATE "LINKER:/PDBSTRIPPED:${ARG_TARGET_NAME}.stripped.pdb")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${ARG_TARGET_NAME}.stripped.pdb"
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
RENAME "${ARG_TARGET_NAME}.pdb"
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
# Embed manifest into the sycl.dll where ur_win_proxy_loader.dll is described as sycl.dll's private dll and will always be loaded from the same directory.
# 0x2000: LOAD_LIBRARY_SAFE_CURRENT_DIRS flag. Using this flag means that loading dependency DLLs (of sycl.dll)
# from the current directory is only allowed if it is under a directory in the Safe load list.
target_link_options(${LIB_NAME} PRIVATE /DEPENDENTLOADFLAG:0x2000 /MANIFEST:NO /MANIFEST:EMBED /MANIFESTINPUT:${CMAKE_CURRENT_SOURCE_DIR}/${MANIFEST_FILE_NAME})
target_link_options(${LIB_NAME} PRIVATE "LINKER:/DEPENDENTLOADFLAG:0x2000" "LINKER:/MANIFEST:NO" "LINKER:/MANIFEST:EMBED" "LINKER:/MANIFESTINPUT:${CMAKE_CURRENT_SOURCE_DIR}/${MANIFEST_FILE_NAME}")
endif()

target_compile_definitions(${LIB_OBJ_NAME} PRIVATE __SYCL_INTERNAL_API )
Expand Down
2 changes: 1 addition & 1 deletion sycl/tools/sycl-ls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ target_link_libraries(sycl-ls
)
if (WIN32)
# 0x900: Search for the dependency DLLs only in the System32 directory and in the directory with sycl-ls.exe
target_link_options(sycl-ls PRIVATE /DEPENDENTLOADFLAG:0x900)
target_link_options(sycl-ls PRIVATE LINKER:/DEPENDENTLOADFLAG:0x900)
endif()
install(TARGETS sycl-ls
RUNTIME DESTINATION "bin" COMPONENT sycl-ls)
4 changes: 2 additions & 2 deletions sycl/ur_win_proxy_loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ if (MSVC)
target_link_libraries(ur_win_proxy_loader PRIVATE shlwapi)
# 0x2000: LOAD_LIBRARY_SAFE_CURRENT_DIRS flag. Using this flag means that loading dependency DLLs
# from the current directory is only allowed if it is under a directory in the Safe load list.
target_link_options(ur_win_proxy_loaderd PRIVATE /DEPENDENTLOADFLAG:0x2000)
target_link_options(ur_win_proxy_loader PRIVATE /DEPENDENTLOADFLAG:0x2000)
target_link_options(ur_win_proxy_loaderd PRIVATE LINKER:/DEPENDENTLOADFLAG:0x2000)
target_link_options(ur_win_proxy_loader PRIVATE LINKER:/DEPENDENTLOADFLAG:0x2000)
install(TARGETS ur_win_proxy_loaderd
RUNTIME DESTINATION "bin" COMPONENT ur_win_proxy_loader)
endif()
Loading