From 0e8ede9cc4a3660dd23f6c58a2f549b9e3cda118 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 7 May 2022 18:56:29 +0100 Subject: [PATCH] g15daemon: add -fcommon workaround Without the change the build fails on -fno-common toolchains like gcc-10 as: $ nix build --impure --expr 'with import ./. {}; g15daemon.override { stdenv = clang13Stdenv; }' ld: g15daemon.h:218: multiple definition of `lcdlist_mutex'; utility_funcs.o:g15daemon.h:218: first defined here ld: g15daemon.h:203: multiple definition of `lcdnode_s'; utility_funcs.o:g15daemon.h:203: first defined here --- pkgs/os-specific/linux/g15daemon/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/os-specific/linux/g15daemon/default.nix b/pkgs/os-specific/linux/g15daemon/default.nix index 118a17c4c8f..d20fb662ff5 100644 --- a/pkgs/os-specific/linux/g15daemon/default.nix +++ b/pkgs/os-specific/linux/g15daemon/default.nix @@ -79,6 +79,11 @@ stdenv.mkDerivation rec { buildInputs = [ libg15 libg15render ]; + # Workaround build failure on -fno-common toolchains like upstream gcc-10: + # ld: g15_plugins.o:/build/g15daemon-1.9.5.3/g15daemon/./g15daemon.h:218: + # multiple definition of `lcdlist_mutex'; utility_funcs.o:g15daemon.h:218: first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; + enableParallelBuilding = true; meta = {