about summary refs log tree commit diff
path: root/lib/systems
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2022-04-26 22:08:44 +0200
committersternenseemann <sternenseemann@systemli.org>2022-05-23 21:25:04 +0200
commitfe836f35644a152c5a38d09e162694fec9755b6b (patch)
tree33bd0d3199d5bd19cb36e0f5da6230e3d98ec352 /lib/systems
parent953b5d19bca4d4ddfaef5625cca277c47b39f5e7 (diff)
lib/systems/parse: don't consider mode switching CPUs compatible
Since we (exclusively) use isCompatible to gauge whether platform a can
execute binaries built for platform b, mode switching CPUs are not to be
considered compatible for our purposes: Switching the mode of a CPU
usually requires a reset. At the very least we can't execute a mix of
executables for the two modes which would usually be the case in nixpkgs
where we may want to execute buildInputs for the hostPlatform in
addition to nativeBuildInputs for the buildPlatform.
Diffstat (limited to 'lib/systems')
-rw-r--r--lib/systems/parse.nix19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index bf436ec8db579..9d2571c993a99 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -148,8 +148,10 @@ rec {
   #   Every CPU is compatible with itself.
   # - (transitivity)
   #   If A is compatible with B and B is compatible with C then A is compatible with C.
-  # - (compatible under multiple endianness)
-  #   CPUs with multiple modes of endianness are pairwise compatible.
+  #
+  # Note: Since 22.11 the archs of a mode switching CPU are no longer considered
+  # pairwise compatible. Mode switching implies that binaries built for A
+  # and B respectively can't be executed at the same time.
   isCompatible = a: b: with cpuTypes; lib.any lib.id [
     # x86
     (b == i386 && isCompatible a i486)
@@ -191,22 +193,13 @@ rec {
     (b == aarch64 && a == armv8a)
     (b == armv8a && isCompatible a aarch64)
 
-    (b == aarch64 && a == aarch64_be)
-    (b == aarch64_be && isCompatible a aarch64)
-
     # PowerPC
     (b == powerpc && isCompatible a powerpc64)
-    (b == powerpcle && isCompatible a powerpc)
-    (b == powerpc && a == powerpcle)
-    (b == powerpc64le && isCompatible a powerpc64)
-    (b == powerpc64 && a == powerpc64le)
+    (b == powerpcle && isCompatible a powerpc64le)
 
     # MIPS
     (b == mips && isCompatible a mips64)
-    (b == mips && a == mipsel)
-    (b == mipsel && isCompatible a mips)
-    (b == mips64 && a == mips64el)
-    (b == mips64el && isCompatible a mips64)
+    (b == mipsel && isCompatible a mips64el)
 
     # RISCV
     (b == riscv32 && isCompatible a riscv64)