From 5cbb458bd44778376ccdd5ffccc3e5fc5492766a Mon Sep 17 00:00:00 2001 From: Thomas Devoogdt Date: Sat, 11 Feb 2023 19:25:45 +0100 Subject: [PATCH] package/fluent-bit: fix builds on s390x architectures Fixes: - http://autobuild.buildroot.net/results/856fd250f75a696694c70e3208ffcef7470a7082 - http://autobuild.buildroot.net/results/dceb413fb5d459338417d8dd5a42d95aa23e849b Signed-off-by: Thomas Devoogdt Signed-off-by: Peter Korsgaard --- package/fluent-bit/fluent-bit.mk | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/package/fluent-bit/fluent-bit.mk b/package/fluent-bit/fluent-bit.mk index 4ecf813511..d618fdf1e2 100644 --- a/package/fluent-bit/fluent-bit.mk +++ b/package/fluent-bit/fluent-bit.mk @@ -12,6 +12,9 @@ FLUENT_BIT_CPE_ID_VENDOR = treasuredata FLUENT_BIT_CPE_ID_PRODUCT = fluent_bit FLUENT_BIT_DEPENDENCIES = host-bison host-flex libyaml openssl +FLUENT_BIT_CFLAGS = $(TARGET_CFLAGS) +FLUENT_BIT_CXXFLAGS = $(TARGET_CXXFLAGS) + FLUENT_BIT_CONF_OPTS += \ -DFLB_DEBUG=No \ -DFLB_RELEASE=Yes \ @@ -42,12 +45,16 @@ FLUENT_BIT_CONF_OPTS += \ FLUENT_BIT_CONF_OPTS += \ -DCMAKE_INSTALL_SYSCONFDIR="/etc/" +# Fix multiple definition of `mk_tls_*'. +# https://github.com/fluent/fluent-bit/issues/5537 +FLUENT_BIT_CFLAGS += -fcommon +FLUENT_BIT_CXXFLAGS += -fcommon + # Undefining _FILE_OFFSET_BITS here because of a "bug" with glibc fts.h # large file support. -# See https://bugzilla.redhat.com/show_bug.cgi?id=574992 for more information. -FLUENT_BIT_CONF_OPTS += \ - -DCMAKE_C_FLAGS="$(TARGET_CFLAGS) -U_FILE_OFFSET_BITS" \ - -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -U_FILE_OFFSET_BITS" +# https://bugzilla.redhat.com/show_bug.cgi?id=574992 +FLUENT_BIT_CFLAGS += -U_FILE_OFFSET_BITS +FLUENT_BIT_CXXFLAGS += -U_FILE_OFFSET_BITS ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),) FLUENT_BIT_DEPENDENCIES += musl-fts @@ -60,7 +67,9 @@ FLUENT_BIT_LDFLAGS += -latomic endif FLUENT_BIT_CONF_OPTS += \ - -DCMAKE_EXE_LINKER_FLAGS="$(FLUENT_BIT_LDFLAGS)" + -DCMAKE_EXE_LINKER_FLAGS="$(FLUENT_BIT_LDFLAGS)" \ + -DCMAKE_C_FLAGS="$(FLUENT_BIT_CFLAGS)" \ + -DCMAKE_CXX_FLAGS="$(FLUENT_BIT_CXXFLAGS)" define FLUENT_BIT_INSTALL_INIT_SYSV $(INSTALL) -D -m 0755 package/fluent-bit/S99fluent-bit \