chromium/third_party/lzma_sdk/README.chromium

Name: LZMA SDK
Short Name: lzma
URL: http://www.7-zip.org/sdk.html
Version: 22.01
Date: 2022-07-15
License: Public Domain
License File: LICENSE
Security Critical: yes
Shipped: yes
CPEPrefix: cpe:2.3:a:7-zip:7-zip:22.01:*:*:*:*:*:*:*

Description:
This contains a part of LZMA SDK 22.01.

Local Modifications:
The original code can be found at https://7-zip.org/a/lzma2201.7z.  Only parts
of this archive are copied here.  More specifically:

1/ C code required to open 7z archive files and uncompress LZMA
2/ 7za, 7zr, and 7zz executables, if Windows is specified as a target OS.
3/ source code for SfxSetup, a utility for creating self extracting archives
4/ C code required for xz decompression (split into its own static library)

The 7z binaries are installed via a 3pp CIPD package into bin/ if Windows is
specified as a target OS in the .gclient file. There are two subdirectories in
bin/: win64/ and host_platform/. win64/ contains 64-bit Windows binaries to be
packaged in Chromium targets requiring it, and host_platform/ contains binaries
for the platform of the host where the Chromium source code is checked out and
built. host_platform/ binaries should be used for build scripts that call 7z
binaries. Supported platforms are:

* linux-amd64
* mac-amd64
* mac-rm64
* windows-386
* windows-amd64

7za.exe and 7zr.exe are both standalone command-line utilities to archive and
extract files. 7zr is "lightweight" and only handles 7zip extensions. 7za can
handle a few more.

The patch in chromium.patch was applied to 7zCrc.c, CpuArch.c, LZFind.c and
Sha256.c to disable some ARM code that was failing to build in Android and
Fuschia as well as some of the AVX2 and SSE4 code for Windows. In Fuschia,
`#include <asm/hwcap.h>` is not available. In Android builds, `armv8-a+crc` is
not a known target architecture, even when the -march cflag is passed,
specifying the CPU type to use. In Windows, Chromium still supports SSE3,
so it is not be ready to transition to utilizing AVX2 and SSE4, yet. Added
.note.gnu.property section to arm64/7zAsm.s to suppress compiler error requiring
bti. Shortened segment names in Asm/x86/*.asm files to make the builds
deterministic. Resolved include paths as well.

The patch in chromium_ubsan.patch fixes some undefined behavior, flagged by
UBSan, caused by invalid pointer casts in LZMA SDK.

The patch in Util/SfxSetup/chromium.patch was applied so that:

1/ Fix for includes file names, since the original code causes an include
   file violation during git cl presubmit.
2/ Extended search range for 7z archive signature to accomodate
   increased sfx binary size in debug builds.