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
This commit is contained in:
Sergei Trofimovich 2022-05-29 07:43:10 +01:00
parent 0831857a14
commit d07a56ddd3

View File

@ -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 ];