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

lib/systems/platforms.nix: fix broken mips32 detection #170737

Merged
merged 2 commits into from Nov 21, 2022
Merged

lib/systems/platforms.nix: fix broken mips32 detection #170737

merged 2 commits into from Nov 21, 2022

Conversation

ghost
Copy link

@ghost ghost commented Apr 28, 2022

Description of changes

Prior to this commit, nixpkgs would assume that every little-endian
mips32 system was a "fuloong2f_n32".

Not only are there plenty of mips32 chips other than the fuloong, but
the fuloong is actually a mips64 chip! Note that the "n32" ABI is
(confusingly) an ABI for 64-bit mips chips (like the "x32" ABI for
amd64 chips -- both are ABIs which use 32-bit pointers on an
otherwise-64-bit system).

This error causes far-ranging problems. One of them was particularly
difficult to track down: it caused GCC to select 128-bit long double
types, which is invalid for the mips32 ABI. This isn't noticed until
you try to build musl-libc, which is careful to check for these things.

Prior to this commit,

  nix-build . -A pkgsCross.mipsel-linux-gnu.pkgsStatic.hello

would fail. With this commit and #170736, it succeeds.

Things done
  • Built on platform(s)
    • mips64el-linux
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • 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
  • Fits CONTRIBUTING.md.

@ghost ghost requested review from alyssais, nbp, Ericson2314 and matthewbauer as code owners April 28, 2022 06:48
Prior to this commit, nixpkgs would assume that every little-endian
mips32 system was a "fuloong2f_n32".

Not only are there plenty of mips32 chips other than the fuloong, but
the fuloong is actually a mips64 chip!  Note that the "n32" ABI is
(confusingly) an ABI for 64-bit mips chips (like the "x32" ABI for
amd64 chips -- both are ABIs which use 32-bit pointers on an
otherwise-64-bit system).

This error causes far-ranging problems.  One of them was particularly
difficult to track down: it caused GCC to select 128-bit `long double`
types, which is invalid for the mips32 ABI.  This isn't noticed until
you try to build musl-libc, which is careful to check for these things.

Prior to this commit,

  nix-build . -A pkgsCross.mipsel-linux-gnu.pkgsStatic.hello

would fail.  With this commit and #170736, it succeeds.
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Apr 28, 2022
@ghost
Copy link
Author

ghost commented Aug 24, 2022

Ping... #183487 has merged so we have a bootstrap-files for mips32 ( = majority of OpenWRT hardware). This PR and #185176 are the only things preventing stdenv from building.

@ghost ghost mentioned this pull request Aug 24, 2022
4 tasks
@ghost
Copy link
Author

ghost commented Sep 26, 2022

Ping.

@Artturin
Copy link
Member

pkgsCross.mipsel-linux-gnu.pkgsStatic.hello builds

@Artturin Artturin merged commit 20fc948 into NixOS:master Nov 21, 2022
@ghost ghost deleted the fix-mips32-detection branch November 22, 2022 23:52
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: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant