[llvm] e1b5826 - [LLVM][CMake][MSVC] Wrap linker options for ICX with LLVM_BUILD_INSTUMENTED (#124573)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 28 04:49:41 PST 2025
Author: Mészáros Gergely
Date: 2025-01-28T13:49:37+01:00
New Revision: e1b5826c2b9dafbdf627b2abbf0157ae12306657
URL: https://github.com/llvm/llvm-project/commit/e1b5826c2b9dafbdf627b2abbf0157ae12306657
DIFF: https://github.com/llvm/llvm-project/commit/e1b5826c2b9dafbdf627b2abbf0157ae12306657.diff
LOG: [LLVM][CMake][MSVC] Wrap linker options for ICX with LLVM_BUILD_INSTUMENTED (#124573)
RFC:
https://discourse.llvm.org/t/rfc-cmake-linker-flags-need-wl-equivalent-for-intel-c-icx-on-windows/82446
The Intel C++ Compiler (ICX) passes linker flags through the driver
unlike MSVC and clang-cl, and therefore needs them to be prefixed with
`/Qoption,link` (the equivalent of `-Wl,` for gcc on *nix).
Previous PRs did not catch this because I did not try building with
`LLVM_BUILD_INSTRUMENTED=ON`.
`CMAKE_CXX_LINKER_WRAPPER_FLAG` is empty for plain clang-cl (icx on
windows behaves as clang-cl), so this is NFC for clang-cl.
Added:
Modified:
llvm/cmake/modules/HandleLLVMOptions.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 636622d146505e..5db06ccdadbebf 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -1212,7 +1212,7 @@ if (CLANG_CL AND (LLVM_BUILD_INSTRUMENTED OR LLVM_USE_SANITIZER))
endif()
file(TO_CMAKE_PATH "${clang_compiler_rt_file}" clang_compiler_rt_file)
get_filename_component(clang_runtime_dir "${clang_compiler_rt_file}" DIRECTORY)
- prepend("/libpath:\"${clang_runtime_dir}\""
+ prepend("${CMAKE_CXX_LINKER_WRAPPER_FLAG}/libpath:\"${clang_runtime_dir}\""
CMAKE_EXE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS)
More information about the llvm-commits
mailing list