mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2025-12-14 22:35:25 +01:00
fluentbit: Fix build with musl
Pass large enough default for FLB_CORO_STACK_SIZE Remove unused jemalloc patch Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
parent
ad978133a1
commit
bc2b1482a0
|
|
@ -0,0 +1,34 @@
|
|||
From f645128082117a0152a95b3dccd869a184b7513f Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 10 Aug 2022 01:23:48 -0700
|
||||
Subject: [PATCH 1/2] Use posix strerror_r with musl
|
||||
|
||||
Default with glibc is GNU extention of strerror_r
|
||||
where as musl uses posix variant, call that out
|
||||
|
||||
Upstream-Status: Inappropriate [Need wider porting beyond linux/musl/glibc]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/flb_network.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/flb_network.c b/src/flb_network.c
|
||||
index 992eb1d..5d7a337 100644
|
||||
--- a/src/flb_network.c
|
||||
+++ b/src/flb_network.c
|
||||
@@ -506,7 +506,12 @@ static int net_connect_async(int fd,
|
||||
}
|
||||
|
||||
/* Connection is broken, not much to do here */
|
||||
+#ifdef __GLIBC__
|
||||
str = strerror_r(error, so_error_buf, sizeof(so_error_buf));
|
||||
+#else
|
||||
+ strerror_r(error, so_error_buf, sizeof(so_error_buf));
|
||||
+ str = so_error_buf;
|
||||
+#endif
|
||||
flb_error("[net] TCP connection failed: %s:%i (%s)",
|
||||
u->tcp_host, u->tcp_port, str);
|
||||
return -1;
|
||||
--
|
||||
2.37.1
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
From 63dbbad5978e5f5b0e7d42614999cb6b4ebcce10 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 10 Aug 2022 01:27:16 -0700
|
||||
Subject: [PATCH 2/2] chunkio: Link with fts library with musl
|
||||
|
||||
Fixes
|
||||
cio_utils.c:(.text+0x64): undefined reference to `fts_read'
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
lib/chunkio/src/CMakeLists.txt | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/lib/chunkio/src/CMakeLists.txt b/lib/chunkio/src/CMakeLists.txt
|
||||
index a4fc2d3..4244eb8 100644
|
||||
--- a/lib/chunkio/src/CMakeLists.txt
|
||||
+++ b/lib/chunkio/src/CMakeLists.txt
|
||||
@@ -13,6 +13,7 @@ set(src
|
||||
)
|
||||
|
||||
set(libs cio-crc32)
|
||||
+set(libs ${libs} fts)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
set(src
|
||||
--
|
||||
2.37.1
|
||||
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
Add --with-jemalloc-prefix=je_ so it compiles on musl
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Upstream-Status: Pending
|
||||
|
||||
--- 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-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)
|
||||
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/
|
||||
|
|
@ -23,6 +23,10 @@ SRC_URI = "https://releases.fluentbit.io/1.9/source-${PV}.tar.gz;subdir=fluent-b
|
|||
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}"
|
||||
|
|
@ -43,8 +47,6 @@ do_compile:append() {
|
|||
find ${B} -name '*.c' -or -name '*.h' | xargs sed -i -e 's|${TMPDIR}|/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/|g'
|
||||
}
|
||||
|
||||
FLB_JEMALLOC_OPTIONS_LIST = "--with-jemalloc-prefix=je_ --with-lg-quantum=3"
|
||||
|
||||
PACKAGECONFIG ?= "yaml"
|
||||
|
||||
LTO = ""
|
||||
|
|
@ -70,6 +72,9 @@ EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEM
|
|||
# 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 = " -DFLB_DEPS='atomic'"
|
||||
EXTRA_OECMAKE:append:riscv32 = " -DFLB_DEPS='atomic'"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user