]> git.ipfire.org Git - thirdparty/libarchive.git/commit
7zip reader: add SPARC filter support for non-LZMA compressors (#2399)
authorMostyn Bramley-Moore <mostyn@antipode.se>
Tue, 29 Oct 2024 02:29:23 +0000 (03:29 +0100)
committerGitHub <noreply@github.com>
Tue, 29 Oct 2024 02:29:23 +0000 (19:29 -0700)
commit974b59113d595c1b7babcfbc1f16341e49400aad
tree47bafe00945f47ba09c82a81f93467977d6a80fd
parente36d6fe935f7c96f4af649eae86fbba8e56e654a
7zip reader: add SPARC filter support for non-LZMA compressors (#2399)

These two new test archives contain a C hello world executable built
like so on a ubuntu 24.04 machine:

```
#include <stdio.h>

int main(int argc, char *argv[]) {
  printf("hello, world\n");
  return 0;
}
```

`sparc64-linux-gnu-gcc hw.c -o hw-sparc64 -Wall`

The two test archives that contain this executable were created like so,
using the https://github.com/tehmul/p7zip-zstd fork of 7-Zip:
`7z a -t7z -m0=zstd -mf=SPARC
libarchive/test/test_read_format_7zip_zstd_sparc.7z hw-sparc64`
`7z a -t7z -m0=lzma2 -mf=SPARC
libarchive/test/test_read_format_7zip_lzma2_sparc.7z hw-sparc64`

Two test files are required, because the 7zip reader code has two
different paths, one for lzma and one for all other compressors.

The test_read_format_7zip_lzma2_sparc test is expected to pass, because
LZMA BCJ filters are implemented in liblzma.

The test_read_format_7zip_zstd_sparc test is expected to fail in the
first commit, because libarchive does not currently implement the SPARC
BCJ filter. The second commit will make test_read_format_7zip_zstd_sparc
pass.
Makefile.am
libarchive/archive_read_support_format_7zip.c
libarchive/test/test_read_format_7zip.c
libarchive/test/test_read_format_7zip_lzma2_sparc.7z.uu [new file with mode: 0644]
libarchive/test/test_read_format_7zip_zstd_sparc.7z.uu [new file with mode: 0644]