From d07a56ddd340b48febf85a1d2885fff5f4d3a967 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 29 May 2022 07:43:10 +0100 Subject: [PATCH] silver-searcher: add -fcommon workaround Workaround build failure on -fno-common toolchains like upstream gcc-10. Otherwise build fails as: ld: src/zfile.o:/build/source/src/log.h:12: multiple definition of `print_mtx'; src/ignore.o:/build/source/src/log.h:12: first defined here --- pkgs/tools/text/silver-searcher/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/tools/text/silver-searcher/default.nix b/pkgs/tools/text/silver-searcher/default.nix index 757c65eed848..53146ddd0610 100644 --- a/pkgs/tools/text/silver-searcher/default.nix +++ b/pkgs/tools/text/silver-searcher/default.nix @@ -13,6 +13,12 @@ stdenv.mkDerivation rec { patches = [ ./bash-completion.patch ]; + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: src/zfile.o:/build/source/src/log.h:12: multiple definition of + # `print_mtx'; src/ignore.o:/build/source/src/log.h:12: first defined here + # TODO: remove once next release has https://github.com/ggreer/the_silver_searcher/pull/1377 + NIX_CFLAGS_COMPILE = "-fcommon"; NIX_LDFLAGS = lib.optionalString stdenv.isLinux "-lgcc_s"; nativeBuildInputs = [ autoreconfHook pkg-config ];