Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jegeva opened this issue Nov 2, 2020 · 3 comments · May be fixed by #46
Open

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

Jegeva opened this issue Nov 2, 2020 · 3 comments · May be fixed by #46

Comments

@Jegeva
Copy link

Jegeva commented Nov 2, 2020

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
Copy link

lorenzog commented Nov 2, 2020

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
Copy link

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
Copy link

After testing @lorenzog answer, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants