]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Fix building xfsprogs on 32-bit platforms
authorEric Biggers <ebiggers@google.com>
Thu, 22 Dec 2016 15:31:29 +0000 (09:31 -0600)
committerEric Sandeen <sandeen@redhat.com>
Thu, 22 Dec 2016 15:31:29 +0000 (09:31 -0600)
xfslibs now requires that its users enable transparent largefile
support.  This broke building xfsprogs on 32-bit Linux (with glibc)
because _FILE_OFFSET_BITS=64 was not getting defined.  Although the
autoconf macro AC_SYS_LARGEFILE was intended to define it, this didn't
work because AC_SYS_LARGEFILE will only define _FILE_OFFSET_BITS in a
config header, which doesn't work for xfsprogs because not all .c files
include platform_defs.h as their first include.  Also,
platform_defs.h.in is not generated by autoheader and didn't contain a
template for _FILE_OFFSET_BITS.

Therefore, to fix the problem remove the useless autoconf macros and
instead add -D_FILE_OFFSET_BITS=64 to CFLAGS in builddefs.in.  Use
CFLAGS rather than PCFLAGS because this definition could be needed by
platforms other than "linux", and it doesn't hurt to always define it.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Felix Janda <felix.janda@posteo.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
configure.ac
include/builddefs.in
m4/package_libcdev.m4

index b88ab7f164161c7e280a3c25a52847729add642e..ee918d1310194f0fa75897e37bef59545b43915e 100644 (file)
@@ -107,9 +107,6 @@ AC_PACKAGE_UTILITIES(xfsprogs)
 AC_MULTILIB($enable_lib64)
 AC_RT($enable_librt)
 
-AC_SYS_LARGEFILE
-AC_NEED_LFS
-
 AC_PACKAGE_NEED_UUID_H
 AC_PACKAGE_NEED_UUIDCOMPARE
 
index aeb29059ae4da06e104f9a4beda78def8df10675..521907123a23f4a934a20939ddcc898e8db038f8 100644 (file)
@@ -25,7 +25,7 @@ OPTIMIZER = @opt_build@
 MALLOCLIB = @malloc_lib@
 LOADERFLAGS = @LDFLAGS@
 LTLDFLAGS = @LDFLAGS@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64
 
 LIBRT = @librt@
 LIBUUID = @libuuid@
index e3c59d8320fa7b0041158e9bc351c009e01f8c41..7d5a42d2a7bfc84139242a25b1f3627d6f4dcce5 100644 (file)
@@ -257,22 +257,6 @@ AC_DEFUN([AC_HAVE_MREMAP],
     AC_SUBST(have_mremap)
   ])
 
-#
-# Check if transparent LFS is enabled
-#
-AC_DEFUN([AC_NEED_LFS],
-  [ AC_MSG_CHECKING([whether large file support works])
-    AC_TRY_COMPILE([
-#include <unistd.h>
-    ], [
-         int i[sizeof(off_t)-8];
-    ], AC_MSG_RESULT(yes),
-       [AC_MSG_RESULT(no)
-       echo
-       echo 'FATAL ERROR: C library does not support transparent LFS.'
-       exit 1])
-  ])
-
 #
 # Check if we need to override the system struct fsxattr with
 # the internal definition.  This /only/ happens if the system