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

loSame issue on Kali/Debian with gcc (Debian 10.2.1-6) 10.2.1 #43

Open
sevrb opened this issue Nov 9, 2021 · 5 comments
Open

loSame issue on Kali/Debian with gcc (Debian 10.2.1-6) 10.2.1 #43

sevrb opened this issue Nov 9, 2021 · 5 comments

Comments

@sevrb
Copy link

sevrb commented Nov 9, 2021

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

Originally posted by @JK2210 in #36 (comment)

@ghost
Copy link

ghost commented Dec 9, 2021

This worked for me. Just make sure to run make clean before running make again. Also, for the error you get before this one, delete -Werror from the Makefile to get rid of:

unsquashfs.c:1835:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
 1835 |     if(swap)

@chilik
Copy link

chilik commented Dec 26, 2021

I have successfully compiled on Kali linux (M1) using this simple patch to the ./patches/patch0.txt to add the cflags: -fcommon and to remove the -Wall from the makefile:

diff --git a/patches/patch0.txt b/patches/patch0.txt
index 42af923..35c80a6 100644
--- a/patches/patch0.txt
+++ b/patches/patch0.txt
@@ -38118,12 +38118,12 @@ diff --strip-trailing-cr -NBbaur squashfs-tools/Makefile squashfs-tools-patched/
        unsquash-4.o swap.o compressor.o unsquashfs_info.o

 -CFLAGS ?= -O2
-+# CJH: Added -g, -Werror and -DSQUASHFS_TRACE
-+CFLAGS ?= -g -O2
++# CJH: Added -g, -fcommon and removed -Werror and -DSQUASHFS_TRACE
++CFLAGS ?= -g -O2 -fcommon
  CFLAGS += $(EXTRA_CFLAGS) $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 \
[M1-Kali.patch.txt](https://github.com/devttys0/sasquatch/files/7776843/M1-Kali.patch.txt)

        -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"$(COMP_DEFAULT)\" \
 -      -Wall
-+      -Wall -Werror #-DSQUASHFS_TRACE
++      -Wall #-Werror #-DSQUASHFS_TRACE

  LIBS = -lpthread -lm
  ifeq ($(GZIP_SUPPORT),1)

@sevrb
Copy link
Author

sevrb commented Dec 28, 2021

Vfkvg

@bijoy26
Copy link

bijoy26 commented Jun 1, 2022

The solution by @chilik worked fine for my machine

@tchereau
Copy link

tchereau commented Apr 5, 2023

diff --git a/patches/patch0.txt b/patches/patch0.txt

for newby like who don't understand what to do with that :

cd patches
wget https://github.com/devttys0/sasquatch/files/7776843/M1-Kali.patch.txt
patch patch0.txt M1-Kali.patch.txt
cd ..
./build.sh

result : it's work :)

cc -g -O2 -fcommon  -I. -I./LZMA/lzma465/C -I./LZMA/lzmalt -I./LZMA/lzmadaptive/C/7zip/Compress/LZMA_Lib -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"gzip\" -Wall  -DGZIP_SUPPORT -DLZMA_SUPPORT -DXZ_SUPPORT -DLZO_SUPPORT -DXATTR_SUPPORT -DXATTR_DEFAULT   -c -o lzma_wrapper.o lzma_wrapper.c
g++   ./LZMA/lzmalt/*.o unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o compressor.o unsquashfs_info.o gzip_wrapper.o lzma_wrapper.o ./LZMA/lzma465/C/Alloc.o ./LZMA/lzma465/C/LzFind.o ./LZMA/lzma465/C/LzmaDec.o ./LZMA/lzma465/C/LzmaEnc.o ./LZMA/lzma465/C/LzmaLib.o xz_wrapper.o lzo_wrapper.o read_xattrs.o unsquashfs_xattr.o -lpthread -lm -lz -L./LZMA/lzmadaptive/C/7zip/Compress/LZMA_Lib -llzmalib  -llzma  -llzo2 -o sasquatch
mkdir -p /usr/local/bin
cp sasquatch /usr/local/bin

and the patch also work on regular x64 machin

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

No branches or pull requests

4 participants