From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f47.google.com ([74.125.83.47]:35616 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753223AbcK3Xrf (ORCPT ); Wed, 30 Nov 2016 18:47:35 -0500 Received: by mail-pg0-f47.google.com with SMTP id p66so87362719pga.2 for ; Wed, 30 Nov 2016 15:47:34 -0800 (PST) From: Eric Biggers Subject: [PATCH v2] Fix building xfsprogs on 32-bit platforms Date: Wed, 30 Nov 2016 15:46:20 -0800 Message-Id: <1480549580-105022-1-git-send-email-ebiggers@google.com> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: linux-xfs@vger.kernel.org Cc: Felix Janda , Dave Chinner , Eric Biggers 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 --- configure.ac | 3 --- include/builddefs.in | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index b88ab7f..ee918d1 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/include/builddefs.in b/include/builddefs.in index aeb2905..5219071 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -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@ -- 2.8.0.rc3.226.g39d4020