summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-oe/recipes-extended/fluentbit
diff options
context:
space:
mode:
authortakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
committertakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
commit1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch)
treecd70a267a5ef105ba32f200aa088e281fbd85747 /external/meta-openembedded/meta-oe/recipes-extended/fluentbit
parent4204309872da5cb401cbb2729d9e2d4869a87f42 (diff)
recipes
Diffstat (limited to 'external/meta-openembedded/meta-oe/recipes-extended/fluentbit')
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-fluent-bit-shared-Link-with-lpthread.patch35
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-ppc-Fix-signature-for-co_create-API.patch38
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch27
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch38
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch16
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.12.1.bb30
-rw-r--r--external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb58
7 files changed, 168 insertions, 74 deletions
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-fluent-bit-shared-Link-with-lpthread.patch b/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-fluent-bit-shared-Link-with-lpthread.patch
deleted file mode 100644
index e9eed24b..00000000
--- a/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-fluent-bit-shared-Link-with-lpthread.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 62fa9bceb15a9d160dd5d624a6d46907c1019c5c Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 8 Sep 2017 17:02:55 -0700
-Subject: [PATCH] fluent-bit-shared: Link with -lpthread
-
-This fixes a reference to pthread_atfork in libfluent-bit.so
-otherwise we get undefined reference to the symbols in binaries
-which are linked with libfluent-bit.so
-
-Fixes errors like
-arm-bec-linux-gnueabi-ld: ../../bin/hello_world: hidden symbol `pthread_atfork' in /mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-gnueabi/fluentbit/0.12.1-r0/recipe-sysroot/usr/lib/libpthread_nonshared.a(pthread_atfork.oS) is referenced by DSO
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Submitted
-
- src/CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
-index 425a246..1264e59 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -168,7 +168,7 @@ set(FLB_DEPS
- # Shared Library
- if(NOT FLB_WITHOUT_SHARED_LIB)
- add_library(fluent-bit-shared SHARED ${src})
-- target_link_libraries(fluent-bit-shared ${FLB_DEPS})
-+ target_link_libraries(fluent-bit-shared ${FLB_DEPS} -lpthread)
- set_target_properties(fluent-bit-shared
- PROPERTIES OUTPUT_NAME fluent-bit)
-
---
-2.14.1
-
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-ppc-Fix-signature-for-co_create-API.patch b/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-ppc-Fix-signature-for-co_create-API.patch
new file mode 100644
index 00000000..1f36c657
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-ppc-Fix-signature-for-co_create-API.patch
@@ -0,0 +1,38 @@
+From be4032079c931704f52e29f5da5c01cde24ac842 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 16 Jan 2020 10:44:58 -0800
+Subject: [PATCH] ppc: Fix signature for co_create API
+
+Upstream-Status: Submitted [https://github.com/fluent/fluent-bit/pull/1886]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/flb_libco/ppc.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/lib/flb_libco/ppc.c b/lib/flb_libco/ppc.c
+index e6536d56..533256b3 100644
+--- a/lib/flb_libco/ppc.c
++++ b/lib/flb_libco/ppc.c
+@@ -279,7 +279,9 @@ static uint32_t* co_create_(unsigned size, uintptr_t entry) {
+ return t;
+ }
+
+-cothread_t co_create(unsigned int size, void (*entry_)(void)) {
++cothread_t co_create(unsigned int size, void (*entry_)(void),
++ size_t *out_size) {
++
+ uintptr_t entry = (uintptr_t)entry_;
+ uint32_t* t = 0;
+
+@@ -325,7 +327,7 @@ cothread_t co_create(unsigned int size, void (*entry_)(void)) {
+ t[10] = (uint32_t)(sp >> shift >> shift);
+ t[11] = (uint32_t)sp;
+ }
+-
++ *out_size = size;
+ return t;
+ }
+
+--
+2.25.0
+
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch b/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch
new file mode 100644
index 00000000..8ffc3be3
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch
@@ -0,0 +1,27 @@
+help complier to use intrinsics, clang in few cases e.g. aarch64 can not
+and then requires linking with libm, its the only function needed from libm then
+its good to avoid needing it.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/include/fluent-bit/stream_processor/flb_sp_timeseries.h
++++ b/include/fluent-bit/stream_processor/flb_sp_timeseries.h
+@@ -207,7 +207,7 @@ void cb_forecast_calc(struct timeseries
+ result = b0 + b1 * (val->f64 + *forecast->latest_x);
+ break;
+ default:
+- result = nan("");
++ result = __builtin_nan("");
+ break;
+ }
+
+@@ -283,7 +283,7 @@ void cb_forecast_r_calc(struct timeserie
+ result = ((val->i64 - b0) / b1) - *forecast->latest_x;
+ break;
+ default:
+- result = nan("");
++ result = __builtin_nan("");
+ break;
+ }
+
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch b/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch
new file mode 100644
index 00000000..a1857899
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch
@@ -0,0 +1,38 @@
+Define CMake variables to indicate init system for target
+incase of cross compile, detecting systemd support based on
+host directory structure is not right thing to do
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.kheem@gmail.com>
+
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -317,7 +317,7 @@ if(FLB_BINARY)
+ install(TARGETS fluent-bit-bin RUNTIME DESTINATION ${FLB_INSTALL_BINDIR})
+
+ # Detect init system, install upstart, systemd or init.d script
+- if(IS_DIRECTORY /lib/systemd/system)
++ if(IS_DIRECTORY /lib/systemd/system OR FLB_SYSTEMD)
+ set(FLB_SYSTEMD_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.service")
+ configure_file(
+ "${PROJECT_SOURCE_DIR}/init/systemd.in"
+@@ -325,7 +325,7 @@ if(FLB_BINARY)
+ )
+ install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION /lib/systemd/system)
+ install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR})
+- elseif(IS_DIRECTORY /usr/share/upstart)
++ elseif(IS_DIRECTORY /usr/share/upstart OR FLB_UPSTART)
+ set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf")
+ configure_file(
+ "${PROJECT_SOURCE_DIR}/init/upstart.in"
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -70,6 +70,8 @@ option(FLB_RECORD_ACCESSOR "Enable re
+ option(FLB_SYSTEM_STRPTIME "Use strptime in system libc" Yes)
+ option(FLB_STATIC_CONF "Build binary using static configuration")
+ option(FLB_STREAM_PROCESSOR "Enable Stream Processor" Yes)
++option(FLB_SYSTEMD "Enable systemd init system" No)
++option(FLB_UPSTART "Enable upstart init system" No)
+ option(FLB_CORO_STACK_SIZE "Set coroutine stack size")
+
+ # Metrics: Experimental Feature, disabled by default on 0.12 series
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch b/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch
index abaf92c0..67b3397a 100644
--- a/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch
+++ b/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch
@@ -3,16 +3,14 @@ Add --with-jemalloc-prefix=je_ so it compiles on musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
-Index: fluent-bit-0.12.1/CMakeLists.txt
-===================================================================
---- fluent-bit-0.12.1.orig/CMakeLists.txt
-+++ fluent-bit-0.12.1/CMakeLists.txt
-@@ -325,7 +325,7 @@ if(FLB_JEMALLOC AND ${CMAKE_SYSTEM_NAME}
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -523,7 +523,7 @@ if(FLB_JEMALLOC AND ${CMAKE_SYSTEM_NAME}
# Link to Jemalloc as an external dependency
ExternalProject_Add(jemalloc
- SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc
-- CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc/configure ${AUTOCONF_HOST_OPT} --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR>
-+ CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc/configure --with-jemalloc-prefix=je_ ${AUTOCONF_HOST_OPT} --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR>
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1
+- CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1/configure ${AUTOCONF_HOST_OPT} --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR>
++ CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1/configure ${AUTOCONF_HOST_OPT} --with-jemalloc-prefix=je_ --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR>
CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops
- BUILD_COMMAND ${MAKE}
+ BUILD_COMMAND $(MAKE)
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.12.1.bb b/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.12.1.bb
deleted file mode 100644
index 99f680f9..00000000
--- a/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.12.1.bb
+++ /dev/null
@@ -1,30 +0,0 @@
-SUMMARY = "Fast data collector for Embedded Linux"
-HOMEPAGE = "http://fluentbit.io"
-BUGTRACKER = "https://github.com/fluent/fluent-bit/issues"
-
-SRC_URI = "http://fluentbit.io/releases/0.12/fluent-bit-${PV}.tar.gz \
- file://jemalloc.patch \
- file://0001-fluent-bit-shared-Link-with-lpthread.patch \
- "
-SRC_URI[md5sum] = "6b4472cb7e7213a01425af9121576827"
-SRC_URI[sha256sum] = "8ec05365baea723033165687611b3bba3e67a77dce72e282e9f000f7acf9e37b"
-
-S = "${WORKDIR}/fluent-bit-${PV}"
-
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
-
-DEPENDS = "zlib"
-INSANE_SKIP_${PN}-dev += "dev-elf"
-
-inherit cmake systemd
-
-EXTRA_OECMAKE = "-DGNU_HOST=${HOST_SYS} -DFLB_ALL=ON -DFLB_TD=1"
-
-# With Ninja it fails with:
-# ninja: error: build.ninja:134: bad $-escape (literal $ must be written as $$)
-OECMAKE_GENERATOR = "Unix Makefiles"
-
-SYSTEMD_SERVICE_${PN} = "td-agent-bit.service"
-
-TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}"
diff --git a/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb b/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb
new file mode 100644
index 00000000..06895a03
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb
@@ -0,0 +1,58 @@
+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 = "http://fluentbit.io/releases/1.3/fluent-bit-${PV}.tar.gz \
+ file://jemalloc.patch \
+ file://cross-build-init-system-detection.patch \
+ file://builtin-nan.patch \
+ file://0001-ppc-Fix-signature-for-co_create-API.patch \
+ "
+SRC_URI[md5sum] = "6eae6dfd0a874e5dd270c36e9c68f747"
+SRC_URI[sha256sum] = "e037c76c89269c8dc4027a08e442fefd2751b0f1e0f9c38f9a4b12d781a9c789"
+
+S = "${WORKDIR}/fluent-bit-${PV}"
+DEPENDS = "zlib bison-native flex-native"
+DEPENDS_append_libc-musl = " fts "
+
+INSANE_SKIP_${PN}-dev += "dev-elf"
+
+# Use CMake 'Unix Makefiles' generator
+OECMAKE_GENERATOR ?= "Unix Makefiles"
+
+# Fluent Bit build options
+# ========================
+
+# Host related setup
+EXTRA_OECMAKE += "-DGNU_HOST=${HOST_SYS} -DFLB_ALL=ON -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 -DFLB_EXAMPLES=Off "
+
+EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEMD=On','',d)}"
+
+EXTRA_OECMAKE_append_riscv64 = " -DFLB_DEPS='atomic'"
+
+# Kafka Output plugin (disabled by default): note that when
+# enabling Kafka output plugin, the backend library librdkafka
+# requires 'openssl' as a dependency.
+#
+# DEPENDS += "openssl "
+# EXTRA_OECMAKE += "-DFLB_OUT_KAFKA=On "
+
+inherit cmake systemd features_check
+
+SYSTEMD_SERVICE_${PN} = "td-agent-bit.service"
+TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}"