dracut fails to compile on musl based systems due to cpu_set_t and __uid_t being undefined. It also gives a few warnings due to install/log.c not including string.h
Steps to Reproduce:
1. emerge -v1 dracut
x86_64-gentoo-linux-musl-gcc -Os -pipe -fomit-frame-pointer -mtune=generic -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -c -o install/dracut-install.o install/dracut-install.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
install/dracut-install.c: In function 'cp':
install/dracut-install.c:225:55: error: '__uid_t' undeclared (first use in this function)
if(fchown(dest_desc, (__uid_t) - 1, sb.st_gid) != 0)
install/dracut-install.c:225:55: note: each undeclared identifier is reported only once for each function it appears in
<builtin>: recipe for target 'install/dracut-install.o' failed
make: *** [install/dracut-install.o] Error 1
>>> sys-kernel/dracut-041-r2 merged.
Provided patch taken from https://github.com/voidlinux/void-packages/blob/master/srcpkgs/dracut/patches/portability.patch
Created attachment 403806 [details, diff]
Fixes it for musl and doesn't break compilation on glibc based systems.
Thanks. Patch is applied upstream, too.
+*dracut-041-r3 (02 Jun 2015)
+ 02 Jun 2015; Amadeusz Żołnowski <firstname.lastname@example.org> +dracut-041-r3.ebuild,
+ Make dracut tools compile on musl. Fix bug #550204.