diff options
author | Serge Bazanski <q3k@q3k.org> | 2021-07-20 23:39:32 +0200 |
---|---|---|
committer | Serge Bazanski <q3k@q3k.org> | 2021-07-21 00:43:16 +0200 |
commit | c00d507f97fb4e4aa121d3df288a56c9a2c9585d (patch) | |
tree | fcddd2a6e95a63b8cd7a04d13b05cd62d5ea4ccc /pkgs/development/compilers | |
parent | 8472d44b82084f8b638b0dca248fae61b9bd1bad (diff) | |
download | nixpkgs-c00d507f97fb4e4aa121d3df288a56c9a2c9585d.tar nixpkgs-c00d507f97fb4e4aa121d3df288a56c9a2c9585d.tar.gz nixpkgs-c00d507f97fb4e4aa121d3df288a56c9a2c9585d.tar.bz2 nixpkgs-c00d507f97fb4e4aa121d3df288a56c9a2c9585d.tar.lz nixpkgs-c00d507f97fb4e4aa121d3df288a56c9a2c9585d.tar.xz nixpkgs-c00d507f97fb4e4aa121d3df288a56c9a2c9585d.tar.zst nixpkgs-c00d507f97fb4e4aa121d3df288a56c9a2c9585d.zip |
go: enable MIPS GOARCH/cross integration
This allows the Go compiler in nixpkgs (eg. buildGoModule) to work with crossSystem.config == mips-*, eg mips-unknown-linux-musl, and succesfully generate Go MIPS binaries. nix-build -A grpcurl --arg crossSystem '{ config = "mips-unknown-linux-musl"; }' This unfortunately cannot currently be tested on qemu-mips as Go emits ELF files that fail to execute correctly in qemu-user (see: https://go-review.googlesource.com/c/go/+/239217, on track to land in Go 1.17). However, I have tested this on a physical MIPS device. I have not been able to build anything using cgo (hit various compilation errors in C dependencies), but considering mips-unknown-linux-musl is not a support nixpkgs target this isn't that surprising.
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/go/1.14.nix | 1 | ||||
-rw-r--r-- | pkgs/development/compilers/go/1.15.nix | 1 | ||||
-rw-r--r-- | pkgs/development/compilers/go/1.16.nix | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/pkgs/development/compilers/go/1.14.nix b/pkgs/development/compilers/go/1.14.nix index e8a90ac0b8d..21080fd96cb 100644 --- a/pkgs/development/compilers/go/1.14.nix +++ b/pkgs/development/compilers/go/1.14.nix @@ -41,6 +41,7 @@ let "armv6l" = "arm"; "armv7l" = "arm"; "powerpc64le" = "ppc64le"; + "mips" = "mips"; }.${platform.parsed.cpu.name} or (throw "Unsupported system"); # We need a target compiler which is still runnable at build time, diff --git a/pkgs/development/compilers/go/1.15.nix b/pkgs/development/compilers/go/1.15.nix index 8dee4cae896..74ab1342dab 100644 --- a/pkgs/development/compilers/go/1.15.nix +++ b/pkgs/development/compilers/go/1.15.nix @@ -41,6 +41,7 @@ let "armv6l" = "arm"; "armv7l" = "arm"; "powerpc64le" = "ppc64le"; + "mips" = "mips"; }.${platform.parsed.cpu.name} or (throw "Unsupported system"); # We need a target compiler which is still runnable at build time, diff --git a/pkgs/development/compilers/go/1.16.nix b/pkgs/development/compilers/go/1.16.nix index f85d2bba907..49a2f9656f3 100644 --- a/pkgs/development/compilers/go/1.16.nix +++ b/pkgs/development/compilers/go/1.16.nix @@ -41,6 +41,7 @@ let "armv6l" = "arm"; "armv7l" = "arm"; "powerpc64le" = "ppc64le"; + "mips" = "mips"; }.${platform.parsed.cpu.name} or (throw "Unsupported system"); # We need a target compiler which is still runnable at build time, |