From d29e8f0e5970b22bdeffbf5ac0c14f893ba8b2a9 Mon Sep 17 00:00:00 2001 From: Ivan Babrou Date: Mon, 8 Feb 2021 13:42:05 -0800 Subject: [PATCH] qemu: rename VERSION to QEMU_VERSION to avoid name clash In libc++ starting with LLVM8 there's `` include in `cstddef`: The following things also align: * QEMU has a file called `VERSION` in repo root * QEMU prepends repo root to include path in build * macOS has a case-insensetive filesystem All of this combined means that `VERSION` file is included as a header. Working around this be renaming `VERSION` -> `QEMU_VERSION` to resolve ambiguity. The problem really only appears on `aarch64-darwin`, since on `x86_64-darwin` there are no C++ files to compile. The workaround is harmless enough to apply. --- pkgs/applications/virtualization/qemu/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 933d6c293ad..1ceb238ddf9 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -108,6 +108,10 @@ stdenv.mkDerivation rec { # this script isn't marked as executable b/c it's indirectly used by meson. Needed to patch its shebang chmod +x ./scripts/shaderinclude.pl patchShebangs . + # avoid conflicts with libc++ include for + mv VERSION QEMU_VERSION + substituteInPlace meson.build \ + --replace "'VERSION'" "'QEMU_VERSION'" '' + optionalString stdenv.hostPlatform.isMusl '' NIX_CFLAGS_COMPILE+=" -D_LINUX_SYSINFO_H" '';