Repository navigation
lix: fix build on darwin - #568529
Merged
Merged
lix: fix build on darwin#568529
Conversation
97bf56b ("lix: link with -z,noexecstack") sets NIX_LDFLAGS to "-z,noexecstack" on every platform. cc-wrapper prefixes each word of NIX_LDFLAGS with -Wl, so clang hands `-z noexecstack` to the linker, and Apple's ld64 has no -z option. Meson's compiler sanity check then fails to link, and every Lix in lixPackageSets fails to build on aarch64-darwin: https://hydra.nixos.org/build/347153371 Mach-O does not need the flag: ld64 leaves stacks non-executable unless -allow_stack_execute is passed. lib.optionalString keeps the value unchanged on ELF platforms, so no Linux derivation changes. Assisted-by: Claude Code (Claude Opus 5.5)
3 of 5 tasks
RaitoBezarius
approved these changes
Sep 30, 2026
MacroPower
added a commit
to MacroPower/dotfiles
that referenced
this pull request
Oct 1, 2026
nixpkgs 97bf56b78 links every lix build with -z,noexecstack. Apple's ld64 rejects -z, so meson's compiler check fails on darwin and the Mac cannot build the pinned lix 2.94.2. Hydra hits the same failure, so the binary cache has no darwin output either. Upstream fixed this in NixOS/nixpkgs#568529 by limiting the flag to ELF targets. This overlay mirrors that fix for the pinned revision on darwin only, so Linux hosts keep their cached lix. Drop it once the nixpkgs pin includes 31a68c07f.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A previous PR for libucontext here broke Lix for everybody on Apple, by setting
NIX_LDFLAGS = "-z,noexecstack"on every platform (but Apple's ld64 doesn't have a-zoption. Hence, Lix then fails to build on aarch64-darwin.This fixes the issue, by setting the flag for ELF platforms only. Verified with
nix-build -A lixsucceeding on aarch64-darwin after, includinginstallCheckPhase.cc @RaitoBezarius
Disclosure: I used AI to help with the investigation of this fix, and for the fix.