Skip to content

update the lld linker path for Darwin #277

@dmitris

Description

@dmitris

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions