summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/systems/default.nix17
-rw-r--r--lib/systems/doubles.nix2
-rw-r--r--lib/systems/examples.nix9
-rw-r--r--lib/systems/inspect.nix1
-rw-r--r--lib/systems/parse.nix6
-rw-r--r--lib/systems/platforms.nix2
-rw-r--r--lib/tests/systems.nix4
7 files changed, 29 insertions, 12 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix
index 0729cc7ef293..d5a206e620c8 100644
--- a/lib/systems/default.nix
+++ b/lib/systems/default.nix
@@ -23,13 +23,15 @@ rec {
       config = parse.tripleFromSystem final.parsed;
       # Just a guess, based on `system`
       platform = platforms.selectBySystem final.system;
+      # Derived meta-data
       libc =
-        /**/ if final.isDarwin then "libSystem"
-        else if final.isMinGW  then "msvcrt"
-        else if final.isMusl  then "musl"
-        else if final.isLinux /* default */    then "glibc"
+        /**/ if final.isDarwin              then "libSystem"
+        else if final.isMinGW               then "msvcrt"
+        else if final.isMusl                then "musl"
+        else if final.isAndroid             then "bionic"
+        else if final.isLinux /* default */ then "glibc"
         # TODO(@Ericson2314) think more about other operating systems
-        else                        "native/impure";
+        else                                     "native/impure";
       extensions = {
         sharedLibrary =
           /**/ if final.isDarwin  then ".dylib"
@@ -39,7 +41,10 @@ rec {
           /**/ if final.isWindows then ".exe"
           else                         "";
       };
+      # Misc boolean options
+      useAndroidPrebuilt = false;
     } // mapAttrs (n: v: v final.parsed) inspect.predicates
       // args;
-  in final;
+  in assert final.useAndroidPrebuilt -> final.isAndroid;
+    final;
 }
diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix
index f39bfff13dec..20294a28a110 100644
--- a/lib/systems/doubles.nix
+++ b/lib/systems/doubles.nix
@@ -9,7 +9,7 @@ let
     "aarch64-linux"
     "armv5tel-linux" "armv6l-linux" "armv7l-linux"
 
-    "mips64el-linux"
+    "mipsel-linux"
 
     "i686-cygwin" "i686-freebsd" "i686-linux" "i686-netbsd" "i686-openbsd"
 
diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix
index bd68ee9460e7..848737700b0b 100644
--- a/lib/systems/examples.nix
+++ b/lib/systems/examples.nix
@@ -38,6 +38,13 @@ rec {
     platform = platforms.aarch64-multiplatform;
   };
 
+  aarch64-android-prebuilt = rec {
+    config = "aarch64-unknown-linux-android";
+    arch = "aarch64";
+    platform = platforms.aarch64-multiplatform;
+    useAndroidPrebuilt = true;
+  };
+
   scaleway-c1 = armv7l-hf-multiplatform // rec {
     platform = platforms.scaleway-c1;
     inherit (platform.gcc) fpu;
@@ -51,7 +58,7 @@ rec {
   };
 
   fuloongminipc = rec {
-    config = "mips64el-unknown-linux-gnu";
+    config = "mipsel-unknown-linux-gnu";
     arch = "mips";
     float = "hard";
     platform = platforms.fuloong2f_n32;
diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix
index ff8f60001175..ab220af46e30 100644
--- a/lib/systems/inspect.nix
+++ b/lib/systems/inspect.nix
@@ -34,6 +34,7 @@ rec {
     Cygwin       = { kernel = kernels.windows; abi = abis.cygnus; };
     MinGW        = { kernel = kernels.windows; abi = abis.gnu; };
 
+    Android      = [ { abi = abis.android; } { abi = abis.androideabi; } ];
     Musl         = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ];
 
     Kexecable    = map (family: { kernel = kernels.linux; cpu.family = family; })
diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index 95759b93ae08..03d052f5f192 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -75,7 +75,10 @@ rec {
     aarch64  = { bits = 64; significantByte = littleEndian; family = "aarch64"; };
     i686     = { bits = 32; significantByte = littleEndian; family = "x86"; };
     x86_64   = { bits = 64; significantByte = littleEndian; family = "x86"; };
-    mips64el = { bits = 32; significantByte = littleEndian; family = "mips"; };
+    mips     = { bits = 32; significantByte = bigEndian;    family = "mips"; };
+    mipsel   = { bits = 32; significantByte = littleEndian; family = "mips"; };
+    mips64   = { bits = 64; significantByte = bigEndian;    family = "mips"; };
+    mips64el = { bits = 64; significantByte = littleEndian; family = "mips"; };
     powerpc  = { bits = 32; significantByte = bigEndian;    family = "power"; };
     riscv32  = { bits = 32; significantByte = littleEndian; family = "riscv"; };
     riscv64  = { bits = 64; significantByte = littleEndian; family = "riscv"; };
@@ -173,6 +176,7 @@ rec {
   types.abi = enum (attrValues abis);
 
   abis = setTypes types.openAbi {
+    android = {};
     cygnus = {};
     gnu = {};
     msvc = {};
diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix
index 9350a16017dd..f39e890fbf1c 100644
--- a/lib/systems/platforms.nix
+++ b/lib/systems/platforms.nix
@@ -561,6 +561,6 @@ rec {
       "armv6l-linux" = raspberrypi;
       "armv7l-linux" = armv7l-hf-multiplatform;
       "aarch64-linux" = aarch64-multiplatform;
-      "mips64el-linux" = fuloong2f_n32;
+      "mipsel-linux" = fuloong2f_n32;
     }.${system} or pcBase;
 }
diff --git a/lib/tests/systems.nix b/lib/tests/systems.nix
index 523fd3feb3b0..ffdd8ae929c8 100644
--- a/lib/tests/systems.nix
+++ b/lib/tests/systems.nix
@@ -16,7 +16,7 @@ in with lib.systems.doubles; lib.runTests {
 
   arm = assertTrue (mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv7l-linux" ]);
   i686 = assertTrue (mseteq i686 [ "i686-linux" "i686-freebsd" "i686-netbsd" "i686-openbsd" "i686-cygwin" ]);
-  mips = assertTrue (mseteq mips [ "mips64el-linux" ]);
+  mips = assertTrue (mseteq mips [ "mipsel-linux" ]);
   x86_64 = assertTrue (mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" ]);
 
   cygwin = assertTrue (mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ]);
@@ -24,7 +24,7 @@ in with lib.systems.doubles; lib.runTests {
   freebsd = assertTrue (mseteq freebsd [ "i686-freebsd" "x86_64-freebsd" ]);
   gnu = assertTrue (mseteq gnu (linux /* ++ hurd ++ kfreebsd ++ ... */));
   illumos = assertTrue (mseteq illumos [ "x86_64-solaris" ]);
-  linux = assertTrue (mseteq linux [ "i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "mips64el-linux" ]);
+  linux = assertTrue (mseteq linux [ "i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "mipsel-linux" ]);
   netbsd = assertTrue (mseteq netbsd [ "i686-netbsd" "x86_64-netbsd" ]);
   openbsd = assertTrue (mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ]);
   unix = assertTrue (mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos));