Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 550204

Summary: sys-kernel/dracut does not compile on with musl libc, patch provided
Product: Gentoo Linux Reporter: Robert Sebastian Gerus <ar>
Component: [OLD] Core systemAssignee: Amadeusz Żołnowski (RETIRED) <aidecoe>
Severity: normal CC: alexander, ar
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 430702    
Attachments: portability.patch

Description Robert Sebastian Gerus 2015-05-23 08:37:19 UTC
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

Reproducible: Always

Steps to Reproduce:
1. emerge -v1 dracut
Actual Results:  
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

Expected Results:  
>>> sys-kernel/dracut-041-r2 merged.

Provided patch taken from
Comment 1 Robert Sebastian Gerus 2015-05-23 08:38:35 UTC
Created attachment 403806 [details, diff]

Fixes it for musl and doesn't break compilation on glibc based systems.
Comment 2 Amadeusz Żołnowski (RETIRED) gentoo-dev 2015-06-02 09:34:36 UTC
Thanks. Patch is applied upstream, too.

+*dracut-041-r3 (02 Jun 2015)
+  02 Jun 2015; Amadeusz Żołnowski <> +dracut-041-r3.ebuild,
+  +files/041-r2-0004-Portability-fixes.patch:
+  Make dracut tools compile on musl. Fix bug #550204.