AgentD / squashfs-tools-ng

A new set of tools and libraries for working with SquashFS images
Other
194 stars 30 forks source link

Build fails with --without-tools #80

Closed mattst88 closed 3 years ago

mattst88 commented 3 years ago
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --docdir=/usr/share/doc/squashfs-tools-ng-1.1.0 --htmldir=/usr/share/doc/squashfs-tools-ng-1.1.0/html --with-sysroot=/ --libdir=/usr/lib64 --disable-static --with-lz4 --with-lzo --without-selinux --without-tools --with-xz --with-zstd
...
libtool: link: x86_64-pc-linux-gnu-gcc -Wall -Wextra -Wunused -Wmissing-prototypes -Wmissing-declarations -Wwrite-strings -Wjump-misses-init -Wuninitialized -Winit-self -Wlogical-op -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-parameter -Wunused-result -Wunused-variable -Wduplicated-cond -Wduplicated-branches -Wrestrict -Wnull-dereference -pedantic -O2 -march=native -pipe -Wl,-O1 -Wl,--as-needed -o .libs/xattr_benchmark tests/libsqfs/xattr_benchmark.o  libcommon.a ./.libs/libsquashfs.so -llzma -lz -llz4 -lzstd libcompat.a -pthread
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: tests/libsqfs/xattr_benchmark.o: in function `main':
xattr_benchmark.c:(.text.startup+0x13e): undefined reference to `print_version'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: xattr_benchmark.c:(.text.startup+0x237): undefined reference to `sqfs_perror'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: xattr_benchmark.c:(.text.startup+0x27d): undefined reference to `sqfs_perror'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: xattr_benchmark.c:(.text.startup+0x28f): undefined reference to `sqfs_perror'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:3347: xattr_benchmark] Error 1
make[1]: Leaving directory '/var/tmp/portage/sys-fs/squashfs-tools-ng-1.1.0/work/squashfs-tools-ng-1.1.0'
make: *** [Makefile:2120: all] Error 2
mattst88 commented 3 years ago

Looks like this would do the trick:

diff --git a/tests/libsqfs/Makemodule.am b/tests/libsqfs/Makemodule.am
index 5ebb94b..33567b0 100644
--- a/tests/libsqfs/Makemodule.am
+++ b/tests/libsqfs/Makemodule.am
@@ -13,7 +13,9 @@ xattr_benchmark_LDADD = libcommon.a libsquashfs.la libcompat.a
 LIBSQFS_TESTS = \
    test_abi test_table test_xattr_writer

+if BUILD_TOOLS
 noinst_PROGRAMS += xattr_benchmark
+endif

 check_PROGRAMS += $(LIBSQFS_TESTS)
 TESTS += $(LIBSQFS_TESTS)
AgentD commented 3 years ago

Hi @mattst88 ,

thanks for reporting this! I pushed commit 53f5c8ab0b28f209a938f40b1e3e209bcbcdd71f which fixes the xattr_benchmark being built if --without-tools is set, and an additional commit 78502ff3f0d7ae47c7468e718bcba2a84933cf51 which should also repair the test cases for libutil/libsqfs when building without the tools.

mattst88 commented 3 years ago

Thank you very much! Looks good to me.