new file mode 100644
@@ -0,0 +1,56 @@
+From aca354ae22c55fa6051d04a9f674fe0825443a94 Mon Sep 17 00:00:00 2001
+From: Thomas Devoogdt <thomas.devoogdt@barco.com>
+Date: Wed, 1 Feb 2023 11:26:56 +0100
+Subject: [PATCH] lib: c-ares: fixup static_assert
+
+"undefined reference to 'static_assert'"
+
+Not defined when using uClibc or if not C++ >= 11.
+
+upstream: https://github.com/c-ares/c-ares/issues/504
+
+Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
+---
+ lib/c-ares-1.18.1/configure | 4 ++++
+ lib/c-ares-1.18.1/m4/ax_cxx_compile_stdcxx_11.m4 | 3 +++
+ 2 files changed, 7 insertions(+)
+
+diff --git a/lib/c-ares-1.18.1/configure b/lib/c-ares-1.18.1/configure
+index 737f0a0dd..b99b7ed49 100755
+--- a/lib/c-ares-1.18.1/configure
++++ b/lib/c-ares-1.18.1/configure
+@@ -6316,6 +6316,8 @@ else $as_nop
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
++#define static_assert _Static_assert
++
+ template <typename T>
+ struct check
+ {
+@@ -6393,6 +6395,8 @@ else $as_nop
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
++#define static_assert _Static_assert
++
+ template <typename T>
+ struct check
+ {
+diff --git a/lib/c-ares-1.18.1/m4/ax_cxx_compile_stdcxx_11.m4 b/lib/c-ares-1.18.1/m4/ax_cxx_compile_stdcxx_11.m4
+index 229de3091..fe4a11c67 100644
+--- a/lib/c-ares-1.18.1/m4/ax_cxx_compile_stdcxx_11.m4
++++ b/lib/c-ares-1.18.1/m4/ax_cxx_compile_stdcxx_11.m4
+@@ -37,6 +37,9 @@
+ #serial 9
+
+ m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[
++
++#define static_assert _Static_assert
++
+ template <typename T>
+ struct check
+ {
+--
+2.39.0
+
new file mode 100644
@@ -0,0 +1,33 @@
+From 8d17fc961fef2e88f4c8fa2316af925d5466ca4d Mon Sep 17 00:00:00 2001
+From: Thomas Devoogdt <thomas.devoogdt@barco.com>
+Date: Wed, 1 Feb 2023 11:38:15 +0100
+Subject: [PATCH] lib: cfl: fixup static_assert
+
+"undefined reference to 'static_assert'"
+
+Not defined when using uClibc or if not C++ >= 11.
+
+upstream: https://github.com/Cyan4973/xxHash/commit/6189ecd3d44a693460f86280ccf49d33cb4b18e1
+
+Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
+---
+ lib/cfl/lib/xxhash/xxhash.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/cfl/lib/xxhash/xxhash.h b/lib/cfl/lib/xxhash/xxhash.h
+index 08ab79457..511c4d12b 100644
+--- a/lib/cfl/lib/xxhash/xxhash.h
++++ b/lib/cfl/lib/xxhash/xxhash.h
+@@ -1546,8 +1546,7 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size)
+ /* note: use after variable declarations */
+ #ifndef XXH_STATIC_ASSERT
+ # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */
+-# include <assert.h>
+-# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0)
++# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); } while(0)
+ # elif defined(__cplusplus) && (__cplusplus >= 201103L) /* C++11 */
+ # define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0)
+ # else
+--
+2.39.0
+
@@ -1,6 +1,9 @@
config BR2_PACKAGE_FLUENT_BIT
bool "fluent-bit"
- depends on BR2_TOOLCHAIN_USES_GLIBC
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_TOOLCHAIN_HAS_SYNC_4
+ depends on !BR2_STATIC_LIBS # dlfcn.h
+ select BR2_PACKAGE_MUSL_FTS if !BR2_TOOLCHAIN_USES_GLIBC
select BR2_PACKAGE_OPENSSL
select BR2_PACKAGE_LIBYAML
help
@@ -29,5 +32,6 @@ config BR2_PACKAGE_FLUENT_BIT_WASM
endif
-comment "fluent-bit needs a glibc toolchain"
- depends on !BR2_TOOLCHAIN_USES_GLIBC
+comment "fluent-bit needs a toolchain w/ threads, dynamic library"
+ depends on BR2_TOOLCHAIN_HAS_SYNC_4
+ depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
@@ -47,12 +47,19 @@ FLUENT_BIT_CONF_OPTS += \
-DCMAKE_C_FLAGS="$(TARGET_CFLAGS) -U_FILE_OFFSET_BITS" \
-DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -U_FILE_OFFSET_BITS"
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),)
+FLUENT_BIT_DEPENDENCIES += musl-fts
+FLUENT_BIT_LINKER_FLAGS += -lfts
+endif
+
# Uses __atomic_compare_exchange_8
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
-FLUENT_BIT_CONF_OPTS += \
- -DCMAKE_EXE_LINKER_FLAGS=-latomic
+FLUENT_BIT_LINKER_FLAGS += -latomic
endif
+FLUENT_BIT_CONF_OPTS += \
+ -DCMAKE_EXE_LINKER_FLAGS="$(FLUENT_BIT_LINKER_FLAGS)"
+
define FLUENT_BIT_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/fluent-bit/S99fluent-bit \
$(TARGET_DIR)/etc/init.d/S99fluent-bit