zero-to-production icon indicating copy to clipboard operation
zero-to-production copied to clipboard

update the lld linker path for Darwin

Open dmitris opened this issue 9 months ago • 1 comments

Currently the book (zero2prod_20240903.pdf) says on p.6:

# On MacOS, brew install llvm and follow steps in brew info llvm [...] [target.aarch64-apple-darwin] rustflags= ["-C", "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld"]

The same path is in https://github.com/LukeMathWalker/zero-to-production/blob/main/.cargo/config.toml#L14

Since now there is a separate 'lld' formula, need to change to brew install lld and th erustflags to have /opt/homebrew/opt/lld/bin/ld64.lld (or just /opt/homebrew/bin/ld64.lld).

$ ls -l /opt/homebrew/opt/llvm/bin/ld64.lld
ls: /opt/homebrew/opt/llvm/bin/ld64.lld: No such file or directory
$ ls -l /opt/homebrew/opt/lld/bin/ld64.lld
lrwxr-xr-x  1 dmitris  admin  3 Jul  9 01:06 /opt/homebrew/opt/lld/bin/ld64.lld -> lld

dmitris avatar Jul 25 '25 08:07 dmitris

https://github.com/LukeMathWalker/zero-to-production/pull/275 was raised previously to fix this.

dmitris avatar Jul 25 '25 14:07 dmitris