summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-oe/recipes-extended/fluentbit
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-extended/fluentbit')
-rw-r--r--meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-fluent-bit-shared-Link-with-lpthread.patch35
-rw-r--r--meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch18
-rw-r--r--meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.12.1.bb30
3 files changed, 83 insertions, 0 deletions
diff --git a/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-fluent-bit-shared-Link-with-lpthread.patch b/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-fluent-bit-shared-Link-with-lpthread.patch
new file mode 100644
index 000000000..e9eed24b3
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-fluent-bit-shared-Link-with-lpthread.patch
@@ -0,0 +1,35 @@
+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/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch b/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch
new file mode 100644
index 000000000..abaf92c05
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch
@@ -0,0 +1,18 @@
+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}
+ # 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>
+ CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops
+ BUILD_COMMAND ${MAKE}
+ INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/
diff --git a/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.12.1.bb b/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.12.1.bb
new file mode 100644
index 000000000..99f680f9a
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.12.1.bb
@@ -0,0 +1,30 @@
+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}"
OpenPOWER on IntegriCloud