From d1fb6cd8a55a4e7f8158f79da476398fcad033d0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 18 Aug 2022 23:39:31 -0700 Subject: fluentbit: Upgrade to 1.9.7 and fix build on x86 Signed-off-by: Khem Raj --- ...ert-Remove-unused-variable-in-mpi_mul_hlp.patch | 42 ++++++++++ .../recipes-extended/fluentbit/fluentbit_1.9.6.bb | 87 --------------------- .../recipes-extended/fluentbit/fluentbit_1.9.7.bb | 90 ++++++++++++++++++++++ 3 files changed, 132 insertions(+), 87 deletions(-) create mode 100644 meta-oe/recipes-extended/fluentbit/fluentbit/0001-Revert-Remove-unused-variable-in-mpi_mul_hlp.patch delete mode 100644 meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb create mode 100644 meta-oe/recipes-extended/fluentbit/fluentbit_1.9.7.bb diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Revert-Remove-unused-variable-in-mpi_mul_hlp.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Revert-Remove-unused-variable-in-mpi_mul_hlp.patch new file mode 100644 index 0000000000..8a165dc0d2 --- /dev/null +++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Revert-Remove-unused-variable-in-mpi_mul_hlp.patch @@ -0,0 +1,42 @@ +From af6cefba8c2675f58b75f93785337ab23054568c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 18 Aug 2022 23:35:23 -0700 +Subject: [PATCH] Revert Remove unused variable in mpi_mul_hlp() + +This reverts +https://github.com/Mbed-TLS/mbedtls/commit/e7f14a3090e6595eb3c8d821704ad9c90f6d3712 + +Which helps in compiling the x86 asm code. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + lib/mbedtls-2.28.0/library/bignum.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/lib/mbedtls-2.28.0/library/bignum.c b/lib/mbedtls-2.28.0/library/bignum.c +index 9c256ae..62e7f76 100644 +--- a/lib/mbedtls-2.28.0/library/bignum.c ++++ b/lib/mbedtls-2.28.0/library/bignum.c +@@ -1392,7 +1392,7 @@ void mpi_mul_hlp( size_t i, + mbedtls_mpi_uint *d, + mbedtls_mpi_uint b ) + { +- mbedtls_mpi_uint c = 0; ++ mbedtls_mpi_uint c = 0, t = 0; + + #if defined(MULADDC_HUIT) + for( ; i >= 8; i -= 8 ) +@@ -1443,6 +1443,8 @@ void mpi_mul_hlp( size_t i, + } + #endif /* MULADDC_HUIT */ + ++ t++; ++ + while( c != 0 ) + { + *d += c; c = ( *d < c ); d++; +-- +2.37.2 + diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb deleted file mode 100644 index a801694f42..0000000000 --- a/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb +++ /dev/null @@ -1,87 +0,0 @@ -SUMMARY = "Fast Log processor and Forwarder" -DESCRIPTION = "Fluent Bit is a data collector, processor and \ -forwarder for Linux. It supports several input sources and \ -backends (destinations) for your data. \ -" - -HOMEPAGE = "http://fluentbit.io" -BUGTRACKER = "https://github.com/fluent/fluent-bit/issues" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" -SECTION = "net" - -SRC_URI = "https://releases.fluentbit.io/1.9/source-${PV}.tar.gz;subdir=fluent-bit-${PV} \ - file://0001-CMakeLists.txt-Do-not-use-private-makefile-target.patch \ - file://0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch \ - file://0003-mbedtls-Do-not-overwrite-CFLAGS.patch \ - file://0004-build-Make-systemd-init-systemd-detection-contingent.patch \ - file://0001-monkey-Define-_GNU_SOURCE-for-memmem-API-check.patch \ - file://0002-mbedtls-Remove-unused-variable.patch \ - file://0003-mbedtls-Disable-documentation-warning-as-error-with-.patch \ - file://0004-Use-correct-type-to-store-return-from-flb_kv_item_cr.patch \ - file://0005-stackdriver-Fix-return-type-mismatch.patch \ - file://0006-monkey-Fix-TLS-detection-testcase.patch \ - " -SRC_URI:append:libc-musl = "\ - file://0001-Use-posix-strerror_r-with-musl.patch \ - file://0002-chunkio-Link-with-fts-library-with-musl.patch \ - " -SRC_URI[sha256sum] = "5ef7dd97e10936269fe5f4e5d3ebf16559333066f7d6757ba12464a9d6186570" - -S = "${WORKDIR}/fluent-bit-${PV}" - -DEPENDS = "zlib bison-native flex-native openssl" -DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" - -PACKAGECONFIG[yaml] = "-DFLB_CONFIG_YAML=On,-DFLB_CONFIG_YAML=Off,libyaml" -PACKAGECONFIG[kafka] = "-DFLB_OUT_KAFKA=On,-DFLB_OUT_KAFKA=Off,librdkafka" -PACKAGECONFIG[examples] = "-DFLB_EXAMPLES=On,-DFLB_EXAMPLES=Off" -PACKAGECONFIG[jemalloc] = "-DFLB_JEMALLOC=On,-DFLB_JEMALLOC=Off,jemalloc" -#TODO add more fluentbit options to PACKAGECONFIG[] - -DEPENDS:append:libc-musl = " fts " - -# flex hardcodes the input file in #line directives leading to TMPDIR contamination of debug sources. -do_compile:append() { - find ${B} -name '*.c' -or -name '*.h' | xargs sed -i -e 's|${TMPDIR}|/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/|g' -} - -PACKAGECONFIG ?= "yaml" - -LTO = "" - -# Use CMake 'Unix Makefiles' generator -OECMAKE_GENERATOR ?= "Unix Makefiles" - -# Fluent Bit build options -# ======================== - -# Host related setup -EXTRA_OECMAKE += "-DGNU_HOST=${HOST_SYS} -DFLB_TD=1" - -# Disable LuaJIT and filter_lua support -EXTRA_OECMAKE += "-DFLB_LUAJIT=Off -DFLB_FILTER_LUA=Off " - -# Disable Library and examples -EXTRA_OECMAKE += "-DFLB_SHARED_LIB=Off" - -# Enable systemd iff systemd is in DISTRO_FEATURES -EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEMD=On','-DFLB_SYSTEMD=Off',d)}" - -# Enable release builds -EXTRA_OECMAKE += "-DFLB_RELEASE=On" - -# musl needs these options -EXTRA_OECMAKE:append:libc-musl = ' -DFLB_JEMALLOC_OPTIONS="--with-jemalloc-prefix=je_ --with-lg-quantum=3" -DFLB_CORO_STACK_SIZE=24576' - -EXTRA_OECMAKE:append:riscv64 = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic" -EXTRA_OECMAKE:append:riscv32 = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic" -EXTRA_OECMAKE:append:mips = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic" - -inherit cmake systemd pkgconfig - -SYSTEMD_SERVICE:${PN} = "td-agent-bit.service" - -EXTRA_OECMAKE += "-DCMAKE_DEBUG_SRCDIR=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/" -TARGET_CC_ARCH += " ${SELECTED_OPTIMIZATION}" diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.7.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.7.bb new file mode 100644 index 0000000000..a1f879488d --- /dev/null +++ b/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.7.bb @@ -0,0 +1,90 @@ +SUMMARY = "Fast Log processor and Forwarder" +DESCRIPTION = "Fluent Bit is a data collector, processor and \ +forwarder for Linux. It supports several input sources and \ +backends (destinations) for your data. \ +" + +HOMEPAGE = "http://fluentbit.io" +BUGTRACKER = "https://github.com/fluent/fluent-bit/issues" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" +SECTION = "net" + +SRC_URI = "https://releases.fluentbit.io/1.9/source-${PV}.tar.gz;subdir=fluent-bit-${PV} \ + file://0001-CMakeLists.txt-Do-not-use-private-makefile-target.patch \ + file://0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch \ + file://0003-mbedtls-Do-not-overwrite-CFLAGS.patch \ + file://0004-build-Make-systemd-init-systemd-detection-contingent.patch \ + file://0001-monkey-Define-_GNU_SOURCE-for-memmem-API-check.patch \ + file://0002-mbedtls-Remove-unused-variable.patch \ + file://0003-mbedtls-Disable-documentation-warning-as-error-with-.patch \ + file://0004-Use-correct-type-to-store-return-from-flb_kv_item_cr.patch \ + file://0005-stackdriver-Fix-return-type-mismatch.patch \ + file://0006-monkey-Fix-TLS-detection-testcase.patch \ + file://0001-Revert-Remove-unused-variable-in-mpi_mul_hlp.patch \ + " +SRC_URI:append:libc-musl = "\ + file://0001-Use-posix-strerror_r-with-musl.patch \ + file://0002-chunkio-Link-with-fts-library-with-musl.patch \ + " +SRC_URI[sha256sum] = "8ca2ac081d7eee717483c06608adcb5e3d5373e182ad87dba21a23f8278c6540" +S = "${WORKDIR}/fluent-bit-${PV}" + +DEPENDS = "zlib bison-native flex-native openssl" +DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" + +PACKAGECONFIG[yaml] = "-DFLB_CONFIG_YAML=On,-DFLB_CONFIG_YAML=Off,libyaml" +PACKAGECONFIG[kafka] = "-DFLB_OUT_KAFKA=On,-DFLB_OUT_KAFKA=Off,librdkafka" +PACKAGECONFIG[examples] = "-DFLB_EXAMPLES=On,-DFLB_EXAMPLES=Off" +PACKAGECONFIG[jemalloc] = "-DFLB_JEMALLOC=On,-DFLB_JEMALLOC=Off,jemalloc" +#TODO add more fluentbit options to PACKAGECONFIG[] + +DEPENDS:append:libc-musl = " fts " + +# flex hardcodes the input file in #line directives leading to TMPDIR contamination of debug sources. +do_compile:append() { + find ${B} -name '*.c' -or -name '*.h' | xargs sed -i -e 's|${TMPDIR}|/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/|g' +} + +PACKAGECONFIG ?= "yaml" + +LTO = "" + +# Use CMake 'Unix Makefiles' generator +OECMAKE_GENERATOR ?= "Unix Makefiles" + +# Fluent Bit build options +# ======================== + +# Host related setup +EXTRA_OECMAKE += "-DGNU_HOST=${HOST_SYS} -DFLB_TD=1" + +# Disable LuaJIT and filter_lua support +EXTRA_OECMAKE += "-DFLB_LUAJIT=Off -DFLB_FILTER_LUA=Off " + +# Disable Library and examples +EXTRA_OECMAKE += "-DFLB_SHARED_LIB=Off" + +# Enable systemd iff systemd is in DISTRO_FEATURES +EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEMD=On','-DFLB_SYSTEMD=Off',d)}" + +# Enable release builds +EXTRA_OECMAKE += "-DFLB_RELEASE=On" + +# musl needs these options +EXTRA_OECMAKE:append:libc-musl = ' -DFLB_JEMALLOC_OPTIONS="--with-jemalloc-prefix=je_ --with-lg-quantum=3" -DFLB_CORO_STACK_SIZE=24576' + +EXTRA_OECMAKE:append:riscv64 = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic" +EXTRA_OECMAKE:append:riscv32 = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic" +EXTRA_OECMAKE:append:mips = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic" +EXTRA_OECMAKE:append:x86 = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic" + +CFLAGS:append:x86 = " -DMBEDTLS_HAVE_SSE2" + +inherit cmake systemd pkgconfig + +SYSTEMD_SERVICE:${PN} = "td-agent-bit.service" + +EXTRA_OECMAKE += "-DCMAKE_DEBUG_SRCDIR=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/" +TARGET_CC_ARCH += " ${SELECTED_OPTIMIZATION}" -- cgit v1.2.3-54-g00ecf