summary refs log tree commit diff
path: root/pkgs/os-specific/linux/systemd/default.nix
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-10-02 18:04:22 -0700
committerAlyssa Ross <hi@alyssa.is>2023-01-13 20:09:41 +0000
commit6f6b4a1d4175d3f6fb72dbaceea8d6e4e79c5d6e (patch)
treede3af26dbdd70d3d419e746ba4158e5949248bee /pkgs/os-specific/linux/systemd/default.nix
parent956e4aa262f4dc4334cec0892a14ae8f94f57612 (diff)
downloadnixpkgs-6f6b4a1d4175d3f6fb72dbaceea8d6e4e79c5d6e.tar
nixpkgs-6f6b4a1d4175d3f6fb72dbaceea8d6e4e79c5d6e.tar.gz
nixpkgs-6f6b4a1d4175d3f6fb72dbaceea8d6e4e79c5d6e.tar.bz2
nixpkgs-6f6b4a1d4175d3f6fb72dbaceea8d6e4e79c5d6e.tar.lz
nixpkgs-6f6b4a1d4175d3f6fb72dbaceea8d6e4e79c5d6e.tar.xz
nixpkgs-6f6b4a1d4175d3f6fb72dbaceea8d6e4e79c5d6e.tar.zst
nixpkgs-6f6b4a1d4175d3f6fb72dbaceea8d6e4e79c5d6e.zip
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.
Diffstat (limited to 'pkgs/os-specific/linux/systemd/default.nix')
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index 4e3f3762370..33b7a92d8cf 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