From b1dd7c639d235b8dd0bfc57e9301557c2f93d871 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 3 Jun 2022 18:35:56 +0100 Subject: [PATCH] libipfix: add -fcommon workaround Workaround build failure on -fno-common toolchains like upstream gcc-10. Otherwise build fails as: ld: ../libmisc/libmisc.a(mlog.o):/build/libipfix_110209/libmisc/misc.h:111: multiple definition of `ht_globals'; collector.o:/build/libipfix_110209/collector/../libmisc/misc.h:111: first defined here --- pkgs/development/libraries/libipfix/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/libraries/libipfix/default.nix b/pkgs/development/libraries/libipfix/default.nix index 173bfafc8cc9..8b0c35e0d148 100644 --- a/pkgs/development/libraries/libipfix/default.nix +++ b/pkgs/development/libraries/libipfix/default.nix @@ -7,6 +7,14 @@ stdenv.mkDerivation { url = "mirror://sourceforge/libipfix/files/libipfix/libipfix_110209.tgz"; sha256 = "0h7v0sxjjdc41hl5vq2x0yhyn04bczl11bqm97825mivrvfymhn6"; }; + + # Workaround build failure on -fno-common toolchains: + # ld: ../libmisc/libmisc.a(mlog.o):/build/libipfix_110209/libmisc/misc.h:111: multiple definition of + # `ht_globals'; collector.o:/build/libipfix_110209/collector/../libmisc/misc.h:111: first defined here + # TODO: drop the workaround when fix ix released: + # https://sourceforge.net/p/libipfix/code/ci/a501612c6b8ac6f2df16b366f7a92211382bae6b/ + NIX_CFLAGS_COMPILE = "-fcommon"; + meta = with lib; { homepage = "http://libipfix.sourceforge.net/"; description = "The libipfix C-library implements the IPFIX protocol defined by the IP Flow Information Export working group of the IETF";