Re: xfsdump musl patch questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

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@xxxxxxxxxx/

Of course the shorter workaround route should be good as first fix too.

I guess it depends on what the xfsdump maintainer prefers.

cheers
Holger




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux