Created attachment 402982 [details, diff] musl fixes for sys-fs/xfsprogs, from Alpine Linux Working on assembling a musl-based MIPS netboot, and I had to hunt down some patches from Alpine Linux that enable xfsprogs to build properly against sys-libs/musl. Patches are taken from here: http://git.alpinelinux.org/cgit/aports/tree/main/xfsprogs
Created attachment 402984 [details, diff] musl limits.h fixes for sys-fs/xfsprogs, from Alpine Linux
not sure what happened here, but this bug was submitted twice. *** This bug has been marked as a duplicate of bug 549116 ***
Actually, it's not a duplicate. xfsprogs and xfsdump are two separate packages. No idea why SGI split them up. The patches to fix both might share some similarities, but on this bug, I picked the patches from Alpine Linux, whereas on the xfsdump bug, I rolled that one myself.
w.r.t. the __uint*_t, I think we should ask upstream for using stdint.h types. To comment on what the patch does to platform_is_mounted() (it seems sensible to me, though I have not checked the details): The syscall ustat is deprecated and that is most likely the reason why musl does not provide <ustat.h>. The man page advises to use statfs instead, however statfs can't do what ustat is used for here, namely to check for whether a device file is mounted. The approach of the patch is to use the *mntent functions to walk through the mounts and to look for one of the given device file.
(In reply to Joshua Kinard from comment #3) > Actually, it's not a duplicate. xfsprogs and xfsdump are two separate > packages. Heh, I should read more carefully. I've added the patches but as Felix noted, the first one is a hack. A lot of the patch on the hardened-dev and alpine repos as just hacks. They are correct in the sense of giving functioning executables, but they don't conform to standards (as in this case) or they lack the intelligence to work across libc's. I hope as part of this project we eventually clean these patches and push upstream as I did for uclibc where now much of gentoo "just works".
Sorry forgot to mark in progress for pushing a fix upstream.
(In reply to Felix Janda from comment #4) > To comment on what the patch does to platform_is_mounted() (it seems > sensible to me, though I have not checked the details): > > The syscall ustat is deprecated and that is most likely the reason why > musl does not provide <ustat.h>. The man page advises to use statfs > instead, however statfs can't do what ustat is used for here, namely to > check for whether a device file is mounted. The approach of the patch > is to use the *mntent functions to walk through the mounts and to look > for one of the given device file. The last part of attachment 402982 [details, diff] is similar to attachment 374830 [details, diff] of bug 477758 I use on uclibc. Can we review the difference and create a common fix?
Created attachment 411828 [details, diff] Common fix (against current git) for ustat The ustat problem is the same for both musl and uclibc. Compared to the alpine patch, this patch makes the situation when the mount table cannot be opened more consistent with what is done on FreeBSD.
Some patches sent upstream: http://oss.sgi.com/pipermail/xfs/2016-January/046176.html
*** Bug 571672 has been marked as a duplicate of this bug. ***
The current ebuild in the musl overlay is at version 3.2.2. The current version of xfsprogs in gentoo stable is 3.2.4, and in testing is 4.3.0. The ebuild in the musl overlay needs to be updated.
(In reply to Jasen Borisov from comment #11) > The current ebuild in the musl overlay is at version 3.2.2. > > The current version of xfsprogs in gentoo stable is 3.2.4, and in testing is > 4.3.0. The ebuild in the musl overlay needs to be updated. i bumped to 3.2.4-r99 in the musl overlay. let me know if it works.
this got fixed with stable in tree xfsprogs-4.14
(In reply to tt_1 from comment #13) > this got fixed with stable in tree xfsprogs-4.14 This is rebroken in 4.15 so no point in closing.
(In reply to Jory A. Pratt from comment #14) > (In reply to tt_1 from comment #13) > > this got fixed with stable in tree xfsprogs-4.14 > > This is rebroken in 4.15 so no point in closing. 4.15.1 is now fixed and working in musl overlay.
Marking as OBSOLETE, as xfsprogs-5.x needs different patches to compile and work correctly under MIPS. I'll open a new bug for those two shortly.