summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-05-06 18:09:09 -0700
committerKhem Raj <raj.khem@gmail.com>2024-05-06 18:10:14 -0700
commit0cc5ebd5b4308988be4c6f38f25dee52afe1cf39 (patch)
tree3f89b07a76fd1fb5c9a47e124556b35bd93ab62f
parent4c815591b03328ded622b6bf28974875d63e1c6e (diff)
downloadmeta-openembedded-0cc5ebd5b4308988be4c6f38f25dee52afe1cf39.tar.gz
librelp: Fix build with gcc-14
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-extended/rsyslog/librelp/0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch37
-rw-r--r--meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb1
2 files changed, 38 insertions, 0 deletions
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 @@
1From baf992f82aa987c608731866876adb856847ea45 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 6 May 2024 18:03:40 -0700
4Subject: [PATCH] relp: fix build against upcoming `gcc-14`
5 (`-Werror=calloc-transposed-args`)
6
7`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
8 detected minor infelicity in `calloc()` API usage
9
10Fixes
11../../git/src/relp.c: In function 'addToEpollSet':
12../../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]
13 101 | CHKmalloc(epd = calloc(sizeof(epolld_t), 1));
14 | ^~~~~~~~
15
16Upstream-Status: Submitted [https://github.com/rsyslog/librelp/pull/264]
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 src/relp.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22diff --git a/src/relp.c b/src/relp.c
23index eadda36..6268f1d 100644
24--- a/src/relp.c
25+++ b/src/relp.c
26@@ -98,7 +98,7 @@ addToEpollSet(relpEngine_t *const pThis, epolld_type_t typ, void *ptr, int sock,
27 epolld_t *epd = NULL;
28 ENTER_RELPFUNC;
29
30- CHKmalloc(epd = calloc(sizeof(epolld_t), 1));
31+ CHKmalloc(epd = calloc(1, sizeof(epolld_t)));
32 epd->typ = typ;
33 epd->ptr = ptr;
34 epd->sock = sock;
35--
362.45.0
37
diff --git a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
index 9d949c6303..49847047ac 100644
--- a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
+++ b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
@@ -11,6 +11,7 @@ SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=stable \
11 file://0001-tests-Fix-callback-prototype.patch \ 11 file://0001-tests-Fix-callback-prototype.patch \
12 file://0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch \ 12 file://0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch \
13 file://0001-tests-Include-missing-sys-time.h.patch \ 13 file://0001-tests-Include-missing-sys-time.h.patch \
14 file://0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch \
14 file://run-ptest \ 15 file://run-ptest \
15" 16"
16 17