diff options
8 files changed, 222 insertions, 2 deletions
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0001-monkey-Define-_GNU_SOURCE-for-memmem-API-check.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-monkey-Define-_GNU_SOURCE-for-memmem-API-check.patch new file mode 100644 index 0000000000..e70664031b --- /dev/null +++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0001-monkey-Define-_GNU_SOURCE-for-memmem-API-check.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | From 0d22024c5defba7007e3e633753790e20209c6f6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 9 Aug 2022 09:59:41 -0700 | ||
| 4 | Subject: [PATCH 1/5] monkey: Define _GNU_SOURCE for memmem API check | ||
| 5 | |||
| 6 | This define is necessary to get this API on glibc based systems | ||
| 7 | |||
| 8 | Upstream-Status: Pending | ||
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 10 | --- | ||
| 11 | lib/monkey/mk_core/CMakeLists.txt | 1 + | ||
| 12 | 1 file changed, 1 insertion(+) | ||
| 13 | |||
| 14 | diff --git a/lib/monkey/mk_core/CMakeLists.txt b/lib/monkey/mk_core/CMakeLists.txt | ||
| 15 | index 0e74f8d..739fff3 100644 | ||
| 16 | --- a/lib/monkey/mk_core/CMakeLists.txt | ||
| 17 | +++ b/lib/monkey/mk_core/CMakeLists.txt | ||
| 18 | @@ -62,6 +62,7 @@ set(src "${src}" | ||
| 19 | ) | ||
| 20 | |||
| 21 | check_c_source_compiles(" | ||
| 22 | + #define _GNU_SOURCE | ||
| 23 | #include <string.h> | ||
| 24 | int main() { | ||
| 25 | char haystack[] = \"1234\"; | ||
| 26 | -- | ||
| 27 | 2.37.1 | ||
| 28 | |||
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0002-mbedtls-Remove-unused-variable.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0002-mbedtls-Remove-unused-variable.patch new file mode 100644 index 0000000000..d4451bcaef --- /dev/null +++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0002-mbedtls-Remove-unused-variable.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | From c7b969d1a2a6b61bd179214ee2516b7b6cd55b27 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 9 Aug 2022 11:21:57 -0700 | ||
| 4 | Subject: [PATCH 2/5] mbedtls: Remove unused variable | ||
| 5 | |||
| 6 | Fixes | ||
| 7 | library/bignum.c:1395:29: error: variable 't' set but not used [-Werror,-Wunused-but-set-variable] | ||
| 8 | |||
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 10 | --- | ||
| 11 | lib/mbedtls-2.28.0/library/bignum.c | 4 +--- | ||
| 12 | 1 file changed, 1 insertion(+), 3 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/lib/mbedtls-2.28.0/library/bignum.c b/lib/mbedtls-2.28.0/library/bignum.c | ||
| 15 | index 62e7f76..9c256ae 100644 | ||
| 16 | --- a/lib/mbedtls-2.28.0/library/bignum.c | ||
| 17 | +++ b/lib/mbedtls-2.28.0/library/bignum.c | ||
| 18 | @@ -1392,7 +1392,7 @@ void mpi_mul_hlp( size_t i, | ||
| 19 | mbedtls_mpi_uint *d, | ||
| 20 | mbedtls_mpi_uint b ) | ||
| 21 | { | ||
| 22 | - mbedtls_mpi_uint c = 0, t = 0; | ||
| 23 | + mbedtls_mpi_uint c = 0; | ||
| 24 | |||
| 25 | #if defined(MULADDC_HUIT) | ||
| 26 | for( ; i >= 8; i -= 8 ) | ||
| 27 | @@ -1443,8 +1443,6 @@ void mpi_mul_hlp( size_t i, | ||
| 28 | } | ||
| 29 | #endif /* MULADDC_HUIT */ | ||
| 30 | |||
| 31 | - t++; | ||
| 32 | - | ||
| 33 | while( c != 0 ) | ||
| 34 | { | ||
| 35 | *d += c; c = ( *d < c ); d++; | ||
| 36 | -- | ||
| 37 | 2.37.1 | ||
| 38 | |||
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0003-mbedtls-Disable-documentation-warning-as-error-with-.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0003-mbedtls-Disable-documentation-warning-as-error-with-.patch new file mode 100644 index 0000000000..2d7b4efda7 --- /dev/null +++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0003-mbedtls-Disable-documentation-warning-as-error-with-.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From 2d12629f768d2459b1fc8a8ca0c38024d84bc195 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 9 Aug 2022 11:32:12 -0700 | ||
| 4 | Subject: [PATCH 3/5] mbedtls: Disable documentation warning as error with | ||
| 5 | clang | ||
| 6 | |||
| 7 | There are shortcomings with doxygen info which clang-15+ flags, dont | ||
| 8 | treat them as errors | ||
| 9 | |||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | lib/mbedtls-2.28.0/CMakeLists.txt | 2 +- | ||
| 13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/lib/mbedtls-2.28.0/CMakeLists.txt b/lib/mbedtls-2.28.0/CMakeLists.txt | ||
| 16 | index b33c088..c5f886f 100644 | ||
| 17 | --- a/lib/mbedtls-2.28.0/CMakeLists.txt | ||
| 18 | +++ b/lib/mbedtls-2.28.0/CMakeLists.txt | ||
| 19 | @@ -212,7 +212,7 @@ if(CMAKE_COMPILER_IS_GNU) | ||
| 20 | endif(CMAKE_COMPILER_IS_GNU) | ||
| 21 | |||
| 22 | if(CMAKE_COMPILER_IS_CLANG) | ||
| 23 | - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow -Wvla -Wformat=2 -Wno-format-nonliteral") | ||
| 24 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow -Wvla -Wformat=2 -Wno-format-nonliteral -Wno-error=documentation") | ||
| 25 | set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage") | ||
| 26 | set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O3") | ||
| 27 | set(CMAKE_C_FLAGS_ASANDBG "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls") | ||
| 28 | -- | ||
| 29 | 2.37.1 | ||
| 30 | |||
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0003-mbedtls-Do-not-overwrite-CFLAGS.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0003-mbedtls-Do-not-overwrite-CFLAGS.patch index a7d7dc8897..af31b436db 100644 --- a/meta-oe/recipes-extended/fluentbit/fluentbit/0003-mbedtls-Do-not-overwrite-CFLAGS.patch +++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0003-mbedtls-Do-not-overwrite-CFLAGS.patch | |||
| @@ -13,8 +13,6 @@ flags that also overwrite bitbake ones. | |||
| 13 | lib/mbedtls-2.28.0/CMakeLists.txt | 2 -- | 13 | lib/mbedtls-2.28.0/CMakeLists.txt | 2 -- |
| 14 | 1 file changed, 2 deletions(-) | 14 | 1 file changed, 2 deletions(-) |
| 15 | 15 | ||
| 16 | diff --git a/lib/mbedtls-2.28.0/CMakeLists.txt b/lib/mbedtls-2.28.0/CMakeLists.txt | ||
| 17 | index d76bddc..e717846 100644 | ||
| 18 | --- a/lib/mbedtls-2.28.0/CMakeLists.txt | 16 | --- a/lib/mbedtls-2.28.0/CMakeLists.txt |
| 19 | +++ b/lib/mbedtls-2.28.0/CMakeLists.txt | 17 | +++ b/lib/mbedtls-2.28.0/CMakeLists.txt |
| 20 | @@ -204,8 +204,6 @@ if(CMAKE_COMPILER_IS_GNU) | 18 | @@ -204,8 +204,6 @@ if(CMAKE_COMPILER_IS_GNU) |
| @@ -26,3 +24,12 @@ index d76bddc..e717846 100644 | |||
| 26 | set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage") | 24 | set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage") |
| 27 | set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O3") | 25 | set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O3") |
| 28 | set(CMAKE_C_FLAGS_ASANDBG "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls") | 26 | set(CMAKE_C_FLAGS_ASANDBG "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls") |
| 27 | @@ -215,8 +213,6 @@ endif(CMAKE_COMPILER_IS_GNU) | ||
| 28 | |||
| 29 | if(CMAKE_COMPILER_IS_CLANG) | ||
| 30 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow -Wvla -Wformat=2 -Wno-format-nonliteral") | ||
| 31 | - set(CMAKE_C_FLAGS_RELEASE "-O2") | ||
| 32 | - set(CMAKE_C_FLAGS_DEBUG "-O0 -g3") | ||
| 33 | set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage") | ||
| 34 | set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O3") | ||
| 35 | set(CMAKE_C_FLAGS_ASANDBG "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls") | ||
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0004-Use-correct-type-to-store-return-from-flb_kv_item_cr.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0004-Use-correct-type-to-store-return-from-flb_kv_item_cr.patch new file mode 100644 index 0000000000..224b8ccf1b --- /dev/null +++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0004-Use-correct-type-to-store-return-from-flb_kv_item_cr.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | From a797b79483940ed4adcaa5fe2c40dd0487c7c2c7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 9 Aug 2022 11:39:08 -0700 | ||
| 4 | Subject: [PATCH 4/5] Use correct type to store return from flb_kv_item_create | ||
| 5 | |||
| 6 | Fix | ||
| 7 | error: incompatible pointer to integer conversion assigning to 'int' from 'struct flb_kv *' | ||
| 8 | |||
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 10 | --- | ||
| 11 | plugins/out_stackdriver/stackdriver_conf.c | 4 ++-- | ||
| 12 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/plugins/out_stackdriver/stackdriver_conf.c b/plugins/out_stackdriver/stackdriver_conf.c | ||
| 15 | index a9a8eb0..e4f969e 100644 | ||
| 16 | --- a/plugins/out_stackdriver/stackdriver_conf.c | ||
| 17 | +++ b/plugins/out_stackdriver/stackdriver_conf.c | ||
| 18 | @@ -176,12 +176,12 @@ static int read_credentials_file(const char *cred_file, struct flb_stackdriver * | ||
| 19 | |||
| 20 | static int parse_configuration_labels(struct flb_stackdriver *ctx) | ||
| 21 | { | ||
| 22 | - int ret; | ||
| 23 | char *p; | ||
| 24 | flb_sds_t key; | ||
| 25 | flb_sds_t val; | ||
| 26 | struct mk_list *head; | ||
| 27 | struct flb_slist_entry *entry; | ||
| 28 | + struct flb_kv *ret; | ||
| 29 | msgpack_object_kv *kv = NULL; | ||
| 30 | |||
| 31 | if (ctx->labels) { | ||
| 32 | @@ -216,7 +216,7 @@ static int parse_configuration_labels(struct flb_stackdriver *ctx) | ||
| 33 | flb_sds_destroy(key); | ||
| 34 | flb_sds_destroy(val); | ||
| 35 | |||
| 36 | - if (ret == -1) { | ||
| 37 | + if (!ret) { | ||
| 38 | return -1; | ||
| 39 | } | ||
| 40 | } | ||
| 41 | -- | ||
| 42 | 2.37.1 | ||
| 43 | |||
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0005-stackdriver-Fix-return-type-mismatch.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0005-stackdriver-Fix-return-type-mismatch.patch new file mode 100644 index 0000000000..cdbbb6b2c1 --- /dev/null +++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0005-stackdriver-Fix-return-type-mismatch.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From 27f0bd5a3339612e03112e6b490900a9fabc3337 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 9 Aug 2022 11:44:25 -0700 | ||
| 4 | Subject: [PATCH 5/5] stackdriver: Fix return type mismatch | ||
| 5 | |||
| 6 | Fix | ||
| 7 | error: incompatible integer to pointer conversion returning 'int' from a function with result type 'flb_sds_t' (aka 'char *') [-Wint-conversion] | ||
| 8 | return -1; | ||
| 9 | ^~ | ||
| 10 | |||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | --- | ||
| 13 | plugins/out_stackdriver/stackdriver.c | 2 +- | ||
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/plugins/out_stackdriver/stackdriver.c b/plugins/out_stackdriver/stackdriver.c | ||
| 17 | index ae66bf2..e01755c 100644 | ||
| 18 | --- a/plugins/out_stackdriver/stackdriver.c | ||
| 19 | +++ b/plugins/out_stackdriver/stackdriver.c | ||
| 20 | @@ -2033,7 +2033,7 @@ static flb_sds_t stackdriver_format(struct flb_stackdriver *ctx, | ||
| 21 | flb_sds_destroy(operation_producer); | ||
| 22 | msgpack_unpacked_destroy(&result); | ||
| 23 | msgpack_sbuffer_destroy(&mp_sbuf); | ||
| 24 | - return -1; | ||
| 25 | + return NULL; | ||
| 26 | } | ||
| 27 | |||
| 28 | /* Number of parsed labels */ | ||
| 29 | -- | ||
| 30 | 2.37.1 | ||
| 31 | |||
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0006-monkey-Fix-TLS-detection-testcase.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0006-monkey-Fix-TLS-detection-testcase.patch new file mode 100644 index 0000000000..eef1a56ba7 --- /dev/null +++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0006-monkey-Fix-TLS-detection-testcase.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | From f88d9b82e8bd8ae38fba666b5825ffb41769f81a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 9 Aug 2022 12:25:22 -0700 | ||
| 4 | Subject: [PATCH] monkey: Fix TLS detection testcase | ||
| 5 | |||
| 6 | Clang15 errors out on compiling the check and disables TLS | ||
| 7 | |||
| 8 | Fixes errors like | ||
| 9 | |||
| 10 | error: call to undeclared function '__tls_get_addr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] | ||
| 11 | __tls_get_addr(0); | ||
| 12 | ^ | ||
| 13 | |||
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 15 | --- | ||
| 16 | lib/monkey/CMakeLists.txt | 2 ++ | ||
| 17 | 1 file changed, 2 insertions(+) | ||
| 18 | |||
| 19 | diff --git a/lib/monkey/CMakeLists.txt b/lib/monkey/CMakeLists.txt | ||
| 20 | index 15e62e8..96ac2bd 100644 | ||
| 21 | --- a/lib/monkey/CMakeLists.txt | ||
| 22 | +++ b/lib/monkey/CMakeLists.txt | ||
| 23 | @@ -178,6 +178,8 @@ endif() | ||
| 24 | # Use old Pthread TLS | ||
| 25 | if(NOT MK_PTHREAD_TLS) | ||
| 26 | check_c_source_compiles(" | ||
| 27 | + #include <sys/types.h> | ||
| 28 | + extern void *__tls_get_addr(size_t *v); | ||
| 29 | __thread int a; | ||
| 30 | int main() { | ||
| 31 | __tls_get_addr(0); | ||
| 32 | -- | ||
| 33 | 2.37.1 | ||
| 34 | |||
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 f98d416b24..2b1c4ca19c 100644 --- a/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb +++ b/meta-oe/recipes-extended/fluentbit/fluentbit_1.9.6.bb | |||
| @@ -16,6 +16,12 @@ SRC_URI = "https://releases.fluentbit.io/1.9/source-${PV}.tar.gz;subdir=fluent-b | |||
| 16 | file://0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch \ | 16 | file://0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch \ |
| 17 | file://0003-mbedtls-Do-not-overwrite-CFLAGS.patch \ | 17 | file://0003-mbedtls-Do-not-overwrite-CFLAGS.patch \ |
| 18 | file://0004-build-Make-systemd-init-systemd-detection-contingent.patch \ | 18 | file://0004-build-Make-systemd-init-systemd-detection-contingent.patch \ |
| 19 | file://0001-monkey-Define-_GNU_SOURCE-for-memmem-API-check.patch \ | ||
| 20 | file://0002-mbedtls-Remove-unused-variable.patch \ | ||
| 21 | file://0003-mbedtls-Disable-documentation-warning-as-error-with-.patch \ | ||
| 22 | file://0004-Use-correct-type-to-store-return-from-flb_kv_item_cr.patch \ | ||
| 23 | file://0005-stackdriver-Fix-return-type-mismatch.patch \ | ||
| 24 | file://0006-monkey-Fix-TLS-detection-testcase.patch \ | ||
| 19 | " | 25 | " |
| 20 | SRC_URI[sha256sum] = "5ef7dd97e10936269fe5f4e5d3ebf16559333066f7d6757ba12464a9d6186570" | 26 | SRC_URI[sha256sum] = "5ef7dd97e10936269fe5f4e5d3ebf16559333066f7d6757ba12464a9d6186570" |
| 21 | 27 | ||
| @@ -61,6 +67,9 @@ EXTRA_OECMAKE += "-DFLB_SHARED_LIB=Off" | |||
| 61 | # Enable systemd iff systemd is in DISTRO_FEATURES | 67 | # Enable systemd iff systemd is in DISTRO_FEATURES |
| 62 | EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEMD=On','-DFLB_SYSTEMD=Off',d)}" | 68 | EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEMD=On','-DFLB_SYSTEMD=Off',d)}" |
| 63 | 69 | ||
| 70 | # Enable release builds | ||
| 71 | EXTRA_OECMAKE += "-DFLB_RELEASE=On" | ||
| 72 | |||
| 64 | EXTRA_OECMAKE:append:riscv64 = " -DFLB_DEPS='atomic'" | 73 | EXTRA_OECMAKE:append:riscv64 = " -DFLB_DEPS='atomic'" |
| 65 | EXTRA_OECMAKE:append:riscv32 = " -DFLB_DEPS='atomic'" | 74 | EXTRA_OECMAKE:append:riscv32 = " -DFLB_DEPS='atomic'" |
| 66 | 75 | ||
