summary refs log tree commit diff
path: root/lib/systems/parse.nix
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2018-12-29 03:25:20 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2019-01-04 12:05:35 -0500
commit3bf0e4efc751b4f8d647c5521f317c44b5f9c4a3 (patch)
treedad05f8707d74658ee0764c0ac21acd2b3d2cae1 /lib/systems/parse.nix
parent94164f0d04e99ce7c525b1d8dc89710fd57d895c (diff)
downloadnixpkgs-3bf0e4efc751b4f8d647c5521f317c44b5f9c4a3.tar
nixpkgs-3bf0e4efc751b4f8d647c5521f317c44b5f9c4a3.tar.gz
nixpkgs-3bf0e4efc751b4f8d647c5521f317c44b5f9c4a3.tar.bz2
nixpkgs-3bf0e4efc751b4f8d647c5521f317c44b5f9c4a3.tar.lz
nixpkgs-3bf0e4efc751b4f8d647c5521f317c44b5f9c4a3.tar.xz
nixpkgs-3bf0e4efc751b4f8d647c5521f317c44b5f9c4a3.tar.zst
nixpkgs-3bf0e4efc751b4f8d647c5521f317c44b5f9c4a3.zip
lib: Fix Mingw on 32-bit ARM
Diffstat (limited to 'lib/systems/parse.nix')
-rw-r--r--lib/systems/parse.nix13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index 7db09fc550e..6947d41419e 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -279,8 +279,14 @@ 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";   }
+      # MSVC ought to be the default ABI so this case isn't needed. But then it
+      # becomes difficult to handle the gnu* variants for Aarch32 correctly for
+      # minGW. So it's easier to make gnu* the default for the MinGW, but
+      # hack-in MSVC for the non-MinGW case right here.
+      else if elemAt l 1 == "windows"
+        then { cpu = elemAt l 0;                      kernel = "windows";  abi = "msvc";     }
       else if (elemAt l 1) == "elf"
-      then { cpu = elemAt l 0; vendor = "unknown";    kernel = "none";     abi = elemAt l 1; }
+        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"
@@ -288,7 +294,7 @@ rec {
       else if (elemAt l 1 == "linux") || (elemAt l 2 == "gnu")
         then { cpu = elemAt l 0;                      kernel = elemAt l 1; abi = elemAt l 2; }
       else if (elemAt l 2 == "mingw32") # autotools breaks on -gnu for window
-        then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "windows";  abi = "gnu"; }
+        then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "windows";                    }
       else if hasPrefix "netbsd" (elemAt l 2)
         then { cpu = elemAt l 0; vendor = elemAt l 1;    kernel = elemAt l 2;                }
       else if (elem (elemAt l 2) ["eabi" "eabihf" "elf"])
@@ -324,13 +330,12 @@ rec {
                else                                   getKernel args.kernel;
       abi =
         /**/ if args ? abi       then getAbi args.abi
-        else if isLinux   parsed then
+        else if isLinux parsed || isWindows parsed then
           if isAarch32 parsed then
             if lib.versionAtLeast (parsed.cpu.version or "0") "6"
             then abis.gnueabihf
             else abis.gnueabi
           else abis.gnu
-        else if isWindows parsed then abis.gnu
         else                     abis.unknown;
     };