Merge pull request #177147 from trofi/workaround-fno-common-for-fluent-bit

fluent-bit: add -fcommon workaround
This commit is contained in:
Mario Rodas 2022-06-11 21:11:59 -05:00 committed by GitHub
commit 881810d9b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,13 @@ stdenv.mkDerivation rec {
cmakeFlags = [ "-DFLB_METRICS=ON" "-DFLB_HTTP_SERVER=ON" ];
# _FORTIFY_SOURCE requires compiling with optimization (-O)
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-O";
NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ "-O" ]
# Workaround build failure on -fno-common toolchains:
# ld: /monkey/mk_tls.h:81: multiple definition of `mk_tls_server_timeout';
# flb_config.c.o:include/monkey/mk_tls.h:81: first defined here
# TODO: drop when upstream gets a fix for it:
# https://github.com/fluent/fluent-bit/issues/5537
++ lib.optionals stdenv.isDarwin [ "-fcommon" ];
outputs = [ "out" "dev" ];