vasi / squashfuse

FUSE filesystem to mount squashfs archives
Other
286 stars 66 forks source link

squashfuse 0.5.1 fails to compile for arm and i686 CPU architectures in termux in android #129

Closed Biswa96 closed 4 months ago

Biswa96 commented 4 months ago
squashfuse/src/ll_main.c:164:22: error: incompatible function pointer types assigning to 'void (*)(fuse_req_t, fuse_ino_t, unsigned long)' (aka 'void (*)(struct fuse_req *, unsigned long, unsigned long)') from 'void (fuse_req_t, fuse_ino_t, uint64_t)' (aka 'void (struct fuse_req *, unsigned long, unsigned long long)') [-Wincompatible-function-pointer-types]
        sqfs_ll_ops.forget              = sqfs_ll_op_forget;
                                        ^ ~~~~~~~~~~~~~~~~~
configure:17790: checking for 64_t third argument to fuse ll forget op
configure:17814: arm-linux-androideabi-clang -o conftest  -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -fstack-protector-strong -Oz  -I/data/data/com.termux/files/usr/include  -D_FILE_OFFSET_BITS=64 -I/data/data/com.termux/files/usr/include/fuse -L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -march=armv7-a -fopenmp -static-openmp -fno-openmp-implicit-rpath -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now conftest.c   -L/data/data/com.termux/files/usr/lib -lfuse -pthread >&5
conftest.c:62:17: error: incompatible function pointer types assigning to 'void (*)(fuse_req_t, fuse_ino_t, unsigned long)' (aka 'void (*)(struct fuse_req *, unsigned long, unsigned long)') from 'void (fuse_req_t, fuse_ino_t, uint64_t)' (aka 'void (struct fuse_req *, unsigned long, unsigned long long)') [-Wincompatible-function-pointer-types]
                                        flo.forget = f;
                                                   ^ ~
/* Define if we have uint64_t as type of 3rd arg to ll forget op */
/* #undef HAVE_FUSE_LL_FORGET_OP_64T */
Biswa96 commented 4 months ago

I found the cause of this issue after writing it. rubberducking really works :duck:

The source tarball in release page has config.h which defines HAVE_FUSE_LL_FORGET_OP_64T macro. In case of out-of-tree build, the src-dir/config.h is included instead of build-dir/config.h.

DrDaveD commented 4 months ago

The source tarball in release page has config.h which defines HAVE_FUSE_LL_FORGET_OP_64T macro. In case of out-of-tree build, the src-dir/config.h is included instead of build-dir/config.h.

I don't understand what you mean. Where are src-dir and build-dir? Is that some artifact of the termux build?

That compiler error makes me think that the else part of the code should have worked, since it defaults to using unsigned long as the third parameter.

Biswa96 commented 4 months ago

Where are src-dir and build-dir?

I just abbreviated source directory and build directory. I meant that the https://github.com/vasi/squashfuse/releases/download/v0.5.1/squashfuse-0.5.1.tar.gz file should not have config.h file.

DrDaveD commented 4 months ago

That's a generated tarball that includes running autogen.sh and configure followed by a standard make dist. Doesn't running configure again make a new config.h?

Maybe you want the source tarball generated by github instead?

Biswa96 commented 4 months ago

Doesn't running configure again make a new config.h?

Yes, running configure creates new config.h but it is in build directory in case of out-of-tree build. I do not know why the config.h from source directory is included. I have tested that deleting config.h in source directory fixes the out-of-tree build in 32 bit environment.

Maybe you want the source tarball generated by github instead?

That is what I did after finding this issue.

DrDaveD commented 4 months ago

What exactly do you mean by an out-of-tree build?

Biswa96 commented 4 months ago

It means source directory and build directory are different. For example,

mkdir bin; cd bin
../squashfuse/configure
make
cd squashfuse
./configure
make
DrDaveD commented 4 months ago

Oh. I don't know if that is supported. The instructions in the README file all say to use ./configure.

vasi commented 4 months ago

Out-of-tree builds should be supported by autotools (automake + autoconf), which is what squashfuse uses to setup configure.

vasi commented 4 months ago

Puzzling! I looked at GNU groff as an example of software that uses autotools, and its release tarballs do not contain 'config.h'. But make dist builds a tarball that does have config.h.