From d7c6d3d063d0671e2ce7fd1c5bc4d93771ec6883 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 5 Jun 2022 18:51:08 +0100 Subject: [PATCH] coturn: add -fcommon workaround Workaround build failure on -fno-common toolchains like upstream gcc-10. Otherwise build fails as: ld: ...-libprom-0.1.1/include/prom_collector_registry.h:37: multiple definition of `PROM_COLLECTOR_REGISTRY_DEFAULT'; ...-libprom-0.1.1/include/prom_collector_registry.h:37: first defined here --- pkgs/servers/coturn/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/servers/coturn/default.nix b/pkgs/servers/coturn/default.nix index d076f763bf96..695c881e9f66 100644 --- a/pkgs/servers/coturn/default.nix +++ b/pkgs/servers/coturn/default.nix @@ -35,6 +35,13 @@ stdenv.mkDerivation rec { ./pure-configure.patch ]; + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: ...-libprom-0.1.1/include/prom_collector_registry.h:37: multiple definition of + # `PROM_COLLECTOR_REGISTRY_DEFAULT'; ...-libprom-0.1.1/include/prom_collector_registry.h:37: first defined here + # Should be fixed in libprom-1.2.0 and later: https://github.com/digitalocean/prometheus-client-c/pull/25 + NIX_CFLAGS_COMPILE = "-fcommon"; + passthru.tests.coturn = nixosTests.coturn; meta = with lib; {