-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
fixes for mips cross compiling toolchains #165020
Conversation
Exception: error: Unknown CPU type: mipsisa32r6; type: nix::ThrownError |
cc @a-m-joseph |
This is my first time using github to do a code review; if I did something stupid I apologize.
|
Hi, I can't figure out how to suggest specific changes. Please consider the changes found in the topmost commit of this branch: https://github.com/a-m-joseph/nixpkgs/tree/mic92-fix-platforms A lot of the messiness here is because nixpkgs treats gnu 5-tuples as 4-tuples, and mixes up the libc with the abi. So we have a lot of code duplication where adding an abi means you have to add it multiple times, once for each libc. |
@@ -28,6 +28,7 @@ let | |||
"aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" | |||
"armv7l-linux" "i686-linux" "m68k-linux" "mipsel-linux" "mips64el-linux" | |||
"powerpc64-linux" "powerpc64le-linux" "riscv32-linux" | |||
"mips-linux" "mips64-linux" |
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.
By adding these two tuples to the list in lib/systems/doubles.nix
you are telling nixpkgs that they evaluate. However, as you've noticed, they don't evaluate :) So, you should not probably not add them here until things evaluate.
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.
They evaluate and build stuff, see https://hercules-ci.com/github/nix-community/cross-toolchains.nix/jobs/79
lib/systems/platforms.nix
Outdated
gcc_mips32r2_o32 = { gcc = { arch = "mips32r2"; abi = "o32"; }; }; | ||
gcc_mips32r6_o32 = { gcc = { arch = "mips32r6"; abi = "o32"; }; }; | ||
gcc_mips32r2_o32 = { gcc = { arch = "mips32r2"; }; }; | ||
gcc_mips32r6_o32 = { gcc = { arch = "mips32r6"; }; }; |
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.
Why did you remove the abi
attribute? Do you believe it is set incorrectly?
See also this, which might at least partially resolve any errors you may have encountered while trying to use abi="o32"
.
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.
The commit messages points to an gentoo issue, where they choose a similar ABI: https://bugs.gentoo.org/515694#c2
With the current abi target gcc does not compile.
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.
See #170736
@@ -28,7 +28,7 @@ with lib.systems.doubles; lib.runTests { | |||
testredox = mseteq redox [ "x86_64-redox" ]; | |||
testgnu = mseteq gnu (linux /* ++ kfreebsd ++ ... */); | |||
testillumos = mseteq illumos [ "x86_64-solaris" ]; | |||
testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "mips64el-linux" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64-linux" "powerpc64le-linux" "m68k-linux" "s390-linux" "s390x-linux" ]; | |||
testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "mips64el-linux" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64-linux" "powerpc64le-linux" "m68k-linux" "s390-linux" "s390x-linux" "mips-linux" "mips64-linux" ]; |
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.
Likewise.
This is my first time using github for a review; is there some way I can indicate that one of my review comments applies to multiple lines in a given file, or to multiple chunks of code scattered across multiple files?
Can you provide a |
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.
Still can't figure out how to tell github that I suggest these changes.
$ git push git@github:NixOS/nixpkgs pull/165020/head
ERROR: Permission to NixOS/nixpkgs.git denied to a-m-joseph.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The code is here: https://github.com/nix-community/cross-toolchains.nix/blob/main/flake.nix |
104b9ac
to
1471db9
Compare
No longer interested in investing time into MIPS. |
Cross-builds to mips32 are now working, and the nix interpreter seccomp filters have been updated to allow mips32 binaries to execute in a sandbox on a mips64 host. |
Those don't evaluate.
Description of changes
Current status: still building. Testing here: nix-community/cross-toolchains.nix#19
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes