From 9c70296bc769af3492c00827563783e996d83a57 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 29 May 2022 21:24:10 +0100 Subject: [PATCH] t4kcommon: add -fcommon workaround Workaround build failure on -fno-common toolchains like upstream gcc-10. Otherwise build fails as: ld: CMakeFiles/t4k_common.dir/t4k_throttle.c.o:(.bss+0x0): multiple definition of `wrapped_lines'; CMakeFiles/t4k_common.dir/t4k_audio.c.o:(.bss+0x0): first defined here --- pkgs/games/t4kcommon/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/games/t4kcommon/default.nix b/pkgs/games/t4kcommon/default.nix index 74757c236c51..4a7a2e92b106 100644 --- a/pkgs/games/t4kcommon/default.nix +++ b/pkgs/games/t4kcommon/default.nix @@ -19,6 +19,13 @@ stdenv.mkDerivation rec { }) ]; + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: CMakeFiles/t4k_common.dir/t4k_throttle.c.o:(.bss+0x0): multiple definition of + # `wrapped_lines'; CMakeFiles/t4k_common.dir/t4k_audio.c.o:(.bss+0x0): first defined here + # TODO: revisit https://github.com/tux4kids/t4kcommon/pull/10 when merged. + NIX_CFLAGS_COMPILE = "-fcommon"; + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ SDL SDL_image SDL_mixer SDL_net SDL_ttf libpng librsvg libxml2 ];