diff options
Diffstat (limited to 'meta-oe/recipes-extended/rsyslog/librelp')
6 files changed, 259 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch new file mode 100644 index 0000000000..10e2b564cc --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch @@ -0,0 +1,34 @@ +From 6d575d98565ce3119a14359eecb11ccdff92a303 Mon Sep 17 00:00:00 2001 +From: Yash Shinde <53660251+Yashinde145@users.noreply.github.com> +Date: Thu, 29 Jun 2023 18:10:15 +0530 +Subject: [PATCH] Fix function inline errors in debug optimization (-Og) + +Compiler does not inline any functions when using debug optimization (-Og). +Hence, remove -Winline flag when compiling with debug optimization. + +Signed-off-by: Nicolas Marguet <nicolas.marguet@windriver.com> +--- +Upstream-Status: Backport [https://github.com/rsyslog/librelp/commit/6d575d9] + + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 21c1fde..1204c4e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -230,6 +230,12 @@ if test "$enable_debug" = "no"; then + AC_DEFINE(NDEBUG, 1, [Defined if debug mode is disabled.]) + fi + ++#Compiler does not inline any functions when not optimizing(-Og). ++#Hence, remove -Winline flag when DEBUG is enabled. ++#ifdef DEBUG ++WARN_CFLAGS="$(echo "$WARN_CFLAGS" | sed s/-Winline//g)" ++#endif ++ + # valgrind + AC_ARG_ENABLE(valgrind, + [AS_HELP_STRING([--enable-valgrind],[Enable valgrind tests@<:@default=yes@:>@])], +-- +2.39.0 diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch new file mode 100644 index 0000000000..cf4f4080a6 --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch @@ -0,0 +1,37 @@ +From baf992f82aa987c608731866876adb856847ea45 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 6 May 2024 18:03:40 -0700 +Subject: [PATCH] relp: fix build against upcoming `gcc-14` + (`-Werror=calloc-transposed-args`) + +`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It + detected minor infelicity in `calloc()` API usage + +Fixes +../../git/src/relp.c: In function 'addToEpollSet': +../../git/src/relp.c:101:39: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] + 101 | CHKmalloc(epd = calloc(sizeof(epolld_t), 1)); + | ^~~~~~~~ + +Upstream-Status: Submitted [https://github.com/rsyslog/librelp/pull/264] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/relp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/relp.c b/src/relp.c +index eadda36..6268f1d 100644 +--- a/src/relp.c ++++ b/src/relp.c +@@ -98,7 +98,7 @@ addToEpollSet(relpEngine_t *const pThis, epolld_type_t typ, void *ptr, int sock, + epolld_t *epd = NULL; + ENTER_RELPFUNC; + +- CHKmalloc(epd = calloc(sizeof(epolld_t), 1)); ++ CHKmalloc(epd = calloc(1, sizeof(epolld_t))); + epd->typ = typ; + epd->ptr = ptr; + epd->sock = sock; +-- +2.45.0 + diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch new file mode 100644 index 0000000000..3ce5926333 --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch @@ -0,0 +1,88 @@ +From 6e9b27f04132287463c89d3be0ce4f506944920d Mon Sep 17 00:00:00 2001 +From: Patrick Williams <patrick@stwcx.xyz> +Date: Fri, 3 Feb 2023 16:11:29 -0600 +Subject: [PATCH] tcp: fix some compiler warnings with enable-tls-openssl + +When --enable-tls=no and --enable-tls-openssl=yes, the following +compiler errors are reported: + +``` +| ../../git/src/tcp.c:3765:1: error: no previous declaration for 'relpTcpGetRtryDirection_gtls' [-Werror=missing-declarations] +| 3765 | relpTcpGetRtryDirection_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis) +| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ +| ../../git/src/tcp.c:3583:1: error: 'relpTcpChkPeerName' defined but not used [-Werror=unused-function] +| 3583 | relpTcpChkPeerName(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED void* cert) +| | ^~~~~~~~~~~~~~~~~~ +``` + +Fix these by: + 1. Add static on the openssl path for relpTcpGetRtryDirection_gtls. + 2. Move the relpTcpChkPeerName forward declaration to another ifdef + leg. + 3. Wrap relpTcpChkPeerName in gnutls-based ifdef. + 4. Remove relpTcpChkPeerName_gtls from openssl path. + +Upstream-Status: Backport [https://github.com/rsyslog/librelp/pull/255] +Signed-off-by: Patrick Williams <patrick@stwcx.xyz> +--- + src/tcp.c | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/src/tcp.c b/src/tcp.c +index 7a75cc4..18cffda 100644 +--- a/src/tcp.c ++++ b/src/tcp.c +@@ -132,12 +132,12 @@ callOnErr(const relpTcp_t *__restrict__ const pThis, + static int LIBRELP_ATTR_NONNULL() relpTcpGetCN(char *const namebuf, const size_t lenNamebuf, const char *const szDN); + #ifdef HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION + static int relpTcpVerifyCertificateCallback(gnutls_session_t session); ++static int relpTcpChkPeerName(relpTcp_t *const pThis, void* cert); + #endif /* #ifdef HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION */ + #if defined(HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION) || defined(ENABLE_TLS_OPENSSL) + static void relpTcpChkOnePeerName(relpTcp_t *const pThis, char *peername, int *pbFoundPositiveMatch); + static int relpTcpAddToCertNamesBuffer(relpTcp_t *const pThis, char *const buf, + const size_t buflen, int *p_currIdx, const char *const certName); +-static int relpTcpChkPeerName(relpTcp_t *const pThis, void* cert); + #endif /* defined(HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION) || defined(ENABLE_TLS_OPENSSL) */ + + +@@ -2820,11 +2820,6 @@ relpTcpLstnInitTLS_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis) + { + return RELP_RET_ERR_INTERNAL; + } +-static int +-relpTcpChkPeerName_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis, LIBRELP_ATTR_UNUSED void *vcert) +-{ +- return RELP_RET_ERR_INTERNAL; +-} + #endif /* defined(ENABLE_TLS)*/ + + +@@ -3579,6 +3574,7 @@ finalize_it: + + } + ++#ifdef HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION + static int + relpTcpChkPeerName(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED void* cert) + { +@@ -3592,6 +3588,7 @@ relpTcpChkPeerName(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED void* cert) + #endif /* #ifdef WITH_TLS*/ + LEAVE_RELPFUNC; + } ++#endif + + static relpRetVal LIBRELP_ATTR_NONNULL() + relpTcpAcceptConnReqInitTLS(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED relpSrv_t *const pSrv) +@@ -3761,7 +3758,7 @@ relpTcpGetRtryDirection_gtls(relpTcp_t *const pThis) + return gnutls_record_get_direction(pThis->session); + } + #else /* #ifdef ENABLE_TLS */ +-relpRetVal LIBRELP_ATTR_NONNULL() ++static relpRetVal LIBRELP_ATTR_NONNULL() + relpTcpGetRtryDirection_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis) + { + return RELP_RET_ERR_INTERNAL; +-- +2.41.0 + diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Fix-callback-prototype.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Fix-callback-prototype.patch new file mode 100644 index 0000000000..ba081926e1 --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Fix-callback-prototype.patch @@ -0,0 +1,49 @@ +From 2a7e26510cf9276b7e640ca8282cc1c5e46075d0 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 15 Aug 2023 11:59:40 -0700 +Subject: [PATCH] tests: Fix callback prototype + +clang errors about it + +| ../../git/tests/receive.c:71:34: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] +| 71 | hdlr_enable(int sig, void (*hdlr)()) +| | ^ +| | void +| 1 error generated. + +Upstream-Status: Submitted [https://github.com/rsyslog/librelp/pull/260] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + tests/receive.c | 2 +- + tests/send.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/receive.c b/tests/receive.c +index f376cb4..c12e911 100644 +--- a/tests/receive.c ++++ b/tests/receive.c +@@ -68,7 +68,7 @@ doSleep(int iSeconds, const int iuSeconds) + } + + static void +-hdlr_enable(int sig, void (*hdlr)()) ++hdlr_enable(int sig, void (*hdlr)(const int)) + { + struct sigaction sigAct; + memset(&sigAct, 0, sizeof (sigAct)); +diff --git a/tests/send.c b/tests/send.c +index d7e90f0..1b1df4f 100644 +--- a/tests/send.c ++++ b/tests/send.c +@@ -57,7 +57,7 @@ struct usrdata { /* used for testing user pointer pass-back */ + struct usrdata *userdata = NULL; + + static void +-hdlr_enable(int sig, void (*hdlr)()) ++hdlr_enable(int sig, void (*hdlr)(const int)) + { + struct sigaction sigAct; + memset(&sigAct, 0, sizeof (sigAct)); +-- +2.41.0 + diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Include-missing-sys-time.h.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Include-missing-sys-time.h.patch new file mode 100644 index 0000000000..6fed23c1d1 --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Include-missing-sys-time.h.patch @@ -0,0 +1,41 @@ +From 5c32487a9c127f37141488d416cdb5d5bec6aca1 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 19 Aug 2023 10:24:40 -0700 +Subject: [PATCH] tests: Include missing sys/time.h + +This is found when building for musl C library systems where sys/time.h +is not included indirectly and select() and timeval structs are used + +Fixes + +../../git/tests/receive.c:64:17: error: variable has incomplete type 'struct timeval' + 64 | struct timeval tvSelectTimeout; + | ^ +../../git/tests/receive.c:64:9: note: forward declaration of 'struct timeval' + 64 | struct timeval tvSelectTimeout; + | ^ +../../git/tests/receive.c:67:2: error: call to undeclared function 'select'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] + 67 | select(0, NULL, NULL, NULL, &tvSelectTimeout); + | ^ + +Upstream-Status: Submitted [https://github.com/rsyslog/librelp/pull/261] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + tests/receive.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tests/receive.c b/tests/receive.c +index f376cb4..e20861e 100644 +--- a/tests/receive.c ++++ b/tests/receive.c +@@ -33,6 +33,7 @@ + #include <limits.h> + #include <errno.h> + #include <signal.h> ++#include <sys/time.h> + #include "librelp.h" + + #define TRY(f) { const int TRY_r = f; if(TRY_r != RELP_RET_OK) { \ +-- +2.41.0 + diff --git a/meta-oe/recipes-extended/rsyslog/librelp/run-ptest b/meta-oe/recipes-extended/rsyslog/librelp/run-ptest new file mode 100644 index 0000000000..a649a5716f --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/librelp/run-ptest @@ -0,0 +1,10 @@ +#!/bin/sh +# +set -e +set -o pipefail + +SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" +cd ${SCRIPTPATH} +useradd tester || echo "user already exists" +su tester -c "make -C tests -k check-TESTS" +userdel tester |