#45 plpfuse fails to build on Linux x86_64

None
closed-fixed
nobody
None
5
2014-07-05
2010-10-05
Philip Pemberton
No

When building plptools on a 64-bit Linux system, configure fails to find libfuse:

checking fuse.h usability... no
checking fuse.h presence... no
checking for fuse.h... no
checking for fuse_new in -lfuse... yes
checking for supported FUSE API version... no

The configure log shines a little more light on this:

configure:19897: checking fuse.h usability
configure:19897: gcc -c -g -O2 -Wall -W -Wmissing-prototypes -Wstrict-prototypes -pedantic conftest.c >&5
In file included from /usr/include/fuse/fuse.h:26,
from /usr/include/fuse.h:9,
from conftest.c:135:
/usr/include/fuse/fuse_common.h:32: error: #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
configure:19897: $? = 1

If you attempt to build plpfuse regardless, the same error occurs:

make: Entering directory `/home/philpem/psion/plptools/plptools-1.0.10/plpfuse'
g++ -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cc
In file included from /usr/include/fuse/fuse.h:26,
from /usr/include/fuse.h:9,
from plpfuse.h:8,
from rfsv_api.h:30,
from main.cc:46:
/usr/include/fuse/fuse_common.h:32: error: #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!

-- Workaround --
The configure script isn't using the right CFLAGS on x86_64. This patch works around the bug, though it may not be the right way to do it:

--- configure.ac 2010-06-24 11:14:07.000000000 +0100
+++ ../plptools-1.0.10-mod/configure.ac 2010-10-04 23:37:04.000000000 +0100
@@ -27,8 +27,10 @@
[
if test $enableval = yes; then
CFLAGS="-g"
+ CXXFLAGS="-g"
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -ggdb"
+ CXXFLAGS="$CXXFLAGS -ggdb"
fi
AC_MSG_RESULT(yes)
AC_DEFINE(DEBUG, 1, [Define this to include debugging code.])
@@ -42,6 +44,7 @@
dnl Turn on additional compiler warnings
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -Wall -W -Wmissing-prototypes -Wstrict-prototypes -pedantic"
+ CXXFLAGS="$CXXFLAGS -Wall -W -Wmissing-prototypes -Wstrict-prototypes -pedantic"
fi

dnl NLS support
@@ -108,6 +111,8 @@
AC_SUBST(LIBHISTORY)

# FUSE for plpfuse
+CFLAGS="$CFLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
+CXXFLAGS="$CXXFLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
enable_fuse=yes
AC_CHECK_HEADER(fuse.h,, enable_fuse=no)
AC_CHECK_LIB(fuse,fuse_new, [true], enable_fuse=no)

Discussion

  • Reuben Thomas
    Reuben Thomas
    2010-10-05

    This looks to me like a bug in FUSE. From the glibc documentation:

    "On 64 bit systems this macro has no effect"

    On 32-bit systems, the configure script causes the macro to be defined, since it is needed for large file support (LFS). On 64-bit systems, where the various file calls are identical with the 32-bit versions (at least, on a 64-bit system with 64-bit libraries), this macro is not needed.

    Unfortunately, this argument has already been had on the FUSE mailing list and there seem to be no plans to fix this bug. However, if I use pkg-config to detect FUSE, this macro will be correctly set, and since this simplifies the detection logic for FUSE considerably, I will do it.

    You can work around this by defining _FILE_OFFSET_BITS in your ./configure command line.

     
  • Reuben Thomas
    Reuben Thomas
    2010-10-05

    I'd be grateful if you could test the new version, 1.0.11, before release; either check out current CVS, or give me an email address to which I can send a tarball.

     
  • Reuben Thomas
    Reuben Thomas
    2014-07-05

    Now I have a 64-bit system, and have tested that the fix works.

     
  • Reuben Thomas
    Reuben Thomas
    2014-07-05

    • status: open --> closed-fixed
    • Group: -->