llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.97k stars 11.94k forks source link

LLVM_USE_LINKER should use --ld-path= instead of -fuse-ld= #53565

Open brechtsanders opened 2 years ago

brechtsanders commented 2 years ago

When building 13.0.0 with CMake variable CMAKE_CXX_COMPILER set to clang (also version 13.0.0) and LLVM_USE_LINKER set to ld.lld.exe (also version 13.0.0) the following warning shows up:

clang-13: warning: '-fuse-ld=' taking a path is deprecated. Use '--ld-path=' instead [-Wfuse-ld-path]

So somewhere in the CMake configuration something needs to be changed to avoid this warning.

The build works fine though and the error can be avoided by adding -fuse-ld=lld to CMAKE_CXX_FLAGS and not setting LLVM_USE_LINKER.

keith commented 2 years ago

I started working on this a while back https://reviews.llvm.org/D113166