All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@google.com>
To: linux-xfs@vger.kernel.org
Cc: Felix Janda <felix.janda@posteo.de>,
	Dave Chinner <david@fromorbit.com>,
	Eric Biggers <ebiggers@google.com>
Subject: [PATCH v3] Fix building xfsprogs on 32-bit platforms
Date: Wed, 30 Nov 2016 16:42:12 -0800	[thread overview]
Message-ID: <1480552932-614-1-git-send-email-ebiggers@google.com> (raw)

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>
---
 configure.ac          |  3 ---
 include/builddefs.in  |  2 +-
 m4/package_libcdev.m4 | 16 ----------------
 3 files changed, 1 insertion(+), 20 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@
diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
index e3c59d8..7d5a42d 100644
--- a/m4/package_libcdev.m4
+++ b/m4/package_libcdev.m4
@@ -258,22 +258,6 @@ AC_DEFUN([AC_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
 # actually defines struct fsxattr /and/ the system definition
-- 
2.8.0.rc3.226.g39d4020


             reply	other threads:[~2016-12-01  0:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01  0:42 Eric Biggers [this message]
2016-12-02 13:13 ` [PATCH v3] Fix building xfsprogs on 32-bit platforms Christoph Hellwig
2016-12-03 15:21 ` Felix Janda
2016-12-21 19:04 ` Eric Biggers
2016-12-21 21:33   ` Eric Sandeen
2016-12-22  8:58     ` Christoph Hellwig
2016-12-22 15:09       ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1480552932-614-1-git-send-email-ebiggers@google.com \
    --to=ebiggers@google.com \
    --cc=david@fromorbit.com \
    --cc=felix.janda@posteo.de \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.