nix: Go around a linker issue on Darwin (#58070)

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Release Notes:

- N/A
This commit is contained in:
Jakub Konka 2026-05-29 14:22:37 +02:00 committed by GitHub
parent f49be143f3
commit 81f818aa86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,6 +38,7 @@
libxfixes,
libxkbcommon,
libxrandr,
lld,
libx11,
libxcb,
nodejs_22,
@ -137,6 +138,8 @@ let
]
++ lib.optionals stdenv'.hostPlatform.isLinux [ makeWrapper ]
++ lib.optionals stdenv'.hostPlatform.isDarwin [
# Provides `ld64.lld` for clang's `-fuse-ld=lld`.
lld
(cargo-bundle.overrideAttrs (
new: old: {
version = "0.6.1-zed";
@ -246,6 +249,11 @@ let
}";
NIX_OUTPATH_USED_AS_RANDOM_SEED = "norebuilds";
}
// lib.optionalAttrs stdenv'.hostPlatform.isDarwin {
# Link with lld on Darwin. nixpkgs' classic open-source ld64 fails to insert
# ARM64 branch thunks for this binary, producing `b(l) ARM64 branch out of range`.
NIX_CFLAGS_LINK = "-fuse-ld=lld";
};
# prevent nix from removing the "unused" wayland/gpu-lib rpaths