Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ld.lld no longer packaged with llvm (brew) #431

Open
DragonStar373 opened this issue Dec 30, 2024 · 1 comment · May be fixed by #436
Open

ld.lld no longer packaged with llvm (brew) #431

DragonStar373 opened this issue Dec 30, 2024 · 1 comment · May be fixed by #436

Comments

@DragonStar373
Copy link

When compiling on a native M-Series machine, make looks for ld in /opt/homebrew/opt/llvm/bin/ld.lld, but ld is no longer packaged with llvm by brew and instead requires it to be installed as a second package.

INFO: Building on Darwin
INFO: Toolchain path: /opt/homebrew/opt/llvm/bin/
  LD    build/m1n1.elf
make: /opt/homebrew/opt/llvm/bin/ld.lld: No such file or directory

To put it lightly, this is not very cashmoney. (I've compiled like 5 things in my lifetime and don't exactly know what I'm doing)

@sukunahun
Copy link

Download the LLVM build it and then Run the following command
ln -s ~/llvm-project(yourLLVMDirctory)/build/bin/ /opt/homebrew/opt/llvm/bin/
It works for me it will work for your also

alxdrl added a commit to alxdrl/m1n1 that referenced this issue Feb 1, 2025
On macOS with current version of Homebrew clang and ld.lld comes from
separate packages, the assumptions for the linker path does not hold
anymore and the linking fails.

Fix by using distinct variables in Makefile for clang and ld.lld:

- TOOLCHAIN: remove the check for `uname -p` and use `brew --prefix`
  output instead of hardcoded path
- add a LLDDIR variable to allow for specific ld.ldd location
- LLDDIR: use TOOLCHAIN value if ld.lld is found there, use the output
  of `brew --prefix lld` otherwise
- LD: use LLDIR instead of TOOLCHAIN

Fixes: AsahiLinux#431

Signed-off-by: Alexis Deruelle <[email protected]>
@alxdrl alxdrl linked a pull request Feb 1, 2025 that will close this issue
alxdrl added a commit to alxdrl/m1n1 that referenced this issue Feb 1, 2025
On macOS with current version of Homebrew clang and ld.lld comes from
separate packages, the assumptions for the linker path does not hold
anymore and the linking fails.

Fix by using distinct variables in Makefile for clang and ld.lld:

- TOOLCHAIN: remove the check for `uname -p` and use `brew --prefix`
  output instead of hardcoded path
- add a LLDDIR variable to allow for specific ld.ldd location
- LLDDIR: use TOOLCHAIN value if ld.lld is found there, use the output
  of `brew --prefix lld` otherwise
- LD: use LLDIR instead of TOOLCHAIN

Fixes: AsahiLinux#431

Signed-off-by: Alexis Deruelle <[email protected]>
alxdrl added a commit to alxdrl/m1n1 that referenced this issue Feb 1, 2025
On macOS with current version of Homebrew clang and ld.lld comes from
separate packages, the assumptions for the linker path does not hold
anymore and the linking fails.

Fix by using distinct variables in Makefile for clang and ld.lld:

- TOOLCHAIN: remove the check for `uname -p` and use `brew --prefix`
  output instead of hardcoded path
- add a LLDDIR variable to allow for specific ld.ldd location
- LLDDIR: use TOOLCHAIN value if ld.lld is found there, use the output
  of `brew --prefix lld` otherwise
- LD: use LLDIR instead of TOOLCHAIN

Fixes: AsahiLinux#431

Signed-off-by: Alexis Deruelle <[email protected]>
alxdrl added a commit to alxdrl/m1n1 that referenced this issue Feb 1, 2025
On macOS with current version of Homebrew clang and ld.lld comes from
separate packages, the assumptions for the linker path does not hold
anymore and the linking fails.

Fix by using distinct variables in Makefile for clang and ld.lld:

- TOOLCHAIN: remove the check for `uname -p` and use `brew --prefix`
  output instead of hardcoded path
- add a LLDDIR variable to allow for specific ld.ldd location
- LLDDIR: use TOOLCHAIN value if ld.lld is found there, use the output
  of `brew --prefix lld` otherwise
- LD: use LLDIR instead of TOOLCHAIN

Fixes: AsahiLinux#431 # Veuillez saisir le message de validation pour vos
alxdrl added a commit to alxdrl/m1n1 that referenced this issue Feb 1, 2025
On macOS with current version of Homebrew clang and ld.lld comes from
separate packages, the assumptions for the linker path does not hold
anymore and the linking fails.

Fix by using distinct variables in Makefile for clang and ld.lld:

- TOOLCHAIN: remove the check for `uname -p` and use `brew --prefix`
  output instead of hardcoded path
- add a LLDDIR variable to allow for specific ld.ldd location
- LLDDIR: use TOOLCHAIN value if ld.lld is found there, use the output
  of `brew --prefix lld` otherwise
- LD: use LLDIR instead of TOOLCHAIN

Fixes: AsahiLinux#431 # Veuillez saisir le message de validation pour vos
alxdrl added a commit to alxdrl/m1n1 that referenced this issue Feb 1, 2025
On macOS with current version of Homebrew clang and ld.lld comes from
separate packages, the assumptions for the linker path does not hold
anymore and the linking fails.

Fix by using distinct variables in Makefile for clang and ld.lld:

- TOOLCHAIN: remove the check for `uname -p` and use `brew --prefix`
  output instead of hardcoded path
- add a LLDDIR variable to allow for specific ld.ldd location
- LLDDIR: use TOOLCHAIN value if ld.lld is found there, use the output
  of `brew --prefix lld` otherwise
- LD: use LLDIR instead of TOOLCHAIN

Fixes: AsahiLinux#431 # Veuillez saisir le message de validation pour vos
Signed-off-by: Alexis Deruelle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants