On 8/30/25 12:46, Holger Hoffstätte wrote:
On 2025-08-30 13:23, Adam Thiede wrote:
Hello - I'm interested in packaging xfsdump for alpine linux.
However, alpine uses musl libc and I had to change a lot of things to
get xfsdump to build. Mostly it was changing types that are specific
to glibc (i.e. stat64 -> stat). I'm not much of a c programmer myself
so I am likely misunderstanding some things, but changing these types
allows xfsdump to compile and function on musl libc. xfsdump still
compiles on Debian with this patch too.
You might want to double-check with Gentoo's Musl porting notes:
https://wiki.gentoo.org/wiki/Musl_porting_notes
esp. 2.6: "error: LFS64 interfaces".
We currently still take the "workaround" route:
https://gitweb.gentoo.org/repo/gentoo.git/commit/sys-fs/xfsdump/
xfsdump-3.1.12.ebuild?id=33791d44f8bbe7a8d1566a218a76050d9f51c33d
..but fixing this for real is certainly a good idea!
cheers
Holger
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"
I think this one would be good to include at the very least.