* [PATCH v2] Fix building xfsprogs on 32-bit platforms
@ 2016-11-30 23:46 Eric Biggers
2016-12-01 0:20 ` Felix Janda
0 siblings, 1 reply; 3+ messages in thread
From: Eric Biggers @ 2016-11-30 23:46 UTC (permalink / raw)
To: linux-xfs; +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 <ebiggers@google.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] Fix building xfsprogs on 32-bit platforms
2016-11-30 23:46 [PATCH v2] Fix building xfsprogs on 32-bit platforms Eric Biggers
@ 2016-12-01 0:20 ` Felix Janda
2016-12-01 0:39 ` Eric Biggers
0 siblings, 1 reply; 3+ messages in thread
From: Felix Janda @ 2016-12-01 0:20 UTC (permalink / raw)
To: Eric Biggers; +Cc: linux-xfs, Dave Chinner
Eric Biggers wrote:
> 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.
Sorry, for this breakage. Patch looks good to me except that also the
now unecessary definition of AC_NEED_LFS should be removed from
m4/package_libcdev.m4.
Removing AC_SYS_LARGEFILE also has the advantage that the configure
script does no longer have a --disable-largefile option.
Felix
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] Fix building xfsprogs on 32-bit platforms
2016-12-01 0:20 ` Felix Janda
@ 2016-12-01 0:39 ` Eric Biggers
0 siblings, 0 replies; 3+ messages in thread
From: Eric Biggers @ 2016-12-01 0:39 UTC (permalink / raw)
To: Felix Janda; +Cc: linux-xfs, Dave Chinner
On Wed, Nov 30, 2016 at 07:20:50PM -0500, Felix Janda wrote:
> Eric Biggers wrote:
> > 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.
>
> Sorry, for this breakage. Patch looks good to me except that also the
> now unecessary definition of AC_NEED_LFS should be removed from
> m4/package_libcdev.m4.
>
> Removing AC_SYS_LARGEFILE also has the advantage that the configure
> script does no longer have a --disable-largefile option.
>
> Felix
Indeed, the AC_NEED_LFS definition should be removed. I forgot it wasn't
provided by autoconf.
I do notice that without AC_SYS_LARGEFILE we won't get largefile support for the
configuration tests in m4/package_libcdev.m4 anymore. I think it doesn't
actually matter though.
Eric
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-01 0:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30 23:46 [PATCH v2] Fix building xfsprogs on 32-bit platforms Eric Biggers
2016-12-01 0:20 ` Felix Janda
2016-12-01 0:39 ` Eric Biggers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).