summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0001-Use-posix-strerror_r-with-musl.patch34
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0002-chunkio-Link-with-fts-library-with-musl.patch28
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch16
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb9
4 files changed, 69 insertions, 18 deletions
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Use-posix-strerror_r-with-musl.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Use-posix-strerror_r-with-musl.patch
new file mode 100644
index 0000000000..8d89e4df35
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-Use-posix-strerror_r-with-musl.patch
@@ -0,0 +1,34 @@
1From f645128082117a0152a95b3dccd869a184b7513f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 10 Aug 2022 01:23:48 -0700
4Subject: [PATCH 1/2] Use posix strerror_r with musl
5
6Default with glibc is GNU extention of strerror_r
7where as musl uses posix variant, call that out
8
9Upstream-Status: Inappropriate [Need wider porting beyond linux/musl/glibc]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 src/flb_network.c | 5 +++++
13 1 file changed, 5 insertions(+)
14
15diff --git a/src/flb_network.c b/src/flb_network.c
16index 992eb1d..5d7a337 100644
17--- a/src/flb_network.c
18+++ b/src/flb_network.c
19@@ -506,7 +506,12 @@ static int net_connect_async(int fd,
20 }
21
22 /* Connection is broken, not much to do here */
23+#ifdef __GLIBC__
24 str = strerror_r(error, so_error_buf, sizeof(so_error_buf));
25+#else
26+ strerror_r(error, so_error_buf, sizeof(so_error_buf));
27+ str = so_error_buf;
28+#endif
29 flb_error("[net] TCP connection failed: %s:%i (%s)",
30 u->tcp_host, u->tcp_port, str);
31 return -1;
32--
332.37.1
34
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0002-chunkio-Link-with-fts-library-with-musl.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0002-chunkio-Link-with-fts-library-with-musl.patch
new file mode 100644
index 0000000000..4ffb20d9ca
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0002-chunkio-Link-with-fts-library-with-musl.patch
@@ -0,0 +1,28 @@
1From 63dbbad5978e5f5b0e7d42614999cb6b4ebcce10 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 10 Aug 2022 01:27:16 -0700
4Subject: [PATCH 2/2] chunkio: Link with fts library with musl
5
6Fixes
7cio_utils.c:(.text+0x64): undefined reference to `fts_read'
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 lib/chunkio/src/CMakeLists.txt | 1 +
12 1 file changed, 1 insertion(+)
13
14diff --git a/lib/chunkio/src/CMakeLists.txt b/lib/chunkio/src/CMakeLists.txt
15index a4fc2d3..4244eb8 100644
16--- a/lib/chunkio/src/CMakeLists.txt
17+++ b/lib/chunkio/src/CMakeLists.txt
18@@ -13,6 +13,7 @@ set(src
19 )
20
21 set(libs cio-crc32)
22+set(libs ${libs} fts)
23
24 if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
25 set(src
26--
272.37.1
28
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch
deleted file mode 100644
index 67b3397a6f..0000000000
--- a/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch
+++ /dev/null
@@ -1,16 +0,0 @@
1Add --with-jemalloc-prefix=je_ so it compiles on musl
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5
6--- a/CMakeLists.txt
7+++ b/CMakeLists.txt
8@@ -523,7 +523,7 @@ if(FLB_JEMALLOC AND ${CMAKE_SYSTEM_NAME}
9 # Link to Jemalloc as an external dependency
10 ExternalProject_Add(jemalloc
11 SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1
12- 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>
13+ 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>
14 CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops
15 BUILD_COMMAND $(MAKE)
16 INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb
index 2b1c4ca19c..ea6f81cbf0 100644
--- a/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb
@@ -23,6 +23,10 @@ SRC_URI = "https://releases.fluentbit.io/1.9/source-${PV}.tar.gz;subdir=fluent-b
23 file://0005-stackdriver-Fix-return-type-mismatch.patch \ 23 file://0005-stackdriver-Fix-return-type-mismatch.patch \
24 file://0006-monkey-Fix-TLS-detection-testcase.patch \ 24 file://0006-monkey-Fix-TLS-detection-testcase.patch \
25 " 25 "
26SRC_URI:append:libc-musl = "\
27 file://0001-Use-posix-strerror_r-with-musl.patch \
28 file://0002-chunkio-Link-with-fts-library-with-musl.patch \
29 "
26SRC_URI[sha256sum] = "5ef7dd97e10936269fe5f4e5d3ebf16559333066f7d6757ba12464a9d6186570" 30SRC_URI[sha256sum] = "5ef7dd97e10936269fe5f4e5d3ebf16559333066f7d6757ba12464a9d6186570"
27 31
28S = "${WORKDIR}/fluent-bit-${PV}" 32S = "${WORKDIR}/fluent-bit-${PV}"
@@ -43,8 +47,6 @@ do_compile:append() {
43 find ${B} -name '*.c' -or -name '*.h' | xargs sed -i -e 's|${TMPDIR}|/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/|g' 47 find ${B} -name '*.c' -or -name '*.h' | xargs sed -i -e 's|${TMPDIR}|/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/|g'
44} 48}
45 49
46FLB_JEMALLOC_OPTIONS_LIST = "--with-jemalloc-prefix=je_ --with-lg-quantum=3"
47
48PACKAGECONFIG ?= "yaml" 50PACKAGECONFIG ?= "yaml"
49 51
50LTO = "" 52LTO = ""
@@ -70,6 +72,9 @@ EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEM
70# Enable release builds 72# Enable release builds
71EXTRA_OECMAKE += "-DFLB_RELEASE=On" 73EXTRA_OECMAKE += "-DFLB_RELEASE=On"
72 74
75# musl needs these options
76EXTRA_OECMAKE:append:libc-musl = ' -DFLB_JEMALLOC_OPTIONS="--with-jemalloc-prefix=je_ --with-lg-quantum=3" -DFLB_CORO_STACK_SIZE=24576'
77
73EXTRA_OECMAKE:append:riscv64 = " -DFLB_DEPS='atomic'" 78EXTRA_OECMAKE:append:riscv64 = " -DFLB_DEPS='atomic'"
74EXTRA_OECMAKE:append:riscv32 = " -DFLB_DEPS='atomic'" 79EXTRA_OECMAKE:append:riscv32 = " -DFLB_DEPS='atomic'"
75 80