Skip to content

Darwin: cross compilation of glibc fails #80754

@mroi

Description

@mroi

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_LDFLAGS appears 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_LDFLAGS should not be passed to linkers targeting non-Darwin platforms, because they would not understand the -macosx_version_min options.

Metadata

  • system: "x86_64-darwin"
  • host os: Darwin 19.4.0, macOS 10.15.4
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 2.3.3
  • channels(Michael): "nixpkgs-20.09pre214168.686274ea62c"
  • nixpkgs: /Users/Michael/.nix-defexpr/channels/nixpkgs

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: cross-compilationBuilding packages on a different platform than they will be used on6.topic: darwinRunning or building packages on Darwin

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions