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.
This commit is contained in:
parent
953b5d19bc
commit
fe836f3564
1 changed files with 6 additions and 13 deletions
|
@ -148,8 +148,10 @@ rec {
|
||||||
# Every CPU is compatible with itself.
|
# Every CPU is compatible with itself.
|
||||||
# - (transitivity)
|
# - (transitivity)
|
||||||
# If A is compatible with B and B is compatible with C then A is compatible with C.
|
# 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 [
|
isCompatible = a: b: with cpuTypes; lib.any lib.id [
|
||||||
# x86
|
# x86
|
||||||
(b == i386 && isCompatible a i486)
|
(b == i386 && isCompatible a i486)
|
||||||
|
@ -191,22 +193,13 @@ rec {
|
||||||
(b == aarch64 && a == armv8a)
|
(b == aarch64 && a == armv8a)
|
||||||
(b == armv8a && isCompatible a aarch64)
|
(b == armv8a && isCompatible a aarch64)
|
||||||
|
|
||||||
(b == aarch64 && a == aarch64_be)
|
|
||||||
(b == aarch64_be && isCompatible a aarch64)
|
|
||||||
|
|
||||||
# PowerPC
|
# PowerPC
|
||||||
(b == powerpc && isCompatible a powerpc64)
|
(b == powerpc && isCompatible a powerpc64)
|
||||||
(b == powerpcle && isCompatible a powerpc)
|
(b == powerpcle && isCompatible a powerpc64le)
|
||||||
(b == powerpc && a == powerpcle)
|
|
||||||
(b == powerpc64le && isCompatible a powerpc64)
|
|
||||||
(b == powerpc64 && a == powerpc64le)
|
|
||||||
|
|
||||||
# MIPS
|
# MIPS
|
||||||
(b == mips && isCompatible a mips64)
|
(b == mips && isCompatible a mips64)
|
||||||
(b == mips && a == mipsel)
|
(b == mipsel && isCompatible a mips64el)
|
||||||
(b == mipsel && isCompatible a mips)
|
|
||||||
(b == mips64 && a == mips64el)
|
|
||||||
(b == mips64el && isCompatible a mips64)
|
|
||||||
|
|
||||||
# RISCV
|
# RISCV
|
||||||
(b == riscv32 && isCompatible a riscv64)
|
(b == riscv32 && isCompatible a riscv64)
|
||||||
|
|
Loading…
Reference in a new issue