From patchwork Mon Feb 17 14:58:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Vanbever X-Patchwork-Id: 1239295 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=essensium.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=essensium.com header.i=@essensium.com header.a=rsa-sha256 header.s=google header.b=MC1Kc+9w; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48LnDj6gLyz9sRN for ; Tue, 18 Feb 2020 01:58:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5AAAF2045A; Mon, 17 Feb 2020 14:58:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jrUIIxLPwB7F; Mon, 17 Feb 2020 14:58:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id C94802043F; Mon, 17 Feb 2020 14:58:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 88DF21BF33B for ; Mon, 17 Feb 2020 14:58:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7BFA586D78 for ; Mon, 17 Feb 2020 14:58:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NlWkbsmGbfEs for ; Mon, 17 Feb 2020 14:58:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by hemlock.osuosl.org (Postfix) with ESMTPS id CC3CB86416 for ; Mon, 17 Feb 2020 14:58:37 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id m16so20068363wrx.11 for ; Mon, 17 Feb 2020 06:58:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=essensium.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sFkASVsM8nu1pqbH8lGOFY6GPJWDkZd6Ox04Is3721M=; b=MC1Kc+9w+/WTEBrKxtdwKleqWm030rf6Ti8HjW/YK0MGzY0KeL9Tbezv0hi11zeka6 qKLJxflNp4BRbjY4DotqbPhVpDg8avu/v50JDLTTc0Q5PmqVBl5TheI+wQybPsiLLKGx CxEhxtDGW/iDrtsjDegVUv/b9DECQ17UnvB0i4f3atjzWuyX/8RAP+M3HwBc0OEhz1t0 7yjir8hv/T8ynOvqoKqLIahBX2+BQ/mCqpcDPJU/NT3vVs5NnTaSgCEQFRIwxI7sFeZs qPUUkzk7E7wvi7p70TAlDO13btYNFHr6e8BMcXZqtwURZSP55AJ+SOJhKeRQA+WpXPLm RbiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sFkASVsM8nu1pqbH8lGOFY6GPJWDkZd6Ox04Is3721M=; b=UG8sx3YWx2ohwf5hVpEqUv0O9cgTHr0wO5+MUILMAbECCZBz7shsKpOnm5eBlkDkLs nxGOVmXNEqK5T3HcV7VAax+crithDzYZDOSfd+0ALK3R0bWppOapdilgPWMIO4eF/yHe SX5GeW2uMOhwr+eGD0H34IepxK1dGym1xtPZEFUaLDi6PC8z+apuy1L7OR7WMp8XddXv Pow1gXEqxz4V5ZXDIwWlVNIiDEA4a9m4AAl+lEYwrOBJ1pnRqE/snAlHTEP7oSfSl8Ln ZLKljMFjpaYtdVHPQ5+8xp3z/UGfuEktwuxGON+BT9b7lBrkpO4TwHdHZF5nan3uw6K4 e2mA== X-Gm-Message-State: APjAAAUjrSQ8ojgxD214/JmYm1qW11CbFLMNhr3zZ2LXZFU6ls1PJr7V hKj5hz9oW0j51UD5q3NbOv1Z/dJdmHkaNA== X-Google-Smtp-Source: APXvYqybji/uNHemoH2lRrSZPKZTkYJEqd+keodprCn/qxPizWGLezmfSM4jmCCXQAAhBM1Gp92Mqg== X-Received: by 2002:a5d:4a84:: with SMTP id o4mr22638595wrq.396.1581951515627; Mon, 17 Feb 2020 06:58:35 -0800 (PST) Received: from wintermute.local.ess-mail.com (ip-188-118-3-185.reverse.destiny.be. [188.118.3.185]) by smtp.gmail.com with ESMTPSA id a62sm948713wmh.33.2020.02.17.06.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 06:58:34 -0800 (PST) From: Frank Vanbever To: buildroot@buildroot.org Date: Mon, 17 Feb 2020 15:58:05 +0100 Message-Id: <20200217145805.18815-1-frank.vanbever@essensium.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200217133806.21237-1-frank.vanbever@essensium.com> References: <20200217133806.21237-1-frank.vanbever@essensium.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 1/1] package/fluentbit: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Frank Vanbever , Kevin Hilman , Ryan Barnett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Kevin Hilman Fluent Bit is an open source and multi-platform Log Processor and Forwarder which allows you to collect data/logs from different sources, unify and send them to multiple destinations. _FILE_OFFSET_BITS==64 needs to be filtered out to allow building with old glibc versions (<2.23). 0001-lib-flb_libco-ppc-Fix-signature-for-co_create-API-18.patch is required to allow building for PowerPC. Signed-off-by: Kevin Hilman Signed-off-by: Frank Vanbever --- v2 -> v3: - Cleaned up included patch: "Backported from:", "Signed off by:" and some additional explanation on why the patch is necessary This patch is adapted from http://patchwork.ozlabs.org/patch/1038388/ with some clean-up and additional fixes. Signed-off-by: Frank Vanbever --- DEVELOPERS | 1 + package/Config.in | 1 + ...c-Fix-signature-for-co_create-API-18.patch | 42 ++++++++++++ package/fluent-bit/Config.in | 15 +++++ package/fluent-bit/fluent-bit.hash | 3 + package/fluent-bit/fluent-bit.mk | 65 +++++++++++++++++++ 6 files changed, 127 insertions(+) create mode 100644 package/fluent-bit/0001-lib-flb_libco-ppc-Fix-signature-for-co_create-API-18.patch create mode 100644 package/fluent-bit/Config.in create mode 100644 package/fluent-bit/fluent-bit.hash create mode 100644 package/fluent-bit/fluent-bit.mk diff --git a/DEVELOPERS b/DEVELOPERS index e4a3bcb24a..0c309d94e4 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -960,6 +960,7 @@ F: package/zxing-cpp/ N: Frank Vanbever F: package/elixir/ +F: package/fluent-bit/ F: package/libmodsecurity/ F: package/nginx-modsecurity/ diff --git a/package/Config.in b/package/Config.in index dfa3f34b9d..f3d84f16e5 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2298,6 +2298,7 @@ menu "System tools" source "package/efibootmgr/Config.in" source "package/efivar/Config.in" source "package/emlog/Config.in" + source "package/fluent-bit/Config.in" source "package/ftop/Config.in" source "package/getent/Config.in" source "package/htop/Config.in" diff --git a/package/fluent-bit/0001-lib-flb_libco-ppc-Fix-signature-for-co_create-API-18.patch b/package/fluent-bit/0001-lib-flb_libco-ppc-Fix-signature-for-co_create-API-18.patch new file mode 100644 index 0000000000..c85bf85d33 --- /dev/null +++ b/package/fluent-bit/0001-lib-flb_libco-ppc-Fix-signature-for-co_create-API-18.patch @@ -0,0 +1,42 @@ +From 731dab51a41d3635ceae5481d89d30148caac96d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 11 Feb 2020 19:36:21 -0800 +Subject: [PATCH] lib: flb_libco: ppc: Fix signature for co_create API (#1886) + +This patch fixes build errors for the flb_libco dependency when builidng +for PowerPC. + +Backported from: 731dab51a41d3635ceae5481d89d30148caac96d +Signed-off-by: Khem Raj +Signed-off-by: Frank Vanbever +--- + lib/flb_libco/ppc.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/lib/flb_libco/ppc.c b/lib/flb_libco/ppc.c +index e6536d56..533256b3 100644 +--- a/lib/flb_libco/ppc.c ++++ b/lib/flb_libco/ppc.c +@@ -279,7 +279,9 @@ static uint32_t* co_create_(unsigned size, uintptr_t entry) { + return t; + } + +-cothread_t co_create(unsigned int size, void (*entry_)(void)) { ++cothread_t co_create(unsigned int size, void (*entry_)(void), ++ size_t *out_size) { ++ + uintptr_t entry = (uintptr_t)entry_; + uint32_t* t = 0; + +@@ -325,7 +327,7 @@ cothread_t co_create(unsigned int size, void (*entry_)(void)) { + t[10] = (uint32_t)(sp >> shift >> shift); + t[11] = (uint32_t)sp; + } +- ++ *out_size = size; + return t; + } + +-- +2.20.1 + diff --git a/package/fluent-bit/Config.in b/package/fluent-bit/Config.in new file mode 100644 index 0000000000..98efaa36ff --- /dev/null +++ b/package/fluent-bit/Config.in @@ -0,0 +1,15 @@ +config BR2_PACKAGE_FLUENT_BIT + bool "fluent-bit" + depends on BR2_INSTALL_LIBSTDCPP + depends on !BR2_STATIC_LIBS + select BR2_PACKAGE_MUSL_FTS if !BR2_TOOLCHAIN_USES_GLIBC + help + Fluent Bit is an open source and multi-platform Log + processor and forwarder which allows you to collect + data/logs from different sources, unify and send them to + multiple destinations. + + http://fluentbit.io + +comment "fluent-bit needs a toolchain w/ C++, dynamic library" + depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS diff --git a/package/fluent-bit/fluent-bit.hash b/package/fluent-bit/fluent-bit.hash new file mode 100644 index 0000000000..1a8e0d121c --- /dev/null +++ b/package/fluent-bit/fluent-bit.hash @@ -0,0 +1,3 @@ +# computed locally +sha256 e897949356855e2a7d1a71085c7c21653b7792ef137d19d665e7b5dcd8e4d46a fluent-bit-1.3.7.tar.gz +sha256 0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594 LICENSE diff --git a/package/fluent-bit/fluent-bit.mk b/package/fluent-bit/fluent-bit.mk new file mode 100644 index 0000000000..c48d77a1fe --- /dev/null +++ b/package/fluent-bit/fluent-bit.mk @@ -0,0 +1,65 @@ +################################################################################ +# +# fluent-bit +# +################################################################################ + +FLUENT_BIT_VERSION = 1.3.7 +FLUENT_BIT_SITE = $(call github,fluent,fluent-bit,v$(FLUENT_BIT_VERSION)) +FLUENT_BIT_LICENSE = Apache-2.0 +FLUENT_BIT_LICENSE_FILE = LICENSE + +# LuaJIT and filter_lua do not support cross compilation +FLUENT_BIT_CONF_OPTS += -DFLB_LUAJIT=OFF -DFLB_FILTER_LUA=OFF + +# Only build the daemon. Disable optional build of fluent-bit.so +FLUENT_BIT_CONF_OPTS += -DFLB_SHARED_LIB=OFF -DBUILD_SHARED_LIBS=OFF + +# Don't build the examples +FLUENT_BIT_CONF_OPTS += -DFLB_EXAMPLES=OFF + +# onigmo option does not support cross compilation +FLUENT_BIT_CONF_OPTS += -DFLB_PARSER=OFF -DFLB_REGEX=OFF + +# backtrace option does not support cross compilation +FLUENT_BIT_CONF_OPTS += -DFLB_BACKTRACE=OFF + +ifeq ($(BR2_PACKAGE_HOST_FLEX)$(BR2_PACKAGE_HOST_BISON),yy) +FLUENT_BIT_DEPENDENCIES += host-flex host-bison +FLUENT_BIT_CONF_OPTS += -DFLB_RECORD_ACCESSOR=ON -DFLB_STREAM_PROCESSOR=ON +else +FLUENT_BIT_CONF_OPTS += -DFLB_RECORD_ACCESSOR=OFF -DFLB_STREAM_PROCESSOR=OFF +endif + +ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),) +FLUENT_BIT_DEPENDENCIES += musl-fts +FLUENT_BIT_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-lfts +endif + +# fts.h does not support _FILE_OFFSET_BITS=64 in glibc 2.22 +FLUENT_BIT_CFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS)) +FLUENT_BIT_CXXFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CXXFLAGS)) + +FLUENT_BIT_CONF_OPTS += -DCMAKE_C_FLAGS="$(FLUENT_BIT_CFLAGS)" \ + -DCMAKE_CXX_FLAGS="$(FLUENT_BIT_CXXFLAGS)" + +define FLUENT_BIT_INSTALL_INIT_SYSTEMD + $(INSTALL) -D -m 0644 $(@D)/init/fluent-bit.service \ + $(TARGET_DIR)/usr/lib/systemd/system/fluent-bit.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants + ln -sf ../../../..//usr/lib/systemd/system/fluent-bit.service \ + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/fluent-bit.service +endef + +# Install the default configuration files +define FLUENT_BIT_INSTALL_CONF + mkdir -p $(TARGET_DIR)/etc/fluent-bit + $(INSTALL) -m 0644 -D $(@D)/conf/fluent-bit.conf \ + $(TARGET_DIR)/etc/fluent-bit/fluent-bit.conf + $(INSTALL) -m 0644 -D $(@D)/conf/plugins.conf \ + $(TARGET_DIR)/etc/fluent-bit/plugins.conf +endef + +FLUENT_BIT_POST_INSTALL_TARGET_HOOKS += FLUENT_BIT_INSTALL_CONF + +$(eval $(cmake-package))