diff --git a/build/build-clang/clang-13-win64.json b/build/build-clang/clang-13-win64.json index c607ea3f267d..ede5a75d5357 100644 --- a/build/build-clang/clang-13-win64.json +++ b/build/build-clang/clang-13-win64.json @@ -15,6 +15,7 @@ "bug47258-extract-symbols-mbcs.patch", "Remove-FlushViewOfFile-when-unmaping-gcda-files.patch", "revert-llvmorg-13-init-7827-g2a078c307204.patch", - "loosen-msvc-detection.patch" + "loosen-msvc-detection.patch", + "win64-no-symlink.patch" ] } diff --git a/build/build-clang/win64-no-symlink.patch b/build/build-clang/win64-no-symlink.patch new file mode 100644 index 000000000000..8924f9f9b1d7 --- /dev/null +++ b/build/build-clang/win64-no-symlink.patch @@ -0,0 +1,30 @@ +diff --git a/llvm/cmake/modules/LLVMInstallSymlink.cmake b/llvm/cmake/modules/LLVMInstallSymlink.cmake +index 3e6a2c9a2648..09fed8085c23 100644 +--- a/llvm/cmake/modules/LLVMInstallSymlink.cmake ++++ b/llvm/cmake/modules/LLVMInstallSymlink.cmake +@@ -4,17 +4,18 @@ + + function(install_symlink name target outdir) + set(DESTDIR $ENV{DESTDIR}) ++ if(CMAKE_HOST_UNIX) ++ set(LINK_OR_COPY create_symlink) ++ else() ++ set(LINK_OR_COPY copy) ++ endif() ++ + set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") + + message(STATUS "Creating ${name}") + + execute_process( +- COMMAND "${CMAKE_COMMAND}" -E create_symlink "${target}" "${name}" +- WORKING_DIRECTORY "${bindir}" ERROR_VARIABLE has_err) +- if(CMAKE_HOST_WIN32 AND has_err) +- execute_process( +- COMMAND "${CMAKE_COMMAND}" -E copy "${target}" "${name}" +- WORKING_DIRECTORY "${bindir}") +- endif() ++ COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "${target}" "${name}" ++ WORKING_DIRECTORY "${bindir}") + + endfunction()