From 3978ed81090bead3bce193f1a00af651dcda85a5 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 3 Jun 2022 08:30:06 +0100 Subject: [PATCH] xe-guest-utilities: add -fcommon workaround Workaround build failure on -fno-common toolchains like upstream gcc-10. Otherwise build fails as: ld: utils.o:xenstore/utils.h:27: multiple definition of `xprintf'; xenstored_core.o:xenstore/utils.h:27: first defined here --- pkgs/tools/virtualization/xe-guest-utilities/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/tools/virtualization/xe-guest-utilities/default.nix b/pkgs/tools/virtualization/xe-guest-utilities/default.nix index 69b9f540e458..61ff951e8be4 100644 --- a/pkgs/tools/virtualization/xe-guest-utilities/default.nix +++ b/pkgs/tools/virtualization/xe-guest-utilities/default.nix @@ -20,6 +20,11 @@ stdenv.mkDerivation (rec { tar xf "$NIX_BUILD_TOP/$name/xenstore-sources.tar.bz2" ''; + # Workaround build failure on -fno-common toolchains: + # ld: utils.o:xenstore/utils.h:27: + # multiple definition of `xprintf'; xenstored_core.o:xenstore/utils.h:27: first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; + buildPhase = '' export CC=gcc export CFLAGS='-Wall -Wstrict-prototypes -Wno-unused-local-typedefs -Wno-sizeof-pointer-memaccess'