From 058fae42a9503f5ba27493738d018ff0709c21a0 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 15 May 2022 10:44:06 +0100 Subject: [PATCH] iftop: add -fcommon workaround Workaround build failure on -fno-common toolchains like upstream gcc-10. Otherwise build fails as: ld: tui.o:/build/iftop-1.0pre4/ui_common.h:41: multiple definition of `service_hash'; iftop.o:/build/iftop-1.0pre4/ui_common.h:41: first defined here --- pkgs/tools/networking/iftop/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/tools/networking/iftop/default.nix b/pkgs/tools/networking/iftop/default.nix index abdb7d05b28..137ce03b252 100644 --- a/pkgs/tools/networking/iftop/default.nix +++ b/pkgs/tools/networking/iftop/default.nix @@ -19,6 +19,12 @@ stdenv.mkDerivation rec { buildInputs = [ncurses libpcap]; + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: tui.o:/build/iftop-1.0pre4/ui_common.h:41: multiple definition of `service_hash'; + # iftop.o:/build/iftop-1.0pre4/ui_common.h:41: first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; + passthru.tests = { inherit (nixosTests) iftop; }; meta = with lib; {