From aa51704ba5aa3012397024d9fb719c0bc62e573e Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 29 Jan 2023 14:44:42 +0000 Subject: [PATCH 1/3] lib.systems.inspect.patterns.isEfi: drop ARMv5 I'm not aware of any ARMv5 EFI implementation. gnu-efi doesn't support it, so the build of systemd for armv5tel-linux is broken if it's isEfi. --- lib/systems/inspect.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index b40a82b3321e..6a9f0fadcd3d 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -81,8 +81,13 @@ rec { isMusl = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf muslabin32 muslabi64 ]; isUClibc = with abis; map (a: { abi = a; }) [ uclibc uclibceabi uclibceabihf ]; - isEfi = map (family: { cpu.family = family; }) - [ "x86" "arm" "riscv" ]; + isEfi = [ + { cpu = { family = "arm"; version = "6"; }; } + { cpu = { family = "arm"; version = "7"; }; } + { cpu = { family = "arm"; version = "8"; }; } + { cpu = { family = "riscv"; }; } + { cpu = { family = "x86"; }; } + ]; }; matchAnyAttrs = patterns: From 0da24fa3ba069404faf7820767e01dd8e7ca1c3e Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 30 Jan 2023 19:00:28 +0000 Subject: [PATCH 2/3] systemd: disable BPF for ARMv5 ARMv5 does not have hardware floating point, so can't build systemd's BPF code. --- pkgs/os-specific/linux/systemd/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 4af13ea26af5..aa5bc8fe40bb 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -93,6 +93,7 @@ , withHwdb ? true , withImportd ? !stdenv.hostPlatform.isMusl , withLibBPF ? lib.versionAtLeast buildPackages.llvmPackages.clang.version "10.0" + && stdenv.hostPlatform.isAarch -> lib.versionAtLeast stdenv.hostPlatform.parsed.cpu.version "6" # assumes hard floats && !stdenv.hostPlatform.isMips64 # see https://github.com/NixOS/nixpkgs/pull/194149#issuecomment-1266642211 , withLocaled ? true , withLogind ? true From b538df31338bc1b126202ba8b299ad1c721d0c2a Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 29 Jan 2023 14:13:10 +0000 Subject: [PATCH 3/3] mesa: fix build for armv5tel Fixes: e7a2c65ab54 ("mesa: reorganize default driver list") --- pkgs/development/libraries/mesa/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 89526fbda7f4..56fa74e5c0c5 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -39,7 +39,11 @@ "amd" # AMD (aka RADV) "microsoft-experimental" # WSL virtualized GPU (aka DZN/Dozen) "swrast" # software renderer (aka Lavapipe) - "virtio-experimental" # QEMU virtualized GPU (aka VirGL) + ] + ++ lib.optionals (stdenv.hostPlatform.isAarch -> lib.versionAtLeast stdenv.hostPlatform.parsed.cpu.version "6") [ + # QEMU virtualized GPU (aka VirGL) + # Requires ATOMIC_INT_LOCK_FREE == 2. + "virtio-experimental" ] ++ lib.optionals stdenv.isAarch64 [ "broadcom" # Broadcom VC5 (Raspberry Pi 4, aka V3D)