public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@google.com>
To: fstests@vger.kernel.org
Cc: Eric Biggers <ebiggers@google.com>
Subject: [PATCH] fstests: allow building with latest xfslibs on 32-bit Linux
Date: Wed, 30 Nov 2016 14:31:42 -0800	[thread overview]
Message-ID: <1480545102-51699-1-git-send-email-ebiggers@google.com> (raw)

The next version of xfslibs will require that its users enable
transparent largefile support.  This broke building xfstests on 32-bit
Linux because _FILE_OFFSET_BITS=64 was not getting defined when testing
for xfs headers.  Fix this by defining _FILE_OFFSET_BITS=64 when doing
configure checks for the xfs headers.

It was not necessary to define _FILE_OFFSET_BITS=64 for the actual build
because it's already done, in builddefs.in.

The problem could also be solved by adding AC_SYS_LARGEFILE to
configure.ac.  It's debatable, but I chose not to do that because it
might give the impression that it affects the actual compilation of the
test programs and not just the configure checks.  (Since not all .c
files include config.h first, a _FILE_OFFSET_BITS definition in config.h
wouldn't always take effect.)

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 m4/package_xfslibs.m4 | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/m4/package_xfslibs.m4 b/m4/package_xfslibs.m4
index 6bf4704..5588e9e 100644
--- a/m4/package_xfslibs.m4
+++ b/m4/package_xfslibs.m4
@@ -1,5 +1,8 @@
 AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H],
-  [ AC_CHECK_HEADERS([xfs/xfs.h],,,[#define _GNU_SOURCE])
+  [ AC_CHECK_HEADERS([xfs/xfs.h],,,[
+      #define _GNU_SOURCE
+      #define _FILE_OFFSET_BITS 64
+    ])
     if test "$ac_cv_header_xfs_xfs_h" != "yes"; then
         echo
         echo 'FATAL ERROR: cannot find a valid <xfs/xfs.h> header file.'
@@ -23,7 +26,10 @@ AC_DEFUN([AC_PACKAGE_WANT_XLOG_ASSIGN_LSN],
   ])
 
 AC_DEFUN([AC_PACKAGE_NEED_XFS_XQM_H],
-  [ AC_CHECK_HEADERS([xfs/xqm.h],,,[#define _GNU_SOURCE])
+  [ AC_CHECK_HEADERS([xfs/xqm.h],,,[
+        #define _GNU_SOURCE
+        #define _FILE_OFFSET_BITS 64
+    ])
     if test "$ac_cv_header_xfs_xqm_h" != "yes"; then
         echo
         echo 'FATAL ERROR: cannot find a valid <xfs/xqm.h> header file.'
@@ -103,6 +109,7 @@ AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO],
   [ AC_MSG_CHECKING([xfsctl from xfs/xfs.h])
     AC_TRY_LINK([
 #define _GNU_SOURCE
+#define _FILE_OFFSET_BITS 64
 #include <xfs/xfs.h> ],
       [ int x = xfsctl(0, 0, 0, 0); ],
       [ echo ok ],
-- 
2.8.0.rc3.226.g39d4020


                 reply	other threads:[~2016-11-30 22:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1480545102-51699-1-git-send-email-ebiggers@google.com \
    --to=ebiggers@google.com \
    --cc=fstests@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox