]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/libselinux/0002-fix-musl-build.patch
icu: remove Blackfin patch
[coffee/buildroot.git] / package / libselinux / 0002-fix-musl-build.patch
1 fix undefined macros in musl
2
3 musl does not define glibc-specific macros, so use a simple version of
4 the macro when it is not defined.
5
6 This is very inefficient, however, but copying the code from glibc is
7 not really possible because it is LGPL while libselinux in Public
8 Domain, and we want to avoid license propagation, so this macro is
9 completely written from scratch, and non-optimal.
10
11 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
12
13 diff -durN libselinux-2.1.13.orig/src/booleans.c libselinux-2.1.13/src/booleans.c
14 --- libselinux-2.1.13.orig/src/booleans.c       2013-02-06 02:43:22.000000000 +0100
15 +++ libselinux-2.1.13/src/booleans.c    2015-07-26 20:40:41.311801914 +0200
16 @@ -62,6 +62,14 @@
17                 goto bad;
18         }
19  
20 +/* Simple (but inefficient) version of _D_ALLOC_NAMLEN when
21 + * building with a C library that misses it (e.g. musl).
22 + * Note: glibc does a strlen on (d)->d_name, so assume it is safe.
23 + */
24 +#ifndef _D_ALLOC_NAMLEN
25 +#define _D_ALLOC_NAMLEN(d) (strlen((d)->d_name)+1)
26 +#endif
27 +
28         for (i = 0; i < *len; i++) {
29                 n[i] = (char *)malloc(_D_ALLOC_NAMLEN(namelist[i]));
30                 if (!n[i]) {