0

Clean-up //third_party/lzma_sdk folder

As part of updating the lzma_sdk, clean up the folders and put them into different subfolders. This puts the files in a more similar
organization to the original lzma sdk. Fix up other files to have
correct includes.

Bug: 1334732
Change-Id: If345eee3ae1b81f1de804b289880ea5755def49f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3727278
Commit-Queue: Dong Sung Chang <donchan@microsoft.com>
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1020195}
This commit is contained in:
Michael Chang
2022-07-01 19:15:57 +00:00
committed by Chromium LUCI CQ
parent 80dce241fd
commit 3fa3690256
74 changed files with 71 additions and 68 deletions

@ -58,7 +58,7 @@ def GetLZMAExec(src_path):
Returns:
The executable command to run the 7zip compressor.
"""
return (os.path.join(src_path, r'third_party\lzma_sdk\7zr.exe')
return (os.path.join(src_path, r'third_party\lzma_sdk\bin\7zr.exe')
if sys.platform == 'win32' else '7zr')
def GetCmdLine(command, sz_fn, gcp_7z_fn):

@ -61,7 +61,7 @@ executable("gcp_sfx") {
deps = [
":setup_resources",
":version",
"//third_party/lzma_sdk/Util/SfxSetup:7zS2_source",
"//third_party/lzma_sdk/C/Util/SfxSetup:7zS2_source",
]
configs += [ "//build/config/win:windowed" ]
}

@ -317,7 +317,7 @@ if (!(is_component_build && is_debug && target_cpu == "x86") &&
"--out",
"$target_name.exe",
"--path_7za",
"../../third_party/lzma_sdk/Executable",
"../../third_party/lzma_sdk/bin",
]
deps = [
":mini_installer",

@ -59,7 +59,7 @@
namespace {
const wchar_t k7zaExe[] = L"7za.exe";
const wchar_t k7zaPathRelative[] = L"..\\..\\third_party\\lzma_sdk\\Executable";
const wchar_t k7zaPathRelative[] = L"..\\..\\third_party\\lzma_sdk\\bin";
const wchar_t kB7[] = L"B7";
const wchar_t kBl[] = L"BL";
const wchar_t kChromeBin[] = L"Chrome-bin";

@ -22,10 +22,10 @@
#include "third_party/abseil-cpp/absl/types/optional.h"
extern "C" {
#include "third_party/lzma_sdk/7z.h"
#include "third_party/lzma_sdk/7zAlloc.h"
#include "third_party/lzma_sdk/7zCrc.h"
#include "third_party/lzma_sdk/7zFile.h"
#include "third_party/lzma_sdk/C/7z.h"
#include "third_party/lzma_sdk/C/7zAlloc.h"
#include "third_party/lzma_sdk/C/7zCrc.h"
#include "third_party/lzma_sdk/C/7zFile.h"
}
namespace {

@ -13,9 +13,9 @@
#include <utility>
#include "base/bind.h"
#include "third_party/lzma_sdk/7zCrc.h"
#include "third_party/lzma_sdk/Xz.h"
#include "third_party/lzma_sdk/XzCrc64.h"
#include "third_party/lzma_sdk/C/7zCrc.h"
#include "third_party/lzma_sdk/C/Xz.h"
#include "third_party/lzma_sdk/C/XzCrc64.h"
namespace {

@ -173,7 +173,7 @@ def GenerateDiffPatch(options, orig_file, new_file, patch_file):
def GetLZMAExec(build_dir):
if sys.platform == 'win32':
lzma_exec = os.path.join(build_dir, "..", "..", "third_party",
"lzma_sdk", "Executable", "7za.exe")
"lzma_sdk", "bin", "7za.exe")
else:
lzma_exec = '7zr' # Use system 7zr.
return lzma_exec

@ -70,7 +70,7 @@ copy("signing") {
sources = [
"$root_out_dir/certificate_tag.exe",
"//chrome/tools/build/win/resedit.py",
"//third_party/lzma_sdk/7zr.exe",
"//third_party/lzma_sdk/bin/7zr.exe",
"signing/sign.py",
]

@ -88,7 +88,7 @@ def CopySectionFilesToStagingDir(config, section, staging_dir, src_dir,
def GetLZMAExec(build_dir):
if sys.platform == 'win32':
lzma_exec = os.path.join(build_dir, "..", "..", "third_party",
"lzma_sdk", "Executable", "7za.exe")
"lzma_sdk", "bin", "7za.exe")
else:
lzma_exec = '7zr' # Use system 7zr.
return lzma_exec

@ -28,7 +28,7 @@ std::array<uint32_t, 256> MakeCrc32Table() {
} // namespace
// Minimalistic CRC-32 implementation for Zucchini usage. Adapted from LZMA SDK
// (found at third_party/lzma_sdk/7zCrc.c), which is public domain.
// (found at third_party/lzma_sdk/C/7zCrc.c), which is public domain.
uint32_t CalculateCrc32(const uint8_t* first, const uint8_t* last) {
DCHECK_GE(last, first);

@ -11,7 +11,7 @@
# include "zlib.h"
#else
extern "C" {
# include "third_party/lzma_sdk/7zCrc.h"
#include "third_party/lzma_sdk/C/7zCrc.h"
}
#endif

@ -10,7 +10,10 @@ use_arm_neon_optimizations = (target_cpu == "arm" || target_cpu == "arm64") &&
arm_use_neon && !(is_win && !is_clang)
config("lzma_sdk_config") {
include_dirs = [ "." ]
include_dirs = [
".",
"./C",
]
}
# Must be in a config for -Wno-self-assign because of how GN orders flags
@ -55,46 +58,46 @@ config("lzma_build_config") {
static_library("lzma_sdk") {
sources = [
"7z.h",
"7zAlloc.c",
"7zAlloc.h",
"7zArcIn.c",
"7zBuf.c",
"7zBuf.h",
"7zCrc.c",
"7zCrc.h",
"7zCrcOpt.c",
"7zDec.c",
"7zFile.c",
"7zFile.h",
"7zStream.c",
"7zTypes.h",
"Alloc.c",
"Alloc.h",
"Bcj2.c",
"Bcj2.h",
"Bra.c",
"Bra.h",
"Bra86.c",
"Compiler.h",
"CpuArch.c",
"CpuArch.h",
"Delta.c",
"Delta.h",
"DllSecur.c",
"DllSecur.h",
"LzFind.c",
"LzFind.h",
"LzHash.h",
"Lzma2Dec.c",
"Lzma2Dec.h",
"LzmaDec.c",
"LzmaDec.h",
"LzmaEnc.c",
"LzmaEnc.h",
"LzmaLib.c",
"LzmaLib.h",
"Precomp.h",
"C/7z.h",
"C/7zAlloc.c",
"C/7zAlloc.h",
"C/7zArcIn.c",
"C/7zBuf.c",
"C/7zBuf.h",
"C/7zCrc.c",
"C/7zCrc.h",
"C/7zCrcOpt.c",
"C/7zDec.c",
"C/7zFile.c",
"C/7zFile.h",
"C/7zStream.c",
"C/7zTypes.h",
"C/Alloc.c",
"C/Alloc.h",
"C/Bcj2.c",
"C/Bcj2.h",
"C/Bra.c",
"C/Bra.h",
"C/Bra86.c",
"C/Compiler.h",
"C/CpuArch.c",
"C/CpuArch.h",
"C/Delta.c",
"C/Delta.h",
"C/DllSecur.c",
"C/DllSecur.h",
"C/LzFind.c",
"C/LzFind.h",
"C/LzHash.h",
"C/Lzma2Dec.c",
"C/Lzma2Dec.h",
"C/LzmaDec.c",
"C/LzmaDec.h",
"C/LzmaEnc.c",
"C/LzmaEnc.h",
"C/LzmaLib.c",
"C/LzmaLib.h",
"C/Precomp.h",
]
configs -= [ "//build/config/compiler:chromium_code" ]
@ -109,21 +112,21 @@ static_library("lzma_sdk") {
static_library("lzma_sdk_xz") {
sources = [
"BraIA64.c",
"RotateDefs.h",
"Sha256.c",
"Sha256.h",
"Xz.c",
"Xz.h",
"XzCrc64.c",
"XzCrc64.h",
"XzCrc64Opt.c",
"XzDec.c",
"C/BraIA64.c",
"C/RotateDefs.h",
"C/Sha256.c",
"C/Sha256.h",
"C/Xz.c",
"C/Xz.h",
"C/XzCrc64.c",
"C/XzCrc64.h",
"C/XzCrc64Opt.c",
"C/XzDec.c",
]
# TODO(crbug.com/1338627): Enable ARM optimizations
if (target_cpu == "x86" || target_cpu == "x64") {
sources += [ "Sha256Opt.c" ]
sources += [ "C/Sha256Opt.c" ]
}
deps = [ ":lzma_sdk" ]

Before

(image error) Size: 1.1 KiB

After

(image error) Size: 1.1 KiB