-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Darwin: cross compilation of glibc fails #80754
Copy link
Copy link
Closed
Labels
0.kind: bugSomething is brokenSomething is broken6.topic: cross-compilationBuilding packages on a different platform than they will be used onBuilding packages on a different platform than they will be used on6.topic: darwinRunning or building packages on DarwinRunning or building packages on Darwin
Metadata
Metadata
Assignees
Labels
0.kind: bugSomething is brokenSomething is broken6.topic: cross-compilationBuilding packages on a different platform than they will be used onBuilding packages on a different platform than they will be used on6.topic: darwinRunning or building packages on DarwinRunning or building packages on Darwin
Fields
Give feedbackNo fields configured for issues without a type.
Describe the bug
I was trying to build a Linux cross compiler on Darwin, but it fails when configuring glibc.
To Reproduce
Steps to reproduce the behavior:
nix-build -A pkgsCross.gnu64.glibc '<nixpkgs>'Expected behavior
Cross-compiled glibc should be built.
Additional context
I believe this is related to #77632. Commendable work has been done there, but the passing of macOS-specific linker options in
NIX_LDFLAGSappears to be problematic for cross builds.I am not knowledgeable enough about Nix’ cross compilation infrastructure to fully diagnose the problem, let alone suggest a fix. But I think
NIX_LDFLAGSshould not be passed to linkers targeting non-Darwin platforms, because they would not understand the-macosx_version_minoptions.Metadata
"x86_64-darwin"Darwin 19.4.0, macOS 10.15.4noyesnix-env (Nix) 2.3.3"nixpkgs-20.09pre214168.686274ea62c"/Users/Michael/.nix-defexpr/channels/nixpkgs