sasquatch icon indicating copy to clipboard operation
sasquatch copied to clipboard

Debian / gcc / g++ gcc (Debian 10.2.0-15) 10.2.0 : fails to compile

Open Jegeva opened this issue 4 years ago • 3 comments

On compilation, LD complains about multiple references to "verbose" at linking

Easy to solve, ensure in the patch that :

verbose is extern in sasquatch/squashfs4.3/squashfs-tools/error.h add "int verbose;" in unsquashfs.c

Jegeva avatar Nov 02 '20 10:11 Jegeva

Another way that worked was to use -fcommon in CFLAGS since in GCC 10 the new default is -fno-common:

CFLAGS=-fcommon ./build.sh

As the man page says, this has a slight performance cost.

lorenzog avatar Nov 02 '20 20:11 lorenzog

Same issue on Kali/Debian with gcc (Debian 10.2.1-6) 10.2.1

Both solutions did not work for me. @Jegeva I changed in sasquatch/squashfs4.3/squashfs-tools/error.h int verbose; to extern int verbose; and added in unsquashfs.c int verbose; after int user_xattrs = FALSE;. Are these steps right?

Afterwards I get these errors:

/usr/bin/ld: unsquash-1.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/error.h:34: multiple definition of `verbose'; unsquashfs.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/unsquashfs.c:85: first defined here
/usr/bin/ld: unsquash-2.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/error.h:34: multiple definition of `verbose'; unsquashfs.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/unsquashfs.c:85: first defined here
/usr/bin/ld: unsquash-3.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/error.h:34: multiple definition of `verbose'; unsquashfs.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/unsquashfs.c:85: first defined here
/usr/bin/ld: unsquash-4.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/error.h:34: multiple definition of `verbose'; unsquashfs.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/unsquashfs.c:85: first defined here
/usr/bin/ld: compressor.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/error.h:34: multiple definition of `verbose'; unsquashfs.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/unsquashfs.c:85: first defined here
/usr/bin/ld: unsquashfs_info.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/error.h:34: multiple definition of `verbose'; unsquashfs.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/unsquashfs.c:85: first defined here
/usr/bin/ld: unsquashfs_xattr.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/error.h:34: multiple definition of `verbose'; unsquashfs.o:/home/jk2210/sasquatch/squashfs4.3/squashfs-tools/unsquashfs.c:85: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:298: sasquatch] Error 1

BlackTrackDragon avatar Mar 16 '21 11:03 BlackTrackDragon

After testing @lorenzog answer, it works.

BlackTrackDragon avatar Mar 18 '21 13:03 BlackTrackDragon