samhain: fix build issues when using musl
PATCH v2 1/1 samhain: fix build issues when using musl
[v2]: Correct musl malloc fix.
remove HAVE_MALLOC_H define; this enables using the included defined mallinfo.
[V1]: Fix c99
x_dnmalloc.c:563:26: error: return type is an incomplete type
| #define public_mALLINFo mallinfo
| ^
| x_dnmalloc.c:1689:17: note: in expansion of macro 'public_mALLINFo'
| struct mallinfo public_mALLINFo() {and
_dnmalloc.c:5527:17: error: unknown type name 'u_int' | u_int rnd[(128 - 2*sizeof(struct timeval)) / sizeof(u_int)]; | ^~~~~
Signed-off-by Armin Kuster <[email protected]>
--- recipes-security/samhain/files/c99_dnmalloc.patch | 18 ++++++++++++++++++ recipes-security/samhain/samhain.inc | 5 +++++ 2 files changed, 23 insertions(+) create mode 100644 recipes-security/samhain/files/c99_dnmalloc.patch
recipes-security/samhain/files/c99_dnmalloc.patch new file +18 -0
@@ -0,0 +1,18 @@ +samhain: musl build fix c99 + +Upstream-Status: Submitted +Signed-off-by: Armin Kuster <[email protected]> + +Index: samhain-4.2.0/src/dnmalloc.c +=================================================================== +--- samhain-4.2.0.orig/src/dnmalloc.c ++++ samhain-4.2.0/src/dnmalloc.c +@@ -5524,7 +5524,7 @@ arc4_stir(void) + struct { + struct timeval tv1; + struct timeval tv2; +- u_int rnd[(128 - 2*sizeof(struct timeval)) / sizeof(u_int)]; ++ unsigned char rnd[(128 - 2*sizeof(struct timeval)) / sizeof(unsigned char)]; + } rdat; + #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) + ssize_t sz = 0;
recipes-security/samhain/samhain.inc +5 -0
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=8ca43cbc842c2336e835926c2166c28b" SRC_URI = "http://la-samhna.de/archive/samhain_signed-${PV}.tar.gz \ file://${INITSCRIPT_NAME}.init \ file://${INITSCRIPT_NAME}.default \ + file://c99_dnmalloc.patch \ " SRC_URI[md5sum] = "d98a55646b14f9419fcedde909d1bf02"
@@ -75,6 +76,10 @@ do_configure () { ${EXTRA_OECONF} } +do_compile_prepend_libc-musl () { + sed -i 's/^#define HAVE_MALLOC_H.*//' ${B}/config.h +} + # Install the init script, it's default file, and the extraneous # documentation. do_install_append () {
Signature · 1 line
2.7.4