tools/squashfskit4: fix compilation under big endian
authorRosen Penev <rosenp@gmail.com>
Sun, 20 Jun 2021 02:31:35 +0000 (21:31 -0500)
committerPaul Spooren <mail@aparcar.org>
Mon, 21 Jun 2021 04:59:36 +0000 (18:59 -1000)
The macro used is for the wrong struct. Just byte swap manually.

Refreshed patches.

Tested on sparc64.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
tools/squashfskit4/Makefile
tools/squashfskit4/patches/0002-fix-build-failure-against-gcc-10.patch
tools/squashfskit4/patches/0020-big-endian.patch [new file with mode: 0644]

index 9ed10ecef93bf93dc8ff9e31193b82744b168d59..1800306d33661b493b46abd07ceedb03bf141dca 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=squashfskit4
 PKG_VERSION:=4.14
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_SOURCE:=squashfskit-v$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://github.com/squashfskit/squashfskit/releases/download/v$(PKG_VERSION)/
 PKG_HASH:=5761aaa3aedc4f7112b708367d891c9abdc1ffea972e3fe47923ddba23984d95
index 46c6a5ea0fcac785110c1289fde2f43c7d55cb5b..de772999780f8f6d809bd157089e1d01be18ecef 100644 (file)
@@ -28,16 +28,14 @@ Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  squashfs-tools/mksquashfs.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h
-index 1beefef7..b6503063 100644
 --- a/squashfs-tools/mksquashfs.h
 +++ b/squashfs-tools/mksquashfs.h
-@@ -143,7 +143,7 @@ struct append_file {
- #endif
+@@ -133,7 +133,7 @@ struct append_file {
+ #define BLOCK_OFFSET 2
  
  extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
 -struct cache *bwriter_buffer, *fwriter_buffer;
 +extern struct cache *bwriter_buffer, *fwriter_buffer;
  extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
-       *to_frag, *locked_fragment, *to_process_frag;
+              *locked_fragment, *to_process_frag;
  extern struct append_file **file_mapping;
diff --git a/tools/squashfskit4/patches/0020-big-endian.patch b/tools/squashfskit4/patches/0020-big-endian.patch
new file mode 100644 (file)
index 0000000..b388cb4
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/squashfs-tools/xz_wrapper.c
++++ b/squashfs-tools/xz_wrapper.c
+@@ -192,7 +192,10 @@ static void xz_display_options(void *buf
+       if(size != sizeof(struct comp_opts))
+               goto failed;
+-      SQUASHFS_INSWAP_LZMA_COMP_OPTS(comp_opts);
++#if __BYTE_ORDER == __BIG_ENDIAN
++      comp_opts->dictionary_size = inswap_le32(comp_opts->dictionary_size);
++      comp_opts->flags = inswap_le32(comp_opts->flags);
++#endif
+       dictionary_size = comp_opts->dictionary_size;
+       flags = comp_opts->flags;