From a9e2dee7321150ab70696e8591788741a4a014de Mon Sep 17 00:00:00 2001 From: Ame <104745335+ameknite@users.noreply.github.com> Date: Mon, 6 Feb 2023 18:24:12 +0000 Subject: [PATCH] Change recommended linker: zld to lld for MacOS (#7496) # Objective Stop recommending zld on MacOS Fixes #7299 ## Solution - Add instructions to install lld for MacOS --- .cargo/config_fast_builds | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.cargo/config_fast_builds b/.cargo/config_fast_builds index cfbcd697c8..1432a84b38 100644 --- a/.cargo/config_fast_builds +++ b/.cargo/config_fast_builds @@ -7,13 +7,21 @@ linker = "clang" rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y"] -# NOTE: you must manually install https://github.com/michaeleisel/zld on mac. you can easily do this with the "brew" package manager: -# `brew install michaeleisel/zld/zld` +# NOTE: you must install [Mach-O LLD Port](https://lld.llvm.org/MachO/index.html) on mac. you can easily do this by installing llvm which includes lld with the "brew" package manager: +# `brew install llvm` [target.x86_64-apple-darwin] -rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld", "-Zshare-generics=y"] +rustflags = [ + "-C", + "link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld", + "-Zshare-generics=y", +] [target.aarch64-apple-darwin] -rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/bin/zld", "-Zshare-generics=y"] +rustflags = [ + "-C", + "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld", + "-Zshare-generics=y", +] [target.x86_64-pc-windows-msvc] linker = "rust-lld.exe"