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

stage.nix: revert deletion of gcc.abi="elfv2" from 82ff1f5 #191436

Merged
merged 1 commit into from Sep 27, 2022
Merged

stage.nix: revert deletion of gcc.abi="elfv2" from 82ff1f5 #191436

merged 1 commit into from Sep 27, 2022

Conversation

ghost
Copy link

@ghost ghost commented Sep 16, 2022

CC: @OPNA2608 @Mindavi @minijackson

Description of changes

Commit 82ff1f5 in #182807 removed two lines from stage.nix which were responsible for making sure the gcc for pkgsStatic on powerpc64 was built with the --with-abi=elfv2 flag.

Unfortunately this causes build failures for pkgsCross.ppc64.pkgsStatic, as reported here:

#182807 (comment)

This commit reverts the deletion.

Unfortunately ugly kludges like this are necessary because nixpkgs' lib/systems/ doesn't understand the difference between a libc and an abi. So we have no clean way to tell nixpkgs "musl on big-endian powerpc64 always uses the ELFv2 ABI" -- it thinks that musl is an ABI. Until that gets fixed there is no better way to add the flag.

Things done
  • Built on platform(s)
    • powerpc64le-linux (cross to powerpc64-linux)
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Commit 82ff1f5 in #182807 removed two lines
from stage.nix which were responsible for making sure the `gcc` for `pkgsStatic`
on powerpc64 was built with the `--with-abi=elfv2` flag.

Unfortunately this causes build failures for `pkgsCross.ppc64.pkgsStatic`, as
reported here:

  #182807 (comment)

This commit reverts the deletion.

Unfortunately ugly kludges like this are necessary because nixpkgs'
`lib/systems/` doesn't understand the difference between a libc and an abi.  So
we have no clean way to tell nixpkgs "musl on big-endian powerpc64 always uses
the ELFv2 ABI" -- it thinks that musl is an ABI.  Until that gets fixed there is
no better way to add the flag.
Copy link
Member

@minijackson minijackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it with nix build 'github:NixOS/nixpkgs/pull/191436/head#pkgsCross.ppc64.pkgsStatic.busybox' at it works great again. Sorry about the flop, I somehow thought that musl would auto-select the ELFv2 ABI, but forgot to test it...

@ghost
Copy link
Author

ghost commented Sep 16, 2022

Not your fault, I missed it too.

Copy link
Contributor

@OPNA2608 OPNA2608 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply. Cherry-picked this on my ppc64 machine and tested pkgsStatic.hello and busybox-sandbox-shell (a static busybox that nix depends on) as well as nixStatic, LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants