devttys0 / sasquatch

501 stars 155 forks source link

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

Open Jegeva opened 3 years ago

Jegeva commented 3 years ago

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

lorenzog commented 3 years ago

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.

BlackTrackDragon commented 3 years ago

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 commented 3 years ago

After testing @lorenzog answer, it works.