mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
lib.systems: add powerpc64-linux
PPC64 supports two ABIs: ELF v1 and v2. ELFv1 is historically what GCC and most packages expect, but this is changing because musl outright does not work with ELFv1. So any distro which uses musl must use ELFv2. Many other platforms are moving to ELFv2 too, such as FreeBSD (as of v13) and Gentoo (as of late 2020). Since we use musl extensively, let's default to ELFv2. Nix gives us the power to specify this declaratively for the entire system, so ELFv1 is not dropped entirely. It can be specified explicitly in the target config, e.g. "powerpc64-unknown-linux-elfv1". Otherwise the default is "powerpc64-unknown-linux-elfv2". For musl, "powerpc64-unknown-linux-musl" must use elfv2 internally to function.
This commit is contained in:
parent
054f792d31
commit
72b3badb61
4 changed files with 26 additions and 3 deletions
|
@ -337,10 +337,18 @@ rec {
|
|||
The "gnu" ABI is ambiguous on 32-bit ARM. Use "gnueabi" or "gnueabihf" instead.
|
||||
'';
|
||||
}
|
||||
{ assertion = platform: platform.system != "powerpc64-linux";
|
||||
message = ''
|
||||
The "gnu" ABI is ambiguous on big-endian 64-bit PPC. Use "elfv1" or "elfv2" instead.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
gnuabi64 = { abi = "64"; };
|
||||
|
||||
elfv1 = { abi = "elfv1"; };
|
||||
elfv2 = { abi = "elfv2"; };
|
||||
|
||||
musleabi = { float = "soft"; };
|
||||
musleabihf = { float = "hard"; };
|
||||
musl = {};
|
||||
|
@ -444,6 +452,7 @@ rec {
|
|||
if lib.versionAtLeast (parsed.cpu.version or "0") "6"
|
||||
then abis.gnueabihf
|
||||
else abis.gnueabi
|
||||
else if cpu == "powerpc64" then abis.elfv2
|
||||
else abis.gnu
|
||||
else abis.unknown;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue