diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2018-12-02 17:47:53 -0600 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2018-12-02 19:49:36 -0600 |
commit | 3b32c920d569c1653d2a3ee84b0aa1f24bf34a85 (patch) | |
tree | 3807ef2a3aad09a0bc5a052b7b9e428d56e1f1a1 /lib/systems/parse.nix | |
parent | 808f05808b40c9092a54cfab7799c13cdb8a5db5 (diff) | |
download | nixpkgs-3b32c920d569c1653d2a3ee84b0aa1f24bf34a85.tar nixpkgs-3b32c920d569c1653d2a3ee84b0aa1f24bf34a85.tar.gz nixpkgs-3b32c920d569c1653d2a3ee84b0aa1f24bf34a85.tar.bz2 nixpkgs-3b32c920d569c1653d2a3ee84b0aa1f24bf34a85.tar.lz nixpkgs-3b32c920d569c1653d2a3ee84b0aa1f24bf34a85.tar.xz nixpkgs-3b32c920d569c1653d2a3ee84b0aa1f24bf34a85.tar.zst nixpkgs-3b32c920d569c1653d2a3ee84b0aa1f24bf34a85.zip |
systems/parse.nix: support eabihf
eabihf is an abi that can be used with ARM architectures that support the “hard float”. It should probably only be used with ARM32 when you are absolutely sure your binaries will run on ARM systems with a FPU. Also, add an example "armhf-embedded" to match the preexisting arm-embedded system. qmk_firmware needs hard float in a few places, so add them here to get that to work. Fixes #51184
Diffstat (limited to 'lib/systems/parse.nix')
-rw-r--r-- | lib/systems/parse.nix | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 73b065689d0..7db09fc550e 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -209,8 +209,15 @@ rec { abis = setTypes types.openAbi { cygnus = {}; msvc = {}; - eabi = {}; - elf = {}; + + # Note: eabi is specific to ARM and PowerPC. + # On PowerPC, this corresponds to PPCEABI. + # On ARM, this corresponds to ARMEABI. + eabi = { float = "soft"; }; + eabihf = { float = "hard"; }; + + # Other architectures should use ELF in embedded situations. + elf = {}; androideabi = {}; android = { @@ -272,10 +279,8 @@ rec { "2" = # We only do 2-part hacks for things Nix already supports if elemAt l 1 == "cygwin" then { cpu = elemAt l 0; kernel = "windows"; abi = "cygnus"; } - else if (elemAt l 1 == "eabi") - then { cpu = elemAt l 0; vendor = "none"; kernel = "none"; abi = elemAt l 1; } - else if (elemAt l 1 == "elf") - then { cpu = elemAt l 0; vendor = "none"; kernel = "none"; abi = elemAt l 1; } + else if (elemAt l 1) == "elf" + then { cpu = elemAt l 0; vendor = "unknown"; kernel = "none"; abi = elemAt l 1; } else { cpu = elemAt l 0; kernel = elemAt l 1; }; "3" = # Awkwards hacks, beware! if elemAt l 1 == "apple" @@ -286,10 +291,8 @@ rec { then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "windows"; abi = "gnu"; } else if hasPrefix "netbsd" (elemAt l 2) then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; } - else if (elemAt l 2 == "eabi") - then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "none"; abi = elemAt l 2; } - else if (elemAt l 2 == "elf") - then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "none"; abi = elemAt l 2; } + else if (elem (elemAt l 2) ["eabi" "eabihf" "elf"]) + then { cpu = elemAt l 0; vendor = "unknown"; kernel = elemAt l 1; abi = elemAt l 2; } else throw "Target specification with 3 components is ambiguous"; "4" = { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; abi = elemAt l 3; }; }.${toString (length l)} |