You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The errors that @freman posted are specifically from xz_wrapper.c, which the sasquatch patches don't touch. However, by default, xz_wrapper.c is never used by squashfs-tools, since it is commented out in the Makefile. The sasqatch patches do enable XZ support in the Makefile.
The specific errors seem to suggest that there are some things from the lzma library that xz_wrapper.c expects, but are not defined. This sounds like an issue with your installed lzma library, but to make sure, try downloading the unpatched squashfs-tools, edit the Makefile to comment out the XZ_SUPPORT = 1 line, and try to build:
# | #
# XZ Utils liblzma (http://tukaani.org/xz/) is supported | # XZ Utils liblzma (http://tukaani.org/xz/) is supported
# | #
# To build using XZ Utils liblzma - install the library and | # To build using XZ Utils liblzma - install the library and
# the XZ_SUPPORT line below. | # the XZ_SUPPORT line below.
# | #
XZ_SUPPORT = 1
If you get the same errors, then the problem is with your lzma library, not with the patches. If it builds fine, then it's probably an issue with the Makefile patches.
I follow the instructions by @devttys0. Took me a while to catch on that no matter how many times I modified the Makefile, it was constantly overwritten by the build.sh as squashfs4.3.tar.gz gets downloaded and uncompressed by running the script. So I commented the following lines in the build.sh script and forced the patches :
# Remove any previous squashfs4.3 directory to ensure a clean patch/build
#rm -rf squashfs4.3
# Extract squashfs4.3.tar.gz
#tar -zxvf squashfs4.3.tar.gz
# Patch, build, and install the source
cd squashfs4.3
patch -f -p0 < ../patches/patch0.txt
While this solved the first issue, it created another one:
cc -g -O2 -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 -Werror -DGZIP_SUPPORT -DLZMA_SUPPORT -DXZ_SUPPORT -DLZO_SUPPORT -DXATTR_SUPPORT -DXATTR_DEFAULT -c -o unsquashfs.o unsquashfs.c
In file included from unsquashfs.h:58:0,
from unsquashfs.c:26:
squashfs_fs.h:525:8: error: redefinition of ‘struct lzma_override_property’
struct lzma_override_property
^~~~~~~~~~~~~~~~~~~~~~
squashfs_fs.h:508:8: note: originally defined here
struct lzma_override_property
^~~~~~~~~~~~~~~~~~~~~~
squashfs_fs.h:530:8: error: redefinition of ‘struct override_table’
struct override_table
^~~~~~~~~~~~~~
squashfs_fs.h:513:8: note: originally defined here
struct override_table
^~~~~~~~~~~~~~
unsquashfs.c: In function ‘check_compression’:
unsquashfs.c:1783:6: error: expected expression before ‘/’ token
*/
^
<builtin>: recipe for target 'unsquashfs.o' failed
make: *** [unsquashfs.o] Error 1
From there, I had to commented the redefinitions in squashfs_fs.h and got rid of the lonely end-comment tag in unsquashfs.c.
Then you get the following:
In file included from unsquashfs.c:28:0:
unsquashfs.c: In function ‘check_compression’:
unsquashfs.c:1787:45: error: ‘sBlk_3’ undeclared (first use in this function)
SQUASHFS_SWAP_SUPER_BLOCK_3(&sblk, &sBlk_3);
Commented out the lines from 1786 to 1789 as I cannot find where &sBlk_3 in the entire file.
I was redirected to this issue when looking for the similar issue on Cygwin instead:
gcc version 6.4.0 (GCC)
COLLECT_GCC_OPTIONS='-g' '-O2' '-v' '-Wno-error=unused-variable' '-D' 'linux' '-D' 'FNM_EXTMATCH=(1<<5)' '-D' 'sigtimedwait(a,b,c)=sigwaitinfo(a,b)' '-D' 'GZIP_SUPPORT' '-D' 'LZMA_SUPPORT' '-D' 'XZ_SUPPORT' '-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' '-D' 'COMP_DEFAULT="gzip"' '-Wall' '-Werror' '-D' 'GZIP_SUPPORT' '-D' 'LZMA_SUPPORT' '-D' 'XZ_SUPPORT' '-D' 'LZO_SUPPORT' '-D' 'XATTR_SUPPORT' '-D' 'XATTR_DEFAULT' '-c' '-o' 'xz_wrapper.o' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/cc1.exe -quiet -v -I . -I ./LZMA/lzma465/C -I ./LZMA/lzmalt -I ./LZMA/lzmadaptive/C/7zip/Compress/LZMA_Lib -Dunix -idirafter /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../lib/../include/w32api -idirafter /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/lib/../lib/../../include/w32api -D linux -D FNM_EXTMATCH=(1<<5) -D sigtimedwait(a,b,c)=sigwaitinfo(a,b) -D GZIP_SUPPORT -D LZMA_SUPPORT -D XZ_SUPPORT -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -D _GNU_SOURCE -D COMP_DEFAULT="gzip" -D GZIP_SUPPORT -D LZMA_SUPPORT -D XZ_SUPPORT -D LZO_SUPPORT -D XATTR_SUPPORT -D XATTR_DEFAULT xz_wrapper.c -quiet -dumpbase xz_wrapper.c -mtune=generic -march=x86-64 -auxbase-strip xz_wrapper.o -g -O2 -Wno-error=unused-variable -Wall -Werror -version -o /tmp/ccnpSBxp.s
GNU C11 (GCC) version 6.4.0 (x86_64-pc-cygwin)
compiled by GNU C version 6.4.0, GMP version 6.1.2, MPFR version 3.1.6-p1, MPC version 1.0.3, isl version 0.15
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/include"
ignoring duplicate directory "/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/lib/../lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
.
./LZMA/lzma465/C
./LZMA/lzmalt
./LZMA/lzmadaptive/C/7zip/Compress/LZMA_Lib
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include
/usr/include
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../lib/../include/w32api
End of search list.
GNU C11 (GCC) version 6.4.0 (x86_64-pc-cygwin)
compiled by GNU C version 6.4.0, GMP version 6.1.2, MPFR version 3.1.6-p1, MPC version 1.0.3, isl version 0.15
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 2d3d11644c64278db33cf4cc4625e9ee
In file included from xz_wrapper.c:31:0:
xz_wrapper.h:51:2: error: unknown type name ‘lzma_vli’
lzma_vli id;
^~~~~~~~
xz_wrapper.h:57:2: error: unknown type name ‘lzma_filter’
lzma_filter filter[3];
^~~~~~~~~~~
xz_wrapper.h:65:2: error: unknown type name ‘lzma_options_lzma’
lzma_options_lzma opt;
^~~~~~~~~~~~~~~~~
xz_wrapper.c:35:11: error: ‘LZMA_FILTER_X86’ undeclared here (not in a function)
{ "x86", LZMA_FILTER_X86, 0 },
It appears that lzma.h header file cannot be located properly because of the same lzma.h header file defined in ./LZMA directory, realized that after some trial and error steps:
Activity
swynter-ladbrokes commentedon Oct 6, 2015
Ok, so further testing, doesn't compile on ubuntu, but does on debian:jessie, all good
Zibri commentedon Aug 23, 2016
same on windows.. cygwin... normal squashfs compiles... with your patches it doesn't...
errors starts at unknown type name ‘lzma_vli’...
devttys0 commentedon Aug 25, 2016
Please provide more information, as it builds fine here (Ubuntu 14.04 32 bit, gcc v4.8.4):
0xling commentedon Sep 26, 2016
I also has this question in ubuntu 14.04 64bit, gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
devttys0 commentedon Sep 26, 2016
The errors that @freman posted are specifically from
xz_wrapper.c, which the sasquatch patches don't touch. However, by default,xz_wrapper.cis never used by squashfs-tools, since it is commented out in theMakefile. The sasqatch patches do enable XZ support in theMakefile.The specific errors seem to suggest that there are some things from the lzma library that
xz_wrapper.cexpects, but are not defined. This sounds like an issue with your installed lzma library, but to make sure, try downloading the unpatched squashfs-tools, edit theMakefileto comment out theXZ_SUPPORT = 1line, and try to build:If you get the same errors, then the problem is with your lzma library, not with the patches. If it builds fine, then it's probably an issue with the
Makefilepatches.InfectedPacket commentedon Nov 15, 2016
So I had the same issue as the op:
Here's what I tried:
I follow the instructions by @devttys0. Took me a while to catch on that no matter how many times I modified the Makefile, it was constantly overwritten by the build.sh as squashfs4.3.tar.gz gets downloaded and uncompressed by running the script. So I commented the following lines in the build.sh script and forced the patches :
While this solved the first issue, it created another one:
From there, I had to commented the redefinitions in squashfs_fs.h and got rid of the lonely end-comment tag in unsquashfs.c.
Then you get the following:
Commented out the lines from 1786 to 1789 as I cannot find where
&sBlk_3in the entire file.Next:
At this point, I gave up for now. No issue compiling squashfs without the patches.
x9090 commentedon Aug 7, 2018
I was redirected to this issue when looking for the similar issue on Cygwin instead:
It appears that lzma.h header file cannot be located properly because of the same lzma.h header file defined in ./LZMA directory, realized that after some trial and error steps:
I solved this by renaming the collided LZMA.h to LZMA2.h and renamed the source files that reference to this header file:
Recompile and it works like a charm:
E3V3A commentedon Oct 17, 2018
@x9090
It's not clear what you replaced.
What exactly did you rename?
What about the C files?
I get:
E3V3A commentedon Oct 17, 2018
Following @x9090 hints, I had to rename all the "LZMA.h" files differently.
From
./sasquatch/squashfs4.3/squashfs-toolsI did:ALL GOOD!! 🥇
docfate111 commentedon May 6, 2021
In docker for debian jessie and ubuntu latest build.sh doesnt work
chore(deps): improve LZMA dependencies resolution during pre-processing.
chore(deps): improve LZMA dependencies resolution during pre-processing.
chore(deps): improve LZMA dependencies resolution during pre-processing.
chore(deps): improve LZMA dependencies resolution during pre-processing.
chore(deps): improve LZMA dependencies resolution during pre-processing.
chore(deps): improve LZMA dependencies resolution during pre-processing.
chore(deps): improve LZMA dependencies resolution during pre-processing.
chore(deps): improve LZMA dependencies resolution during pre-processing.
chore(deps): improve LZMA dependencies resolution during pre-processing.