From: Donald Douwsma <ddouwsma@redhat.com>
To: "Holger Hoffstätte" <holger@applied-asynchrony.com>,
"Adam Thiede" <me@adamthiede.com>,
linux-xfs@vger.kernel.org
Subject: Re: xfsdump musl patch questions
Date: Tue, 2 Sep 2025 12:14:35 +1000 [thread overview]
Message-ID: <081af947-f8d1-4eaa-a8b4-6db43f3cf4cc@redhat.com> (raw)
In-Reply-To: <222e77f3-7e15-cda3-3818-d5125c41a77b@applied-asynchrony.com>
On 31/8/25 04:39, Holger Hoffstätte wrote:
> On 2025-08-30 20:10, Adam Thiede wrote:
>
>> Thanks - using -D_LARGEFILE64_SOURCE also fixes the issue without the
>> enormous patch. However the following small patch is necessary since
>> alpine builds with -Wimplicit-function-declaration
>>
>> diff --git a/invutil/invidx.c b/invutil/invidx.c
>> index 5874e8d..9506172 100644
>> --- a/invutil/invidx.c
>> +++ b/invutil/invidx.c
>> @@ -28,6 +28,7 @@
>> #include <sys/stat.h>
>> #include <string.h>
>> #include <uuid/uuid.h>
>> +#include <libgen.h>
>>
>> #include "types.h"
>> #include "mlog.h"
>> diff --git a/common/main.c b/common/main.c
>> index 6141ffb..f5e959f 100644
>> --- a/common/main.c
>> +++ b/common/main.c
>> @@ -38,6 +38,7 @@
>> #include <string.h>
>> #include <uuid/uuid.h>
>> #include <locale.h>
>> +#include <libgen.h>
>>
>> #include "config.h"
>
> aargh..basename again!
>
> We fix it like this:
> https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-fs/xfsdump/files/xfsdump-3.1.12-mimic-basename-for-nonglibc.patch
>
> It's trickier than it looks since you need to actually audit the
> call sites, else you might get crashes at runtime.
My initial feeling is to just include libgen.h in include/config.h.in as
#if !defined(__GLIBC__)
#include <libgen.h>
#endif
Its less targeted than your patch which only touches files using
basename, but xfsprogs resolved this by including libgen.h in
platform_defs.in unconditionally somewhere after string.h
>> I think this one would be good to include at the very least.
>
> The thing is that your longer patch is conceptually the better way
> forward, just a bit incomplete as it is. We just discussed this on
> IRC and I can quote what our resident toolchain guru Sam had to say,
> which provides some background as well:
>
> [19:52:50] <sam_> the patch is wrong as it is, at least without some
> rationale & checking that AC_SYS_LARGEFILE is used (to guarantee off_t
> is 64-bit on 32-bit glibc systems)
> [19:53:05] <sam_> in general, the stat64, off64_t, etc types should go
> away (they're transitional)
> [19:53:12] <sam_> the issue is when getting rid of them, people often
> get it wrong
> [19:53:25] <sam_> the types were added into glibc to allow people to
> have dual ABIs in their headers
> [19:53:26] <sam_> it never took off
> [19:53:45] <sam_> you can look at the thread where I ported xfsprogs itself
>
> The thread he's referring to starts here:
> https://lore.kernel.org/linux-xfs/20240205232343.2162947-1-sam@gentoo.org/
Thanks for the context, I noticed the comment about _LARGEFILE64_SOURCE
in the release notes you mentioned earlier
https://musl.libc.org/releases.html
In general xfsdump should follow how xfsprogs builds.
Ill also look over the other changes made to the xfsprogs build and
see if there's anything else that's been missed.
Don
next prev parent reply other threads:[~2025-09-02 2:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-30 11:23 xfsdump musl patch questions Adam Thiede
2025-08-30 17:46 ` Holger Hoffstätte
2025-08-30 18:10 ` Adam Thiede
2025-08-30 18:39 ` Holger Hoffstätte
2025-09-02 2:14 ` Donald Douwsma [this message]
2025-09-02 5:46 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=081af947-f8d1-4eaa-a8b4-6db43f3cf4cc@redhat.com \
--to=ddouwsma@redhat.com \
--cc=holger@applied-asynchrony.com \
--cc=linux-xfs@vger.kernel.org \
--cc=me@adamthiede.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).