-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
add generic x86_32 support #52634
add generic x86_32 support #52634
Conversation
- Add support for i386-i586. - Add `isx86_32` predicate that can replace most uses of `isi686`. - `isi686` is reinterpreted to mean "exactly i686 arch, and not say i585 or i386". - This branch was used to build working i586 kernel running on i586 hardware.
This pull request has been mentioned on Nix community. There might be relevant details there: https://discourse.nixos.org/t/i586-cross-compiling-ambiguous-i686-use/1482/8 |
lib/systems/doubles.nix
Outdated
@@ -12,11 +12,14 @@ let | |||
"mipsel-linux" | |||
|
|||
"i686-cygwin" "i686-freebsd" "i686-linux" "i686-netbsd" "i686-openbsd" | |||
"i586-cygwin" "i586-freebsd" "i586-linux" "i586-netbsd" "i586-openbsd" | |||
"i486-cygwin" "i486-freebsd" "i486-linux" "i486-netbsd" "i486-openbsd" | |||
"i386-cygwin" "i386-freebsd" "i386-linux" "i386-netbsd" "i386-openbsd" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i386 doesn't work with latest glibc - better leave it off
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I purge all i386 support from the PR or just this i386 line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the i386-linux references, I think. Although I'm not sure whether other OSs actually still support i386. Very few computers still even exist that are i386 so it's largely a irrelevant 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've followed code to see what doubles.nix
actually does, and... it does almost nothing. Only mesaPlatforms
appears to be used AFAICT. Anyway I will revert all changes to this file and also for-meta.nix
(which looks 100% dead).
lib/systems/inspect.nix
Outdated
@@ -8,8 +8,12 @@ let abis = lib.mapAttrs (_: abi: builtins.removeAttrs abi [ "assertions" ]) abis | |||
|
|||
rec { | |||
patterns = rec { | |||
isi386 = { cpu = cpuTypes.i386; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you expect needing these? My thinking would be we would just use x86_32 as much as possible. We are doing a similar thing with isAarch32 as well. Even without these you can always do:
stdenv.hostPlatform.parsed.cpu.name == "i386"
if you really need a condition on a certain micro architecture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't. I put them in to be symmetric with isi686
.
- Remove changes to dead code in `doubles.nix` and `for-meta.nix`. - Remove `isi[345]86` predicates since other cpu families don't have specific model predicates.
isi686 isx86_64 is64bit isAarch32 isAarch64 isMips isBigEndian; | ||
isi386 isi486 isi586 isi686 isx86_32 isx86_64 | ||
is32bit is64bit | ||
isAarch32 isAarch64 isMips isBigEndian; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I was trying to not grow this in preference of people using stdenv.hostPlatform.is*
. Let others decide whether that's a good goal. It's certainly not our worst source of duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also sorry I wrote this (probably on my phone) and then never submitted it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to remove them. At some point we should probably just start removing any stdenv.is* that is unused.
Motivation for this change
Add support for i386-i586. Ref:
In summary:
isx86_32
predicate that can replace most uses ofisi686
.isi686
is reinterpreted to mean "exactly i686 arch, and not say i585 or i386".Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)