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
This commit is contained in:
Sergei Trofimovich 2022-06-03 08:30:06 +01:00
parent 236cc2971a
commit 3978ed8109

View File

@ -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'