Skip to content

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

Merged
Mindavi merged 1 commit intomasterfrom
unknown repository
Sep 27, 2022
Merged

stage.nix: revert deletion of gcc.abi="elfv2" from 82ff1f5#191436
Mindavi merged 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@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.

@ghost ghost requested review from Ericson2314, matthewbauer and nbp as code owners September 16, 2022 03:38
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.
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Sep 16, 2022
Copy link
Copy Markdown
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
Copy Markdown
Author

ghost commented Sep 16, 2022

Not your fault, I missed it too.

@bobby285271 bobby285271 added the 12.approvals: 1 This PR was reviewed and approved by one person. label Sep 16, 2022
Copy link
Copy Markdown
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.

@bobby285271 bobby285271 added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Sep 24, 2022
@Mindavi Mindavi merged commit 33bc076 into NixOS:master Sep 27, 2022
@ghost ghost deleted the pr/fix182807 branch September 30, 2022 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants