diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index c799b9ec4496c..608db00a96837 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -110,6 +110,10 @@ rec { config = "arm-none-eabi"; libc = "newlib"; }; + armhf-embedded = { + config = "arm-none-eabihf"; + libc = "newlib"; + }; aarch64-embedded = { config = "aarch64-none-elf"; diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 73b065689d06b..7db09fc550e27 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)} diff --git a/pkgs/development/misc/qmk_firmware/default.nix b/pkgs/development/misc/qmk_firmware/default.nix index 0a7b4fd9d9a7e..0ec8664dac9e5 100644 --- a/pkgs/development/misc/qmk_firmware/default.nix +++ b/pkgs/development/misc/qmk_firmware/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchFromGitHub , avrgcc, avrbinutils -, gcc-arm-embedded, binutils-arm-embedded +, gcc-arm-embedded, gcc-armhf-embedded , teensy-loader-cli, dfu-programmer, dfu-util }: let version = "0.6.144"; @@ -14,12 +14,23 @@ in stdenv.mkDerivation { sha256 = "0m71f9w32ksqjkrwhqwhr74q5v3pr38bihjyb9ks0k5id0inhrjn"; fetchSubmodules = true; }; + postPatch = '' + substituteInPlace tmk_core/arm_atsam.mk \ + --replace arm-none-eabi arm-none-eabihf + rm keyboards/handwired/frenchdev/rules.mk keyboards/dk60/rules.mk + ''; buildFlags = "all:default"; + doCheck = true; + checkTarget = "test:all"; + installPhase = '' + mkdir $out + ''; NIX_CFLAGS_COMPILE = "-Wno-error"; nativeBuildInputs = [ avrgcc avrbinutils gcc-arm-embedded + gcc-armhf-embedded teensy-loader-cli dfu-programmer dfu-util diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e52ed54298256..1310af493c840 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23027,7 +23027,7 @@ with pkgs; avrgcc = pkgsCross.avr.buildPackages.gcc; avrbinutils = pkgsCross.avr.buildPackages.binutils; gcc-arm-embedded = pkgsCross.arm-embedded.buildPackages.gcc; - binutils-arm-embedded = pkgsCross.arm-embedded.buildPackages.binutils; + gcc-armhf-embedded = pkgsCross.armhf-embedded.buildPackages.gcc; }; newlib = callPackage ../development/misc/newlib { };