about summary refs log tree commit diff
path: root/pkgs/applications/virtualization/qemu
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-04-26 07:27:23 -0500
committerxeji <xeji@cat3.de>2018-04-26 17:58:16 +0200
commit3d4aa7e95def212895c36262355ca6349cfe7d5a (patch)
tree4a7a016e58078d5fa4293f40ad29fc4ddd7a3684 /pkgs/applications/virtualization/qemu
parent3e3b39f173f9abc99da84084a1f4657c9de885bd (diff)
downloadnixlib-3d4aa7e95def212895c36262355ca6349cfe7d5a.tar
nixlib-3d4aa7e95def212895c36262355ca6349cfe7d5a.tar.gz
nixlib-3d4aa7e95def212895c36262355ca6349cfe7d5a.tar.bz2
nixlib-3d4aa7e95def212895c36262355ca6349cfe7d5a.tar.lz
nixlib-3d4aa7e95def212895c36262355ca6349cfe7d5a.tar.xz
nixlib-3d4aa7e95def212895c36262355ca6349cfe7d5a.tar.zst
nixlib-3d4aa7e95def212895c36262355ca6349cfe7d5a.zip
qemu: workaround 'struct sysinfo' conflict musl <--> linux
Most everyone using musl patches the linux headers instead,
but various software uses a local workaround like the
one added in this commit (psutils, for example).

It's not obvious to me which project has the "bug",
and I'm reluctant to even propose modifying our headers
without clear answer on the issue.

Also, modifying those headers triggers rebuild-all-the-things.

Hopefully upstream projects sort this out, in the meantime
adding this define is a bit of a kludge but does the job.

-------

For the curious, the patch usually is something like this:
https://patchwork.kernel.org/patch/3833241/

Here's an updated version that also ensures
kernel users get the sysinfo struct as expected too:
https://raw.githubusercontent.com/openwrt/openwrt/e3c43ade0bae9491aeea50fa361e846bb5002dc0/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch

(cherry picked from commit dtzWill/nixpkgs@91b5f5a463f5545fbf4f916b3c624840fcb9f300)
Diffstat (limited to 'pkgs/applications/virtualization/qemu')
-rw-r--r--pkgs/applications/virtualization/qemu/default.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix
index 0496adb6f409..dd68eb19380f 100644
--- a/pkgs/applications/virtualization/qemu/default.nix
+++ b/pkgs/applications/virtualization/qemu/default.nix
@@ -95,6 +95,8 @@ stdenv.mkDerivation rec {
 
   preConfigure = ''
     unset CPP # intereferes with dependency calculation
+  '' + optionalString stdenv.hostPlatform.isMusl ''
+    NIX_CFLAGS_COMPILE+=" -D_LINUX_SYSINFO_H"
   '';
 
   configureFlags =