From ed01f5bd6d9454d389279322e909791c005bc513 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 21 May 2022 11:19:42 +0100 Subject: [PATCH] jpeg-archive: add -fcommon workaround Workaround build failure on -fno-common toolchains like upstream gcc-10. Otherwise build fails as: ld: src/util.o:(.bss+0x0): multiple definition of `progname'; /build/ccBZT2Za.o:(.bss+0x20): first defined here --- pkgs/applications/graphics/jpeg-archive/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/applications/graphics/jpeg-archive/default.nix b/pkgs/applications/graphics/jpeg-archive/default.nix index b974e271a675..bd4a580cc462 100644 --- a/pkgs/applications/graphics/jpeg-archive/default.nix +++ b/pkgs/applications/graphics/jpeg-archive/default.nix @@ -21,6 +21,12 @@ stdenv.mkDerivation { substituteInPlace Makefile --replace 'LIBJPEG =' 'LIBJPEG ?=' ''; + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: src/util.o:(.bss+0x0): multiple definition of `progname'; /build/ccBZT2Za.o:(.bss+0x20): first defined here + # https://github.com/danielgtaylor/jpeg-archive/issues/119 + NIX_CFLAGS_COMPILE = "-fcommon"; + makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "PREFIX=$(out)"