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

Bug 549100

Summary: sys-fs/xfsprogs - patches for building in a musl environment
Product: Gentoo Linux Reporter: Joshua Kinard <kumba>
Component: OverlaysAssignee: Gentoo musl team <musl>
Status: RESOLVED OBSOLETE    
Severity: normal CC: base-system, tajjada, tsmksubc
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://git.alpinelinux.org/cgit/aports/tree/main/xfsprogs
See Also: https://bugs.gentoo.org/show_bug.cgi?id=477758
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 430702    
Attachments: musl fixes for sys-fs/xfsprogs, from Alpine Linux
musl limits.h fixes for sys-fs/xfsprogs, from Alpine Linux
Common fix (against current git) for ustat

Description Joshua Kinard gentoo-dev 2015-05-10 18:41:42 UTC
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
Comment 1 Joshua Kinard gentoo-dev 2015-05-10 18:42:51 UTC
Created attachment 402984 [details, diff]
musl limits.h fixes for sys-fs/xfsprogs, from Alpine Linux
Comment 2 Anthony Basile gentoo-dev 2015-05-13 14:46:42 UTC
not sure what happened here, but this bug was submitted twice.

*** This bug has been marked as a duplicate of bug 549116 ***
Comment 3 Joshua Kinard gentoo-dev 2015-05-14 04:23:19 UTC
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.
Comment 4 Felix Janda 2015-05-14 17:00:52 UTC
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.
Comment 5 Anthony Basile gentoo-dev 2015-05-15 11:12:18 UTC
(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".
Comment 6 Anthony Basile gentoo-dev 2015-05-15 11:12:50 UTC
Sorry forgot to mark in progress for pushing a fix upstream.
Comment 7 René Rhéaume 2015-07-11 21:47:16 UTC
(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?
Comment 8 Felix Janda 2015-09-13 20:43:15 UTC
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.
Comment 9 Felix Janda 2016-01-12 22:37:27 UTC
Some patches sent upstream: http://oss.sgi.com/pipermail/xfs/2016-January/046176.html
Comment 10 Jasen Borisov 2016-01-12 23:05:52 UTC
*** Bug 571672 has been marked as a duplicate of this bug. ***
Comment 11 Jasen Borisov 2016-01-12 23:06:57 UTC
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.
Comment 12 Anthony Basile gentoo-dev 2016-01-12 23:50:35 UTC
(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.
Comment 13 tt_1 2018-03-09 11:28:01 UTC
this got fixed with stable in tree xfsprogs-4.14
Comment 14 Jory A. Pratt gentoo-dev 2018-03-10 02:40:43 UTC
(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.
Comment 15 Jory A. Pratt gentoo-dev 2018-04-09 20:07:16 UTC
(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.
Comment 16 Joshua Kinard gentoo-dev 2020-04-27 17:09:17 UTC
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.