Skip to content

Commit

Permalink
Use lld instead of lld-link when using clang
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Dec 23, 2024
1 parent fcc0f78 commit 2a1f5b5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/compiler/clang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Clang {
let sysroot_dir =
adjust_canonicalization(msvc_sysroot_dir.to_slash_lossy().to_string());
let clang_flags = format!(
"--target={target_no_vendor} -fuse-ld=lld-link -I{dir}/include -I{dir}/include/c++/stl -L{dir}/lib/{target_unknown_vendor}",
"--target={target_no_vendor} -fuse-ld=lld -I{dir}/include -I{dir}/include/c++/stl -L{dir}/lib/{target_unknown_vendor}",
dir = sysroot_dir,
);
cmd.env(
Expand All @@ -84,8 +84,6 @@ impl Clang {

let mut rustflags = get_rustflags(&workdir, target)?.unwrap_or_default();
rustflags.flags.extend([
"-C".to_string(),
"linker-flavor=lld-link".to_string(),
"-C".to_string(),
"link-arg=-defaultlib:oldnames".to_string(),
]);
Expand Down Expand Up @@ -263,18 +261,16 @@ set(CMAKE_SYSTEM_PROCESSOR {processor})
set(CMAKE_C_COMPILER clang CACHE FILEPATH "")
set(CMAKE_CXX_COMPILER clang++ CACHE FILEPATH "")
set(CMAKE_LINKER lld-link CACHE FILEPATH "")
set(CMAKE_RC_COMPILER llvm-rc CACHE FILEPATH "")
set(COMPILE_FLAGS
--target={target_no_vendor}
-fuse-ld=lld-link
-fuse-ld=lld
-I{dir}/include
-I{dir}/include/c++/stl)
set(LINK_FLAGS
/manifest:no
-libpath:"{dir}/lib/{target_unknown_vendor}")
-L"{dir}/lib/{target_unknown_vendor}")
"#,
dir = sysroot_dir,
);
Expand Down

0 comments on commit 2a1f5b5

Please sign in to comment.