Skip to contentSkip to conversation

librelp: Fix ptests builds on musl

PATCH New Khem Raj 1 participant 2 messages Aug 19, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 librelp: Fix ptests builds on musl

---
 ...001-tests-Include-missing-sys-time.h.patch | 50 +++++++++++++++++++
 .../rsyslog/librelp_1.11.0.bb                 |  1 +
 2 files changed, 51 insertions(+)
 create mode 100644 meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Include-missing-sys-time.h.patch
meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Include-missing-sys-time.h.patch new file +50 -0
new file mode 100644
index 0000000000..9316f51ffa
@@ -0,0 +1,50 @@
+From 5c32487a9c127f37141488d416cdb5d5bec6aca1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+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 <[email protected]>
+---
+ 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) { \
+@@ -68,7 +69,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));
+-- 
+2.41.0
+
meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb +1 -0
index c64eaf2c48..705452734a 100644
@@ -10,6 +10,7 @@ SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=stable \
            file://0001-Fix-function-inline-errors-in-debug-optimization-Og.patch \
            file://0001-tests-Fix-callback-prototype.patch \
            file://0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch \
+           file://0001-tests-Include-missing-sys-time.h.patch \
            file://run-ptest \
 "
 
Signature · 1 line
2.41.0
author
#1 lore raw

PATCH 2/2 librelp: Fix ptest installs to work with dash

---
 meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb +1 -1
index 705452734a..9d949c6303 100644
@@ -41,7 +41,7 @@ do_install_ptest() {
     install -d ${D}${PTEST_PATH}/${TESTDIR}
 
     # copy source tests/*.sh and python scripts
-    cp -f ${S}/${TESTDIR}/*.{sh,py} ${D}${PTEST_PATH}/${TESTDIR}
+    cp -f ${S}/${TESTDIR}/*.sh ${S}/${TESTDIR}/*.py ${D}${PTEST_PATH}/${TESTDIR}
     # install data files needed by the test scripts on the target
     cp -f ${S}/${TESTDIR}/*.supp ${D}${PTEST_PATH}/${TESTDIR}
     cp -rf ${S}/${TESTDIR}/tls-certs ${D}${PTEST_PATH}/${TESTDIR}
Signature · 1 line
2.41.0