summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Neves <ptsneves@gmail.com>2022-08-02 11:26:00 +0200
committerKhem Raj <raj.khem@gmail.com>2022-08-06 09:12:15 -0700
commitd09755e8e3f0a2d7268a95846cb70d04b7722a81 (patch)
tree1a05af31469bc84f71dbbc48a7eb7ba2e0a197fd
parent21233e7ac9da885fe37acacd9e793de6a8e27efd (diff)
downloadmeta-openembedded-d09755e8e3f0a2d7268a95846cb70d04b7722a81.tar.gz
fluentbit Upgrade to 1.3.5 -> 1.9.6
Signed-off-by: Paulo Neves <ptsneves@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0001-CMakeLists.txt-Do-not-use-private-makefile-target.patch71
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch28
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0001-bin-fix-SIGSEGV-caused-by-using-flb_free-instead-of-.patch43
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0001-ppc-Fix-signature-for-co_create-API.patch38
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch26
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0002-parser-Fix-SIGSEGV-caused-by-using-flb_free-instead-.patch82
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0003-mbedtls-Do-not-overwrite-CFLAGS.patch28
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0004-build-Make-systemd-init-systemd-detection-contingent.patch64
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch27
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch38
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb69
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb72
12 files changed, 261 insertions, 325 deletions
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-CMakeLists.txt-Do-not-use-private-makefile-target.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-CMakeLists.txt-Do-not-use-private-makefile-target.patch
new file mode 100644
index 0000000000..b4634a2445
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-CMakeLists.txt-Do-not-use-private-makefile-target.patch
@@ -0,0 +1,71 @@
1From 6a704ab7bf69cd5d6970b3a7d3ae7798b26027c1 Mon Sep 17 00:00:00 2001
2From: Paulo Neves <ptsneves@gmail.com>
3Date: Thu, 28 Jul 2022 11:28:41 +0200
4Subject: [PATCH] CMakeLists.txt Do not use private makefile $< target
5
6$< is a private detail from the Makefile generated by CMakefile and
7are not under control or to be used at the CMakeLists level. In 3.20
8that private generation changed pre-requisite targets[1] and now logs
9contain the path compiler_depend.ts instead of the actual file.
10
11Upstream status: Pending [1]
12[1] https://github.com/fluent/fluent-bit/issues/5492
13---
14 CMakeLists.txt | 6 +-----
15 lib/chunkio/CMakeLists.txt | 7 +------
16 lib/cmetrics/CMakeLists.txt | 7 +------
17 3 files changed, 3 insertions(+), 17 deletions(-)
18
19diff --git a/CMakeLists.txt b/CMakeLists.txt
20index 3dba5a8..d94b988 100644
21--- a/CMakeLists.txt
22+++ b/CMakeLists.txt
23@@ -46,11 +46,7 @@ else()
24 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
25 endif()
26
27-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
28- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
29-else()
30- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
31-endif()
32+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
33
34 if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l")
35 set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -latomic")
36diff --git a/lib/chunkio/CMakeLists.txt b/lib/chunkio/CMakeLists.txt
37index bbe1f39..809ea93 100644
38--- a/lib/chunkio/CMakeLists.txt
39+++ b/lib/chunkio/CMakeLists.txt
40@@ -14,12 +14,7 @@ else()
41 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall ")
42 endif()
43
44-# Set __FILENAME__
45-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
46- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
47-else()
48- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
49-endif()
50+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
51
52 include(cmake/macros.cmake)
53
54diff --git a/lib/cmetrics/CMakeLists.txt b/lib/cmetrics/CMakeLists.txt
55index 60e8774..e3d6149 100644
56--- a/lib/cmetrics/CMakeLists.txt
57+++ b/lib/cmetrics/CMakeLists.txt
58@@ -34,12 +34,7 @@ set(CMT_VERSION_MINOR 3)
59 set(CMT_VERSION_PATCH 5)
60 set(CMT_VERSION_STR "${CMT_VERSION_MAJOR}.${CMT_VERSION_MINOR}.${CMT_VERSION_PATCH}")
61
62-# Define __FILENAME__ consistently across Operating Systems
63-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
64- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
65-else()
66- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
67-endif()
68+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
69
70 # Configuration options
71 option(CMT_DEV "Enable development mode" No)
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch
deleted file mode 100644
index bf4cda08f0..0000000000
--- a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 5571f949fa2048b79c197b5b10a11ecb1891cbe9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 23 Apr 2022 08:24:34 -0700
4Subject: [PATCH] Control sytemd unit install location with SYSTEM_DIR
5
6This helps building when usrmerge is on
7
8Upstream-Status: Pending
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/CMakeLists.txt | 6 +++++-
12 1 file changed, 5 insertions(+), 1 deletion(-)
13
14--- a/src/CMakeLists.txt
15+++ b/src/CMakeLists.txt
16@@ -323,7 +323,11 @@ if(FLB_BINARY)
17 "${PROJECT_SOURCE_DIR}/init/systemd.in"
18 ${FLB_SYSTEMD_SCRIPT}
19 )
20- install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION /lib/systemd/system)
21+ if(SYSTEMD_DIR)
22+ install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION ${SYSTEMD_DIR})
23+ else()
24+ install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION /lib/systemd/system)
25+ endif()
26 install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR})
27 elseif(FLB_UPSTART)
28 set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf")
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-bin-fix-SIGSEGV-caused-by-using-flb_free-instead-of-.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-bin-fix-SIGSEGV-caused-by-using-flb_free-instead-of-.patch
deleted file mode 100644
index a6ff5991c2..0000000000
--- a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-bin-fix-SIGSEGV-caused-by-using-flb_free-instead-of-.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 3d7390c89c2205d1eed0384be0bb65adb675e60d Mon Sep 17 00:00:00 2001
2From: Ramon Fried <ramon@neureality.ai>
3Date: Tue, 9 Feb 2021 18:59:59 +0200
4Subject: [PATCH] bin: fix SIGSEGV caused by using flb_free instead of
5 mk_mem_free
6
7Upstream-Status: Accepted
8Signed-off-by: Ramon Fried <ramon@neureality.ai>
9---
10 src/fluent-bit.c | 6 +++---
11 1 file changed, 3 insertions(+), 3 deletions(-)
12
13diff --git a/src/fluent-bit.c b/src/fluent-bit.c
14index c0c73b4..989cfde 100644
15--- a/src/fluent-bit.c
16+++ b/src/fluent-bit.c
17@@ -289,7 +289,7 @@ static int input_set_property(struct flb_input_instance *in, char *kv)
18 in->p->name, key);
19 }
20
21- flb_free(key);
22+ mk_mem_free(key);
23 return ret;
24 }
25
26@@ -314,7 +314,7 @@ static int output_set_property(struct flb_output_instance *out, char *kv)
27 }
28
29 ret = flb_output_set_property(out, key, value);
30- flb_free(key);
31+ mk_mem_free(key);
32 return ret;
33 }
34
35@@ -340,7 +340,7 @@ static int filter_set_property(struct flb_filter_instance *filter, char *kv)
36 }
37
38 ret = flb_filter_set_property(filter, key, value);
39- flb_free(key);
40+ mk_mem_free(key);
41 return ret;
42 }
43
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-ppc-Fix-signature-for-co_create-API.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-ppc-Fix-signature-for-co_create-API.patch
deleted file mode 100644
index 1f36c657ed..0000000000
--- a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-ppc-Fix-signature-for-co_create-API.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From be4032079c931704f52e29f5da5c01cde24ac842 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 16 Jan 2020 10:44:58 -0800
4Subject: [PATCH] ppc: Fix signature for co_create API
5
6Upstream-Status: Submitted [https://github.com/fluent/fluent-bit/pull/1886]
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 lib/flb_libco/ppc.c | 6 ++++--
10 1 file changed, 4 insertions(+), 2 deletions(-)
11
12diff --git a/lib/flb_libco/ppc.c b/lib/flb_libco/ppc.c
13index e6536d56..533256b3 100644
14--- a/lib/flb_libco/ppc.c
15+++ b/lib/flb_libco/ppc.c
16@@ -279,7 +279,9 @@ static uint32_t* co_create_(unsigned size, uintptr_t entry) {
17 return t;
18 }
19
20-cothread_t co_create(unsigned int size, void (*entry_)(void)) {
21+cothread_t co_create(unsigned int size, void (*entry_)(void),
22+ size_t *out_size) {
23+
24 uintptr_t entry = (uintptr_t)entry_;
25 uint32_t* t = 0;
26
27@@ -325,7 +327,7 @@ cothread_t co_create(unsigned int size, void (*entry_)(void)) {
28 t[10] = (uint32_t)(sp >> shift >> shift);
29 t[11] = (uint32_t)sp;
30 }
31-
32+ *out_size = size;
33 return t;
34 }
35
36--
372.25.0
38
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch
new file mode 100644
index 0000000000..4358b2a512
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch
@@ -0,0 +1,26 @@
1From 71dab751a27a2e582b711de22873065dd28f4b65 Mon Sep 17 00:00:00 2001
2From: Paulo Neves <ptsneves@gmail.com>
3Date: Thu, 28 Jul 2022 11:42:31 +0200
4Subject: [PATCH] flb_info.h.in: Do not hardcode compilation directories
5
6Including the source dir in the header makes the header not
7reproducible and contaminates it with host builder paths. Instead
8make it take CMAKE_DEBUG_SRCDIR that can be set to a known
9reproducible value
10---
11 include/fluent-bit/flb_info.h.in | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/include/fluent-bit/flb_info.h.in b/include/fluent-bit/flb_info.h.in
15index a89485c..2579afc 100644
16--- a/include/fluent-bit/flb_info.h.in
17+++ b/include/fluent-bit/flb_info.h.in
18@@ -23,7 +23,7 @@
19 #define STR_HELPER(s) #s
20 #define STR(s) STR_HELPER(s)
21
22-#define FLB_SOURCE_DIR "@CMAKE_SOURCE_DIR@"
23+#define FLB_SOURCE_DIR "@CMAKE_DEBUG_SRCDIR@"
24
25 /* General flags set by CMakeLists.txt */
26 @FLB_BUILD_FLAGS@
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0002-parser-Fix-SIGSEGV-caused-by-using-flb_free-instead-.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0002-parser-Fix-SIGSEGV-caused-by-using-flb_free-instead-.patch
deleted file mode 100644
index 91675dfc6d..0000000000
--- a/meta-oe/recipes-extended/fluentbit/fluentbit/0002-parser-Fix-SIGSEGV-caused-by-using-flb_free-instead-.patch
+++ /dev/null
@@ -1,82 +0,0 @@
1From 7c3b1dfb174312594d3317c24ed71c60398f653f Mon Sep 17 00:00:00 2001
2From: Ramon Fried <ramon@neureality.ai>
3Date: Wed, 10 Feb 2021 04:23:36 +0200
4Subject: [PATCH] parser: Fix SIGSEGV caused by using flb_free instead of
5 mk_mem_free
6
7Upstream-Status: Backport (fix only for 1.3.5)
8Signed-off-by: Ramon Fried <ramon@neureality.ai>
9---
10 src/flb_parser.c | 28 ++++++++++++++--------------
11 1 file changed, 14 insertions(+), 14 deletions(-)
12
13diff --git a/src/flb_parser.c b/src/flb_parser.c
14index d35c568..7c20e12 100644
15--- a/src/flb_parser.c
16+++ b/src/flb_parser.c
17@@ -490,7 +490,7 @@ int flb_parser_conf_file(const char *file, struct flb_config *config)
18 MK_RCONF_STR);
19 if (str) {
20 time_keep = flb_utils_bool(str);
21- flb_free(str);
22+ mk_mem_free(str);
23 }
24 else {
25 time_keep = FLB_FALSE;
26@@ -522,23 +522,23 @@ int flb_parser_conf_file(const char *file, struct flb_config *config)
27
28 flb_debug("[parser] new parser registered: %s", name);
29
30- flb_free(name);
31- flb_free(format);
32+ mk_mem_free(name);
33+ mk_mem_free(format);
34
35 if (regex) {
36- flb_free(regex);
37+ mk_mem_free(regex);
38 }
39 if (time_fmt) {
40- flb_free(time_fmt);
41+ mk_mem_free(time_fmt);
42 }
43 if (time_key) {
44- flb_free(time_key);
45+ mk_mem_free(time_key);
46 }
47 if (time_offset) {
48- flb_free(time_offset);
49+ mk_mem_free(time_offset);
50 }
51 if (types_str) {
52- flb_free(types_str);
53+ mk_mem_free(types_str);
54 }
55
56 decoders = NULL;
57@@ -548,19 +548,19 @@ int flb_parser_conf_file(const char *file, struct flb_config *config)
58 return 0;
59
60 fconf_error:
61- flb_free(name);
62- flb_free(format);
63+ mk_mem_free(name);
64+ mk_mem_free(format);
65 if (regex) {
66- flb_free(regex);
67+ mk_mem_free(regex);
68 }
69 if (time_fmt) {
70- flb_free(time_fmt);
71+ mk_mem_free(time_fmt);
72 }
73 if (time_key) {
74- flb_free(time_key);
75+ mk_mem_free(time_key);
76 }
77 if (types_str) {
78- flb_free(types_str);
79+ mk_mem_free(types_str);
80 }
81 if (decoders) {
82 flb_parser_decoder_list_destroy(decoders);
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0003-mbedtls-Do-not-overwrite-CFLAGS.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0003-mbedtls-Do-not-overwrite-CFLAGS.patch
new file mode 100644
index 0000000000..a7d7dc8897
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0003-mbedtls-Do-not-overwrite-CFLAGS.patch
@@ -0,0 +1,28 @@
1From 8486b912281ae85db0c9fc05bb546f16872e114c Mon Sep 17 00:00:00 2001
2From: Paulo Neves <ptsneves@gmail.com>
3Date: Thu, 28 Jul 2022 14:37:18 +0200
4Subject: [PATCH] mbedtls: Do not overwrite CFLAGS
5
6bitbake passes CFLAGS that are often in conflict with the ones set
7in mbedtls' CMakeLists.txt. Such conflicts are the inability to use
8FORTIFY_SOURCE=2 except in release mode
9
10Upstream status: Innapropriate due to fluent-bit having it's own Release
11flags that also overwrite bitbake ones.
12---
13 lib/mbedtls-2.28.0/CMakeLists.txt | 2 --
14 1 file changed, 2 deletions(-)
15
16diff --git a/lib/mbedtls-2.28.0/CMakeLists.txt b/lib/mbedtls-2.28.0/CMakeLists.txt
17index d76bddc..e717846 100644
18--- a/lib/mbedtls-2.28.0/CMakeLists.txt
19+++ b/lib/mbedtls-2.28.0/CMakeLists.txt
20@@ -204,8 +204,6 @@ if(CMAKE_COMPILER_IS_GNU)
21 if (GCC_VERSION VERSION_GREATER 7.0 OR GCC_VERSION VERSION_EQUAL 7.0)
22 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat-overflow=2 -Wformat-truncation")
23 endif()
24- set(CMAKE_C_FLAGS_RELEASE "-O2")
25- set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
26 set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
27 set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O3")
28 set(CMAKE_C_FLAGS_ASANDBG "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls")
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0004-build-Make-systemd-init-systemd-detection-contingent.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0004-build-Make-systemd-init-systemd-detection-contingent.patch
new file mode 100644
index 0000000000..9d4d950d15
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0004-build-Make-systemd-init-systemd-detection-contingent.patch
@@ -0,0 +1,64 @@
1From 7a792624925d46690c1f07fe4b194b5f4c510db6 Mon Sep 17 00:00:00 2001
2From: Paulo Neves <ptsneves@gmail.com>
3Date: Tue, 2 Aug 2022 09:57:05 +0200
4Subject: [PATCH 1/1] build: Make systemd init systemd detection contingent on
5 pkgconfig
6
7Use pkg-config to get systemd.pc variables and systemdunitdir. Those
8variable ensure that .service files are installed in the correct paths
9and only when systemd is detected.
10
11Upstream Status: Pending [1]
12[1] https://github.com/fluent/fluent-bit/pull/5818
13
14---
15 cmake/FindJournald.cmake | 4 ++++
16 src/CMakeLists.txt | 4 ++--
17 2 files changed, 6 insertions(+), 2 deletions(-)
18
19diff --git a/cmake/FindJournald.cmake b/cmake/FindJournald.cmake
20index f5a3a832b..9e6657a29 100644
21--- a/cmake/FindJournald.cmake
22+++ b/cmake/FindJournald.cmake
23@@ -5,6 +5,8 @@
24 # JOURNALD_INCLUDE_DIR - the Journald include directory
25 # JOURNALD_LIBRARIES - Link these to use Journald
26 # JOURNALD_DEFINITIONS - Compiler switches required for using Journald
27+# SYSTEMD_UNITDIR - The systemd units' directory
28+#
29 # Redistribution and use is allowed according to the terms of the BSD license.
30 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
31 #
32@@ -16,7 +18,9 @@
33 # in the FIND_PATH() and FIND_LIBRARY() calls
34 find_package(PkgConfig)
35 pkg_check_modules(PC_JOURNALD QUIET systemd)
36+pkg_get_variable(PC_SYSTEMD_UNITDIR systemd "systemdsystemunitdir")
37
38+set(SYSTEMD_UNITDIR ${PC_SYSTEMD_UNITDIR})
39 set(JOURNALD_FOUND ${PC_JOURNALD_FOUND})
40 set(JOURNALD_DEFINITIONS ${PC_JOURNALD_CFLAGS_OTHER})
41
42diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
43index 522bbf9bd..30743d8d6 100644
44--- a/src/CMakeLists.txt
45+++ b/src/CMakeLists.txt
46@@ -480,13 +480,13 @@ if(FLB_BINARY)
47 endif()
48
49 # Detect init system, install upstart, systemd or init.d script
50- if(IS_DIRECTORY /lib/systemd/system)
51+ if(DEFINED SYSTEMD_UNITDIR)
52 set(FLB_SYSTEMD_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.service")
53 configure_file(
54 "${PROJECT_SOURCE_DIR}/init/systemd.in"
55 ${FLB_SYSTEMD_SCRIPT}
56 )
57- install(FILES ${FLB_SYSTEMD_SCRIPT} COMPONENT binary DESTINATION /lib/systemd/system)
58+ install(FILES ${FLB_SYSTEMD_SCRIPT} COMPONENT binary DESTINATION ${SYSTEMD_UNITDIR})
59 install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR} COMPONENT binary)
60 elseif(IS_DIRECTORY /usr/share/upstart)
61 set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf")
62--
632.25.1
64
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch
deleted file mode 100644
index 8ffc3be3ef..0000000000
--- a/meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch
+++ /dev/null
@@ -1,27 +0,0 @@
1help complier to use intrinsics, clang in few cases e.g. aarch64 can not
2and then requires linking with libm, its the only function needed from libm then
3its good to avoid needing it.
4
5Upstream-Status: Pending
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8--- a/include/fluent-bit/stream_processor/flb_sp_timeseries.h
9+++ b/include/fluent-bit/stream_processor/flb_sp_timeseries.h
10@@ -207,7 +207,7 @@ void cb_forecast_calc(struct timeseries
11 result = b0 + b1 * (val->f64 + *forecast->latest_x);
12 break;
13 default:
14- result = nan("");
15+ result = __builtin_nan("");
16 break;
17 }
18
19@@ -283,7 +283,7 @@ void cb_forecast_r_calc(struct timeserie
20 result = ((val->i64 - b0) / b1) - *forecast->latest_x;
21 break;
22 default:
23- result = nan("");
24+ result = __builtin_nan("");
25 break;
26 }
27
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch
deleted file mode 100644
index d3822fc8da..0000000000
--- a/meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1Define CMake variables to indicate init system for target
2incase of cross compile, detecting systemd support based on
3host directory structure is not right thing to do
4
5Upstream-Status: Pending
6Signed-off-by: Khem Raj <raj.kheem@gmail.com>
7
8--- a/src/CMakeLists.txt
9+++ b/src/CMakeLists.txt
10@@ -317,7 +317,7 @@ if(FLB_BINARY)
11 install(TARGETS fluent-bit-bin RUNTIME DESTINATION ${FLB_INSTALL_BINDIR})
12
13 # Detect init system, install upstart, systemd or init.d script
14- if(IS_DIRECTORY /lib/systemd/system)
15+ if(FLB_SYSTEMD)
16 set(FLB_SYSTEMD_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.service")
17 configure_file(
18 "${PROJECT_SOURCE_DIR}/init/systemd.in"
19@@ -325,7 +325,7 @@ if(FLB_BINARY)
20 )
21 install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION /lib/systemd/system)
22 install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR})
23- elseif(IS_DIRECTORY /usr/share/upstart)
24+ elseif(FLB_UPSTART)
25 set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf")
26 configure_file(
27 "${PROJECT_SOURCE_DIR}/init/upstart.in"
28--- a/CMakeLists.txt
29+++ b/CMakeLists.txt
30@@ -70,6 +70,8 @@ option(FLB_RECORD_ACCESSOR "Enable re
31 option(FLB_SYSTEM_STRPTIME "Use strptime in system libc" Yes)
32 option(FLB_STATIC_CONF "Build binary using static configuration")
33 option(FLB_STREAM_PROCESSOR "Enable Stream Processor" Yes)
34+option(FLB_SYSTEMD "Enable systemd init system" No)
35+option(FLB_UPSTART "Enable upstart init system" No)
36 option(FLB_CORO_STACK_SIZE "Set coroutine stack size")
37
38 # Metrics: Experimental Feature, disabled by default on 0.12 series
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb
deleted file mode 100644
index b231cc2878..0000000000
--- a/meta-oe/recipes-extended/fluentbit/fluentbit_1.3.5.bb
+++ /dev/null
@@ -1,69 +0,0 @@
1SUMMARY = "Fast Log processor and Forwarder"
2DESCRIPTION = "Fluent Bit is a data collector, processor and \
3forwarder for Linux. It supports several input sources and \
4backends (destinations) for your data. \
5"
6
7HOMEPAGE = "http://fluentbit.io"
8BUGTRACKER = "https://github.com/fluent/fluent-bit/issues"
9
10LICENSE = "Apache-2.0"
11LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
12SECTION = "net"
13
14SRC_URI = "http://fluentbit.io/releases/1.3/fluent-bit-${PV}.tar.gz \
15 file://jemalloc.patch \
16 file://cross-build-init-system-detection.patch \
17 file://builtin-nan.patch \
18 file://0001-ppc-Fix-signature-for-co_create-API.patch \
19 file://0001-bin-fix-SIGSEGV-caused-by-using-flb_free-instead-of-.patch \
20 file://0002-parser-Fix-SIGSEGV-caused-by-using-flb_free-instead-.patch \
21 file://0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch \
22 "
23SRC_URI[md5sum] = "6eae6dfd0a874e5dd270c36e9c68f747"
24SRC_URI[sha256sum] = "e037c76c89269c8dc4027a08e442fefd2751b0f1e0f9c38f9a4b12d781a9c789"
25
26S = "${WORKDIR}/fluent-bit-${PV}"
27DEPENDS = "zlib bison-native flex-native"
28DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
29
30DEPENDS:append:libc-musl = " fts "
31
32INSANE_SKIP:${PN}-dev += "dev-elf"
33
34LTO = ""
35
36# Use CMake 'Unix Makefiles' generator
37OECMAKE_GENERATOR ?= "Unix Makefiles"
38
39# Fluent Bit build options
40# ========================
41
42# Host related setup
43EXTRA_OECMAKE += "-DGNU_HOST=${HOST_SYS} -DFLB_ALL=ON -DFLB_TD=1"
44
45# Disable LuaJIT and filter_lua support
46EXTRA_OECMAKE += "-DFLB_LUAJIT=Off -DFLB_FILTER_LUA=Off "
47
48# Disable Library and examples
49EXTRA_OECMAKE += "-DFLB_SHARED_LIB=Off -DFLB_EXAMPLES=Off "
50
51# Enable systemd iff systemd is in DISTRO_FEATURES
52EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEMD=On -DSYSTEMD_DIR=${systemd_system_unitdir}','-DFLB_SYSTEMD=Off',d)}"
53
54EXTRA_OECMAKE:append:riscv64 = " -DFLB_DEPS='atomic'"
55EXTRA_OECMAKE:append:riscv32 = " -DFLB_DEPS='atomic'"
56
57# Kafka Output plugin (disabled by default): note that when
58# enabling Kafka output plugin, the backend library librdkafka
59# requires 'openssl' as a dependency.
60#
61# DEPENDS += "openssl "
62# EXTRA_OECMAKE += "-DFLB_OUT_KAFKA=On "
63
64inherit cmake systemd
65
66CFLAGS += "-fcommon"
67
68SYSTEMD_SERVICE:${PN} = "td-agent-bit.service"
69TARGET_CC_ARCH:append = " ${SELECTED_OPTIMIZATION}"
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb
new file mode 100644
index 0000000000..f98d416b24
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb
@@ -0,0 +1,72 @@
1SUMMARY = "Fast Log processor and Forwarder"
2DESCRIPTION = "Fluent Bit is a data collector, processor and \
3forwarder for Linux. It supports several input sources and \
4backends (destinations) for your data. \
5"
6
7HOMEPAGE = "http://fluentbit.io"
8BUGTRACKER = "https://github.com/fluent/fluent-bit/issues"
9
10LICENSE = "Apache-2.0"
11LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
12SECTION = "net"
13
14SRC_URI = "https://releases.fluentbit.io/1.9/source-${PV}.tar.gz;subdir=fluent-bit-${PV} \
15 file://0001-CMakeLists.txt-Do-not-use-private-makefile-target.patch \
16 file://0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch \
17 file://0003-mbedtls-Do-not-overwrite-CFLAGS.patch \
18 file://0004-build-Make-systemd-init-systemd-detection-contingent.patch \
19 "
20SRC_URI[sha256sum] = "5ef7dd97e10936269fe5f4e5d3ebf16559333066f7d6757ba12464a9d6186570"
21
22S = "${WORKDIR}/fluent-bit-${PV}"
23
24DEPENDS = "zlib bison-native flex-native openssl"
25DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
26
27PACKAGECONFIG[yaml] = "-DFLB_CONFIG_YAML=On,-DFLB_CONFIG_YAML=Off,libyaml"
28PACKAGECONFIG[kafka] = "-DFLB_OUT_KAFKA=On,-DFLB_OUT_KAFKA=Off,librdkafka"
29PACKAGECONFIG[examples] = "-DFLB_EXAMPLES=On,-DFLB_EXAMPLES=Off"
30PACKAGECONFIG[jemalloc] = "-DFLB_JEMALLOC=On,-DFLB_JEMALLOC=Off,jemalloc"
31#TODO add more fluentbit options to PACKAGECONFIG[]
32
33DEPENDS:append:libc-musl = " fts "
34
35# flex hardcodes the input file in #line directives leading to TMPDIR contamination of debug sources.
36do_compile:append() {
37 find ${B} -name '*.c' -or -name '*.h' | xargs sed -i -e 's|${TMPDIR}|/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/|g'
38}
39
40FLB_JEMALLOC_OPTIONS_LIST = "--with-jemalloc-prefix=je_ --with-lg-quantum=3"
41
42PACKAGECONFIG ?= "yaml"
43
44LTO = ""
45
46# Use CMake 'Unix Makefiles' generator
47OECMAKE_GENERATOR ?= "Unix Makefiles"
48
49# Fluent Bit build options
50# ========================
51
52# Host related setup
53EXTRA_OECMAKE += "-DGNU_HOST=${HOST_SYS} -DFLB_TD=1"
54
55# Disable LuaJIT and filter_lua support
56EXTRA_OECMAKE += "-DFLB_LUAJIT=Off -DFLB_FILTER_LUA=Off "
57
58# Disable Library and examples
59EXTRA_OECMAKE += "-DFLB_SHARED_LIB=Off"
60
61# Enable systemd iff systemd is in DISTRO_FEATURES
62EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEMD=On','-DFLB_SYSTEMD=Off',d)}"
63
64EXTRA_OECMAKE:append:riscv64 = " -DFLB_DEPS='atomic'"
65EXTRA_OECMAKE:append:riscv32 = " -DFLB_DEPS='atomic'"
66
67inherit cmake systemd pkgconfig
68
69SYSTEMD_SERVICE:${PN} = "td-agent-bit.service"
70
71EXTRA_OECMAKE += "-DCMAKE_DEBUG_SRCDIR=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/"
72TARGET_CC_ARCH += " ${SELECTED_OPTIMIZATION}"