llvm-msvc icon indicating copy to clipboard operation
llvm-msvc copied to clipboard

How to use msvc-link when linking?

Open icls1337 opened this issue 1 year ago • 5 comments

With the clang command

icls1337 avatar Sep 21 '23 04:09 icls1337

image

shortcut link.exe to msvc linker instead of using the installed linker which is llvm linker.

CR3Swapper avatar Sep 21 '23 04:09 CR3Swapper

image

shortcut link.exe to msvc linker instead of using the installed linker which is llvm linker.

can you name the command used at compile time? I tried /clang:-fuse-ld=link . and more

icls1337 avatar Sep 21 '23 04:09 icls1337

lld-link must be used together in the future, so there are no plans to provide an option to use link.exe. A simple method is to rename link.exe to lld-link.exe. then replace.

gmh5225 avatar Sep 21 '23 05:09 gmh5225

Regarding other libs compiled by MSVC. I recommend you to turn off /GL

gmh5225 avatar Sep 21 '23 06:09 gmh5225

https://learn.microsoft.com/en-us/answers/questions/733176/how-to-link-progs-with-msvcs-link-exe-instead-of-l

hzqst avatar Oct 11 '23 12:10 hzqst