diff options
author | Armin Kuster <akuster808@gmail.com> | 2017-03-15 16:57:20 -0700 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2017-03-27 14:57:26 -0700 |
commit | e16ae4d08029835af9340fcb30047c09930792fe (patch) | |
tree | 27462e7f2cd74a55627b9078aa35b527adc67e4e | |
parent | 4c4fa8c5036da1c3d8d3e7d5849f28cc47e95bb8 (diff) | |
download | meta-security-e16ae4d08029835af9340fcb30047c09930792fe.tar.gz |
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 <akuster808@gmail.com>
-rw-r--r-- | recipes-security/samhain/files/c99_dnmalloc.patch | 18 | ||||
-rw-r--r-- | recipes-security/samhain/samhain.inc | 5 |
2 files changed, 23 insertions, 0 deletions
diff --git a/recipes-security/samhain/files/c99_dnmalloc.patch b/recipes-security/samhain/files/c99_dnmalloc.patch new file mode 100644 index 0000000..2216564 --- /dev/null +++ b/recipes-security/samhain/files/c99_dnmalloc.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | samhain: musl build fix c99 | ||
2 | |||
3 | Upstream-Status: Submitted | ||
4 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
5 | |||
6 | Index: samhain-4.2.0/src/dnmalloc.c | ||
7 | =================================================================== | ||
8 | --- samhain-4.2.0.orig/src/dnmalloc.c | ||
9 | +++ samhain-4.2.0/src/dnmalloc.c | ||
10 | @@ -5524,7 +5524,7 @@ arc4_stir(void) | ||
11 | struct { | ||
12 | struct timeval tv1; | ||
13 | struct timeval tv2; | ||
14 | - u_int rnd[(128 - 2*sizeof(struct timeval)) / sizeof(u_int)]; | ||
15 | + unsigned char rnd[(128 - 2*sizeof(struct timeval)) / sizeof(unsigned char)]; | ||
16 | } rdat; | ||
17 | #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) | ||
18 | ssize_t sz = 0; | ||
diff --git a/recipes-security/samhain/samhain.inc b/recipes-security/samhain/samhain.inc index 789150b..d558e6b 100644 --- a/recipes-security/samhain/samhain.inc +++ b/recipes-security/samhain/samhain.inc | |||
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=8ca43cbc842c2336e835926c2166c28b" | |||
7 | SRC_URI = "http://la-samhna.de/archive/samhain_signed-${PV}.tar.gz \ | 7 | SRC_URI = "http://la-samhna.de/archive/samhain_signed-${PV}.tar.gz \ |
8 | file://${INITSCRIPT_NAME}.init \ | 8 | file://${INITSCRIPT_NAME}.init \ |
9 | file://${INITSCRIPT_NAME}.default \ | 9 | file://${INITSCRIPT_NAME}.default \ |
10 | file://c99_dnmalloc.patch \ | ||
10 | " | 11 | " |
11 | 12 | ||
12 | SRC_URI[md5sum] = "d98a55646b14f9419fcedde909d1bf02" | 13 | SRC_URI[md5sum] = "d98a55646b14f9419fcedde909d1bf02" |
@@ -75,6 +76,10 @@ do_configure () { | |||
75 | ${EXTRA_OECONF} | 76 | ${EXTRA_OECONF} |
76 | } | 77 | } |
77 | 78 | ||
79 | do_compile_prepend_libc-musl () { | ||
80 | sed -i 's/^#define HAVE_MALLOC_H.*//' ${B}/config.h | ||
81 | } | ||
82 | |||
78 | # Install the init script, it's default file, and the extraneous | 83 | # Install the init script, it's default file, and the extraneous |
79 | # documentation. | 84 | # documentation. |
80 | do_install_append () { | 85 | do_install_append () { |