From fb702218ab47b045cbbaf3268984fbdc5f75632e Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Wed, 29 May 2024 11:12:14 -0700 Subject: [PATCH] fuse2fs: explicitly set _FILE_OFFSET_BITS again In commit 3ab99d9b602, the build system was changed not to set _FILE_OFFSET_BITS explicitly due to some weird error on mips64el. Unfortunately, this breaks the aarch64 Debian build because libfuse 2.9.9 requires this value to be set explicitly. Restore this dumb preprocessor symbol dependency with even more hackery as documented in the commit. Fixes: 3ab99d9b602 ("Remove explicit #define of _FILE_OFFSET_BITS") Signed-off-by: Darrick J. Wong Link: https://lore.kernel.org/r/20240529181214.GA52969@frogsfrogsfrogs Signed-off-by: Theodore Ts'o --- misc/fuse2fs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c index 56a0d54..0129386 100644 --- a/misc/fuse2fs.c +++ b/misc/fuse2fs.c @@ -26,7 +26,23 @@ #endif #include #include +#ifdef __SET_FOB_FOR_FUSE +# error Do not set magic value __SET_FOB_FOR_FUSE!!!! +#endif +#ifndef _FILE_OFFSET_BITS +/* + * Old versions of libfuse (e.g. Debian 2.9.9 package) required that the build + * system set _FILE_OFFSET_BITS explicitly, even if doing so isn't required to + * get a 64-bit off_t. AC_SYS_LARGEFILE doesn't set any _FILE_OFFSET_BITS if + * it's not required (such as on aarch64), so we must inject it here. + */ +# define __SET_FOB_FOR_FUSE +# define _FILE_OFFSET_BITS 64 +#endif /* _FILE_OFFSET_BITS */ #include +#ifdef __SET_FOB_FOR_FUSE +# undef _FILE_OFFSET_BITS +#endif /* __SET_FOB_FOR_FUSE */ #include #include "ext2fs/ext2fs.h" #include "ext2fs/ext2_fs.h" -- 1.8.3.1