zero-to-production
zero-to-production copied to clipboard
update the lld linker path for Darwin
Currently the book (zero2prod_20240903.pdf) says on p.6:
# On MacOS,
brew install llvmand follow steps inbrew 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
https://github.com/LukeMathWalker/zero-to-production/pull/275 was raised previously to fix this.