From 5ecc833cb2c2bedc5d53c938fa83046b7349d1a9 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 2 Oct 2022 18:04:22 -0700 Subject: [PATCH] systemd: default withLibBPF to false if isMips64 libBPF does not compile for mips64 targets using clang (rathern than gcc) because clang lacks the necessary _MIPS_SZPTR compiler builtin. Let's allow the rest of systemd to compile. - The glibc people noticed this problem [way back in 2011](https://sourceware.org/pipermail/libc-ports/2011-June/001959.html) and consider it to be a clang/llvm bug. I am inclined to agree. - [clang has the `_MIPS_SZPTR` builtin](https://github.com/llvm/clangir/blob/3af9cb5375084541165b4b63d36e3798801c95ab/clang/lib/Basic/Targets/Mips.cpp#L185) and seems to have had it since before they switched to git. This may in fact be a nixpkgs bug -- that we're not invoking clang in a way that tells the frontend to make the mips builtins available, even if the backend is emitting mips binaries. Or at least we aren't tricking systemd's build machinery into doing that. --- 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 4e3f3762370d3..33b7a92d8cf7d 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -94,6 +94,7 @@ , withHwdb ? true , withImportd ? !stdenv.hostPlatform.isMusl , withLibBPF ? lib.versionAtLeast buildPackages.llvmPackages.clang.version "10.0" + && !stdenv.hostPlatform.isMips64 # see https://github.com/NixOS/nixpkgs/pull/194149#issuecomment-1266642211 , withLocaled ? true , withLogind ? true , withMachined ? true