mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-01-31 01:15:24 +01:00
Compare commits
182 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37555e3048 | ||
|
|
d8f18a3318 | ||
|
|
47a732d0fe | ||
|
|
4eae1b7127 | ||
|
|
a71ea9917a | ||
|
|
500e2c43b1 | ||
|
|
e6a4cee86c | ||
|
|
5a94f6819d | ||
|
|
132e3e507d | ||
|
|
ffa06fbb09 | ||
|
|
028e6cd8a8 | ||
|
|
719063e996 | ||
|
|
5d40f36fa8 | ||
|
|
31ffcfc920 | ||
|
|
c9642b70f6 | ||
|
|
849fa57bf6 | ||
|
|
2c95ef76f1 | ||
|
|
4d9cb885b2 | ||
|
|
e375f98f7a | ||
|
|
1b80f3aea2 | ||
|
|
b0496645f1 | ||
|
|
235cb13647 | ||
|
|
504dd9f513 | ||
|
|
e3fedf1676 | ||
|
|
f113a51783 | ||
|
|
f69d5835b8 | ||
|
|
8e8277c0c9 | ||
|
|
c6c4eaf31c | ||
|
|
6324722b65 | ||
|
|
efd8c9ec69 | ||
|
|
9858aa1aa5 | ||
|
|
256a946f96 | ||
|
|
a507964f33 | ||
|
|
7584a6bb29 | ||
|
|
ce6103be30 | ||
|
|
9da4459ab3 | ||
|
|
3b9b9a84cd | ||
|
|
cce0ae4369 | ||
|
|
efb43ac7f9 | ||
|
|
8132a8a7f8 | ||
|
|
9c753cb692 | ||
|
|
514e6675c4 | ||
|
|
18454fd5d0 | ||
|
|
eeb919325e | ||
|
|
959be142ed | ||
|
|
42be91d48d | ||
|
|
908f916656 | ||
|
|
5441c7ed59 | ||
|
|
bea471a0e3 | ||
|
|
4dafee17e0 | ||
|
|
af10be9036 | ||
|
|
1a4e3ab581 | ||
|
|
d9e9cf8967 | ||
|
|
041b0cb561 | ||
|
|
4ad5dde780 | ||
|
|
0bc043a0bb | ||
|
|
c936b7db29 | ||
|
|
2793c49694 | ||
|
|
c578859122 | ||
|
|
43e6f06a9e | ||
|
|
cf8e9f773e | ||
|
|
ed3bdc61f4 | ||
|
|
e57f7d92c3 | ||
|
|
b95eb5cd74 | ||
|
|
b865bbb0d3 | ||
|
|
ca6e1c9a46 | ||
|
|
ea8a2deae6 | ||
|
|
c67237672c | ||
|
|
2d5faa627f | ||
|
|
1562ba4ca0 | ||
|
|
a5d94ac454 | ||
|
|
943fbd8719 | ||
|
|
eea1d57e7e | ||
|
|
74645aa1b7 | ||
|
|
dfd23d9a25 | ||
|
|
27cf16a09c | ||
|
|
0dee9e3ff1 | ||
|
|
9b47dc0ee3 | ||
|
|
c7b9ee92b7 | ||
|
|
ac32e6ca92 | ||
|
|
0c204c3ebb | ||
|
|
016b871734 | ||
|
|
22413b8e7f | ||
|
|
1b50057764 | ||
|
|
9e15058634 | ||
|
|
2a81a7af9e | ||
|
|
6d3d5ebdc5 | ||
|
|
7d63a9e51c | ||
|
|
56a2b3b5ad | ||
|
|
f46f788d80 | ||
|
|
a044b7cf6e | ||
|
|
8afd29e1a2 | ||
|
|
d89b051e6d | ||
|
|
47cf69d2b3 | ||
|
|
35c3c912e7 | ||
|
|
67c5f0229b | ||
|
|
5dcc79555d | ||
|
|
82f741e1dc | ||
|
|
ab21d22514 | ||
|
|
0a599e7337 | ||
|
|
f77bf1ec6b | ||
|
|
ed4fbb4f5a | ||
|
|
f963291970 | ||
|
|
2c3abe33d5 | ||
|
|
0fd7e1d7c2 | ||
|
|
1e23e7efc4 | ||
|
|
46d5d24fcd | ||
|
|
3276c0db9c | ||
|
|
1bdd53a6c5 | ||
|
|
1f2d9ab4e5 | ||
|
|
0806ca442a | ||
|
|
e3a666bfe4 | ||
|
|
6b2dc7a68c | ||
|
|
18c492d9da | ||
|
|
6065caaf19 | ||
|
|
bb4c456f35 | ||
|
|
078a10dcdb | ||
|
|
a8a0c5c0bf | ||
|
|
1a95bd3088 | ||
|
|
cf157fd2d7 | ||
|
|
35ada362d4 | ||
|
|
444b110411 | ||
|
|
1b82fac70e | ||
|
|
dafca1e264 | ||
|
|
69de95df8b | ||
|
|
ca9f64a08b | ||
|
|
3b3e35beb7 | ||
|
|
c087fc430b | ||
|
|
d1a4733939 | ||
|
|
5845109b75 | ||
|
|
7dd2ebdf49 | ||
|
|
3e78322ea4 | ||
|
|
8d6633fcf9 | ||
|
|
1c1f67c091 | ||
|
|
324b1464e4 | ||
|
|
1e9a248a0c | ||
|
|
4319094b02 | ||
|
|
60abebb3a5 | ||
|
|
62f20a4809 | ||
|
|
924326460c | ||
|
|
bba85dc08f | ||
|
|
68678ac4ec | ||
|
|
7f9f383324 | ||
|
|
1239c94fba | ||
|
|
2ab24bbf28 | ||
|
|
a304959933 | ||
|
|
5f0bc729d7 | ||
|
|
e2421bf3c6 | ||
|
|
9b4b21887f | ||
|
|
cc9eaef477 | ||
|
|
c1eecb3512 | ||
|
|
58a26dbca4 | ||
|
|
d06700276f | ||
|
|
ab5b622d70 | ||
|
|
60e21e2530 | ||
|
|
a694c1bd26 | ||
|
|
84d16802a3 | ||
|
|
02fda478ea | ||
|
|
31dcda05b7 | ||
|
|
5479ab1b8a | ||
|
|
cc9c0f9b12 | ||
|
|
aa5a94df5a | ||
|
|
d9b7f413ff | ||
|
|
6c3cf12df6 | ||
|
|
13e0546f56 | ||
|
|
c01dc20284 | ||
|
|
3faf22256e | ||
|
|
ac4d827a9c | ||
|
|
95201409e3 | ||
|
|
89cd474278 | ||
|
|
fc715d58f0 | ||
|
|
217e1c8fae | ||
|
|
5486eed151 | ||
|
|
d1721360ff | ||
|
|
0a0f99dd1b | ||
|
|
eb5ea6f64e | ||
|
|
1d449e9675 | ||
|
|
c82671fce4 | ||
|
|
4c267c4206 | ||
|
|
158e67cf6d | ||
|
|
1afff1a064 | ||
|
|
904874d959 |
2
.github/workflows/cron_publish_flatpak.yml
vendored
2
.github/workflows/cron_publish_flatpak.yml
vendored
@@ -43,7 +43,7 @@ jobs:
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
publish: true
|
||||
branch: stable
|
||||
fetchTags: true
|
||||
stableBuild: false
|
||||
secrets: inherit
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
title: "Qt: Update Base Translation"
|
||||
commit-message: "Qt: Update Base Translation"
|
||||
commit-message: "[ci skip] Qt: Update Base Translation."
|
||||
committer: "PCSX2 Bot <PCSX2Bot@users.noreply.github.com>"
|
||||
author: "PCSX2 Bot <PCSX2Bot@users.noreply.github.com>"
|
||||
body: "Daily update of base translation sources."
|
||||
|
||||
35
.github/workflows/linux_build_flatpak.yml
vendored
35
.github/workflows/linux_build_flatpak.yml
vendored
@@ -23,10 +23,6 @@ on:
|
||||
cmakeflags:
|
||||
required: true
|
||||
type: string
|
||||
branch:
|
||||
required: false
|
||||
type: string
|
||||
default: "stable"
|
||||
publish:
|
||||
required: false
|
||||
type: boolean
|
||||
@@ -98,7 +94,8 @@ jobs:
|
||||
run: |
|
||||
flatpak-builder-lint manifest .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.json
|
||||
|
||||
- name: Build Flatpak
|
||||
- name: Build Flatpak (beta)
|
||||
if: ${{ inputs.stableBuild == false || inputs.stableBuild == 'false' }}
|
||||
uses: flathub-infra/flatpak-github-actions/flatpak-builder@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
|
||||
with:
|
||||
bundle: ${{ steps.artifact-metadata.outputs.artifact-name }}.flatpak
|
||||
@@ -108,17 +105,33 @@ jobs:
|
||||
build-bundle: true
|
||||
verbose: true
|
||||
mirror-screenshots-url: https://dl.flathub.org/media
|
||||
branch: ${{ inputs.branch }}
|
||||
branch: beta
|
||||
cache: true
|
||||
restore-cache: true
|
||||
cache-key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} flatpak ${{ hashFiles('.github/workflows/scripts/linux/flatpak/**/*.json', '.github/workflows/scripts/common/*.patch') }}
|
||||
|
||||
- name: Build Flatpak (stable)
|
||||
if: ${{ inputs.stableBuild == true || inputs.stableBuild == 'true' }}
|
||||
uses: flathub-infra/flatpak-github-actions/flatpak-builder@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
|
||||
with:
|
||||
bundle: ${{ steps.artifact-metadata.outputs.artifact-name }}.flatpak
|
||||
upload-artifact: false
|
||||
manifest-path: .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.json
|
||||
arch: x86_64
|
||||
build-bundle: true
|
||||
verbose: true
|
||||
mirror-screenshots-url: https://dl.flathub.org/media
|
||||
branch: stable
|
||||
cache: true
|
||||
restore-cache: true
|
||||
cache-key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} flatpak ${{ hashFiles('.github/workflows/scripts/linux/flatpak/**/*.json') }}
|
||||
|
||||
|
||||
#- name: Validate build
|
||||
# run: |
|
||||
# flatpak-builder-lint repo repo
|
||||
|
||||
- name: Push to Flathub beta
|
||||
if: inputs.publish == true && inputs.branch == 'beta'
|
||||
- name: Push to Flathub (beta)
|
||||
if: ${{ inputs.publish == true && (inputs.stableBuild == false || inputs.stableBuild == 'false') }}
|
||||
uses: flathub-infra/flatpak-github-actions/flat-manager@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
|
||||
with:
|
||||
flat-manager-url: https://hub.flathub.org/
|
||||
@@ -126,8 +139,8 @@ jobs:
|
||||
token: ${{ secrets.FLATHUB_BETA_TOKEN }}
|
||||
build-log-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
|
||||
- name: Push to Flathub stable
|
||||
if: inputs.publish == true && inputs.branch == 'stable'
|
||||
- name: Push to Flathub (stable)
|
||||
if: ${{ inputs.publish == true && (inputs.stableBuild == true || inputs.stableBuild == 'true') }}
|
||||
uses: flathub-infra/flatpak-github-actions/flat-manager@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
|
||||
with:
|
||||
flat-manager-url: https://hub.flathub.org/
|
||||
|
||||
2
.github/workflows/linux_build_qt.yml
vendored
2
.github/workflows/linux_build_qt.yml
vendored
@@ -117,7 +117,7 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/deps
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/linux/build-dependencies-qt.sh') }}
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/linux/build-dependencies-qt.sh', '.github/workflows/scripts/common/*.patch') }}
|
||||
|
||||
- name: Build Dependencies
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
|
||||
2
.github/workflows/macos_build.yml
vendored
2
.github/workflows/macos_build.yml
vendored
@@ -85,7 +85,7 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/deps
|
||||
key: ${{ inputs.os }} deps ${{ hashFiles('.github/workflows/scripts/macos/build-dependencies.sh') }}
|
||||
key: ${{ inputs.os }} deps ${{ hashFiles('.github/workflows/scripts/macos/build-dependencies.sh', '.github/workflows/scripts/common/*.patch') }}
|
||||
|
||||
- name: Build Dependencies
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
|
||||
1
.github/workflows/release_cut_new.yml
vendored
1
.github/workflows/release_cut_new.yml
vendored
@@ -114,7 +114,6 @@ jobs:
|
||||
artifactPrefixName: "PCSX2-linux-Qt-x64-flatpak"
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
branch: "stable"
|
||||
publish: false
|
||||
fetchTags: true
|
||||
stableBuild: ${{ github.event_name == 'workflow_dispatch' && inputs.is_prelease == 'false' }}
|
||||
|
||||
@@ -114,6 +114,15 @@ diff --git a/libshaderc/include/shaderc/shaderc.h b/libshaderc/include/shaderc/s
|
||||
index 3a3e97d..65d5b77 100644
|
||||
--- a/libshaderc/include/shaderc/shaderc.h
|
||||
+++ b/libshaderc/include/shaderc/shaderc.h
|
||||
@@ -15,6 +15,8 @@
|
||||
#ifndef SHADERC_SHADERC_H_
|
||||
#define SHADERC_SHADERC_H_
|
||||
|
||||
+#define SHADERC_PCSX2_CUSTOM 1
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -317,7 +317,7 @@ SHADERC_EXPORT void shaderc_compile_options_set_source_language(
|
||||
|
||||
// Sets the compiler mode to generate debug information in the output.
|
||||
@@ -123,69 +132,6 @@ index 3a3e97d..65d5b77 100644
|
||||
|
||||
// Sets the compiler optimization level to the given level. Only the last one
|
||||
// takes effect if multiple calls of this function exist.
|
||||
@@ -506,6 +506,10 @@ SHADERC_EXPORT void shaderc_compile_options_set_invert_y(
|
||||
SHADERC_EXPORT void shaderc_compile_options_set_nan_clamp(
|
||||
shaderc_compile_options_t options, bool enable);
|
||||
|
||||
+// Returns a string representation of the specified compilation status.
|
||||
+SHADERC_EXPORT const char* shaderc_compilation_status_to_string(
|
||||
+ shaderc_compilation_status status);
|
||||
+
|
||||
// An opaque handle to the results of a call to any shaderc_compile_into_*()
|
||||
// function.
|
||||
typedef struct shaderc_compilation_result* shaderc_compilation_result_t;
|
||||
@@ -529,28 +533,31 @@ typedef struct shaderc_compilation_result* shaderc_compilation_result_t;
|
||||
// present. May be safely called from multiple threads without explicit
|
||||
// synchronization. If there was failure in allocating the compiler object,
|
||||
// null will be returned.
|
||||
-SHADERC_EXPORT shaderc_compilation_result_t shaderc_compile_into_spv(
|
||||
+SHADERC_EXPORT shaderc_compilation_status shaderc_compile_into_spv(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options);
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result);
|
||||
|
||||
// Like shaderc_compile_into_spv, but the result contains SPIR-V assembly text
|
||||
// instead of a SPIR-V binary module. The SPIR-V assembly syntax is as defined
|
||||
// by the SPIRV-Tools open source project.
|
||||
-SHADERC_EXPORT shaderc_compilation_result_t shaderc_compile_into_spv_assembly(
|
||||
+SHADERC_EXPORT shaderc_compilation_status shaderc_compile_into_spv_assembly(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options);
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result);
|
||||
|
||||
// Like shaderc_compile_into_spv, but the result contains preprocessed source
|
||||
// code instead of a SPIR-V binary module
|
||||
-SHADERC_EXPORT shaderc_compilation_result_t shaderc_compile_into_preprocessed_text(
|
||||
+SHADERC_EXPORT shaderc_compilation_status shaderc_compile_into_preprocessed_text(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options);
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result);
|
||||
|
||||
// Takes an assembly string of the format defined in the SPIRV-Tools project
|
||||
// (https://github.com/KhronosGroup/SPIRV-Tools/blob/master/syntax.md),
|
||||
@@ -561,10 +568,11 @@ SHADERC_EXPORT shaderc_compilation_result_t shaderc_compile_into_preprocessed_te
|
||||
// May be safely called from multiple threads without explicit synchronization.
|
||||
// If there was failure in allocating the compiler object, null will be
|
||||
// returned.
|
||||
-SHADERC_EXPORT shaderc_compilation_result_t shaderc_assemble_into_spv(
|
||||
+SHADERC_EXPORT shaderc_compilation_status shaderc_assemble_into_spv(
|
||||
const shaderc_compiler_t compiler, const char* source_assembly,
|
||||
size_t source_assembly_size,
|
||||
- const shaderc_compile_options_t additional_options);
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result);
|
||||
|
||||
// The following functions, operating on shaderc_compilation_result_t objects,
|
||||
// offer only the basic thread-safety guarantee.
|
||||
diff --git a/libshaderc/include/shaderc/shaderc.hpp b/libshaderc/include/shaderc/shaderc.hpp
|
||||
index 3817af8..5592b49 100644
|
||||
--- a/libshaderc/include/shaderc/shaderc.hpp
|
||||
@@ -202,119 +148,6 @@ index 3817af8..5592b49 100644
|
||||
}
|
||||
|
||||
// Sets the compiler optimization level to the given level. Only the last one
|
||||
@@ -425,9 +426,10 @@ class Compiler {
|
||||
const char* input_file_name,
|
||||
const char* entry_point_name,
|
||||
const CompileOptions& options) const {
|
||||
- shaderc_compilation_result_t compilation_result = shaderc_compile_into_spv(
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_compile_into_spv(
|
||||
compiler_, source_text, source_text_size, shader_kind, input_file_name,
|
||||
- entry_point_name, options.options_);
|
||||
+ entry_point_name, options.options_, &compilation_result);
|
||||
return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
@@ -451,9 +453,10 @@ class Compiler {
|
||||
size_t source_text_size,
|
||||
shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name) const {
|
||||
- shaderc_compilation_result_t compilation_result =
|
||||
- shaderc_compile_into_spv(compiler_, source_text, source_text_size,
|
||||
- shader_kind, input_file_name, "main", nullptr);
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_compile_into_spv(compiler_, source_text, source_text_size,
|
||||
+ shader_kind, input_file_name, "main", nullptr,
|
||||
+ &compilation_result);
|
||||
return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
@@ -504,8 +507,11 @@ class Compiler {
|
||||
SpvCompilationResult AssembleToSpv(const char* source_assembly,
|
||||
size_t source_assembly_size,
|
||||
const CompileOptions& options) const {
|
||||
- return SpvCompilationResult(shaderc_assemble_into_spv(
|
||||
- compiler_, source_assembly, source_assembly_size, options.options_));
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_assemble_into_spv(
|
||||
+ compiler_, source_assembly, source_assembly_size, options.options_,
|
||||
+ &compilation_result);
|
||||
+ return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
// Assembles the given SPIR-V assembly and returns a SPIR-V binary module
|
||||
@@ -513,8 +519,11 @@ class Compiler {
|
||||
// Like the first AssembleToSpv method but uses the default compiler options.
|
||||
SpvCompilationResult AssembleToSpv(const char* source_assembly,
|
||||
size_t source_assembly_size) const {
|
||||
- return SpvCompilationResult(shaderc_assemble_into_spv(
|
||||
- compiler_, source_assembly, source_assembly_size, nullptr));
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_assemble_into_spv(
|
||||
+ compiler_, source_assembly, source_assembly_size, nullptr,
|
||||
+ &compilation_result);
|
||||
+ return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
// Assembles the given SPIR-V assembly and returns a SPIR-V binary module
|
||||
@@ -523,9 +532,11 @@ class Compiler {
|
||||
// std::string.
|
||||
SpvCompilationResult AssembleToSpv(const std::string& source_assembly,
|
||||
const CompileOptions& options) const {
|
||||
- return SpvCompilationResult(
|
||||
- shaderc_assemble_into_spv(compiler_, source_assembly.data(),
|
||||
- source_assembly.size(), options.options_));
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_assemble_into_spv(
|
||||
+ compiler_, source_assembly.data(), source_assembly.size(),
|
||||
+ options.options_, &compilation_result);
|
||||
+ return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
// Assembles the given SPIR-V assembly and returns a SPIR-V binary module
|
||||
@@ -533,8 +544,10 @@ class Compiler {
|
||||
// Like the first AssembleToSpv method but the source is provided as a
|
||||
// std::string and also uses default compiler options.
|
||||
SpvCompilationResult AssembleToSpv(const std::string& source_assembly) const {
|
||||
- return SpvCompilationResult(shaderc_assemble_into_spv(
|
||||
- compiler_, source_assembly.data(), source_assembly.size(), nullptr));
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_assemble_into_spv(compiler_, source_assembly.data(),
|
||||
+ source_assembly.size(), nullptr, &compilation_result);
|
||||
+ return SpvCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
// Compiles the given source GLSL and returns the SPIR-V assembly text
|
||||
@@ -544,10 +557,11 @@ class Compiler {
|
||||
const char* source_text, size_t source_text_size,
|
||||
shaderc_shader_kind shader_kind, const char* input_file_name,
|
||||
const char* entry_point_name, const CompileOptions& options) const {
|
||||
- shaderc_compilation_result_t compilation_result =
|
||||
- shaderc_compile_into_spv_assembly(
|
||||
- compiler_, source_text, source_text_size, shader_kind,
|
||||
- input_file_name, entry_point_name, options.options_);
|
||||
+ shaderc_compilation_result_t compilation_result = nullptr;
|
||||
+ shaderc_compile_into_spv_assembly(
|
||||
+ compiler_, source_text, source_text_size, shader_kind,
|
||||
+ input_file_name, entry_point_name, options.options_,
|
||||
+ &compilation_result);
|
||||
return AssemblyCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
@@ -592,10 +606,10 @@ class Compiler {
|
||||
const char* source_text, size_t source_text_size,
|
||||
shaderc_shader_kind shader_kind, const char* input_file_name,
|
||||
const CompileOptions& options) const {
|
||||
- shaderc_compilation_result_t compilation_result =
|
||||
- shaderc_compile_into_preprocessed_text(
|
||||
+ shaderc_compilation_result_t compilation_result;
|
||||
+ shaderc_compile_into_preprocessed_text(
|
||||
compiler_, source_text, source_text_size, shader_kind,
|
||||
- input_file_name, "main", options.options_);
|
||||
+ input_file_name, "main", options.options_, &compilation_result);
|
||||
return PreprocessedSourceCompilationResult(compilation_result);
|
||||
}
|
||||
|
||||
diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc
|
||||
index 63f1bbc..c1a9b12 100644
|
||||
--- a/libshaderc/src/shaderc.cc
|
||||
@@ -334,146 +167,6 @@ index 63f1bbc..c1a9b12 100644
|
||||
}
|
||||
|
||||
void shaderc_compile_options_set_optimization_level(
|
||||
@@ -591,8 +595,31 @@ void shaderc_compiler_release(shaderc_compiler_t compiler) {
|
||||
delete compiler;
|
||||
}
|
||||
|
||||
+const char* shaderc_compilation_status_to_string(shaderc_compilation_status status)
|
||||
+{
|
||||
+ static constexpr const std::pair<shaderc_compilation_status, const char*> status_names[] = {
|
||||
+ {shaderc_compilation_status_success, "shaderc_compilation_status_success"},
|
||||
+ {shaderc_compilation_status_invalid_stage, "shaderc_compilation_status_invalid_stage"},
|
||||
+ {shaderc_compilation_status_compilation_error, "shaderc_compilation_status_compilation_error"},
|
||||
+ {shaderc_compilation_status_internal_error, "shaderc_compilation_status_internal_error"},
|
||||
+ {shaderc_compilation_status_null_result_object, "shaderc_compilation_status_null_result_object"},
|
||||
+ {shaderc_compilation_status_invalid_assembly, "shaderc_compilation_status_invalid_assembly"},
|
||||
+ {shaderc_compilation_status_validation_error, "shaderc_compilation_status_validation_error"},
|
||||
+ {shaderc_compilation_status_transformation_error, "shaderc_compilation_status_transformation_error"},
|
||||
+ {shaderc_compilation_status_configuration_error, "shaderc_compilation_status_configuration_error"},
|
||||
+ };
|
||||
+
|
||||
+ for (const auto& it : status_names)
|
||||
+ {
|
||||
+ if (status == it.first)
|
||||
+ return it.second;
|
||||
+ }
|
||||
+
|
||||
+ return "shaderc_compilation_status_unknown";
|
||||
+}
|
||||
+
|
||||
namespace {
|
||||
-shaderc_compilation_result_t CompileToSpecifiedOutputType(
|
||||
+shaderc_compilation_result_vector* CompileToSpecifiedOutputType(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
@@ -669,48 +696,59 @@ shaderc_compilation_result_t CompileToSpecifiedOutputType(
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
||||
-shaderc_compilation_result_t shaderc_compile_into_spv(
|
||||
+shaderc_compilation_status shaderc_compile_into_spv(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options) {
|
||||
- return CompileToSpecifiedOutputType(
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result) {
|
||||
+ shaderc_compilation_result_vector* resultv = CompileToSpecifiedOutputType(
|
||||
compiler, source_text, source_text_size, shader_kind, input_file_name,
|
||||
entry_point_name, additional_options,
|
||||
shaderc_util::Compiler::OutputType::SpirvBinary);
|
||||
+ *result = resultv;
|
||||
+ return resultv ? resultv->compilation_status : shaderc_compilation_status_internal_error;
|
||||
}
|
||||
|
||||
-shaderc_compilation_result_t shaderc_compile_into_spv_assembly(
|
||||
+shaderc_compilation_status shaderc_compile_into_spv_assembly(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options) {
|
||||
- return CompileToSpecifiedOutputType(
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result) {
|
||||
+ shaderc_compilation_result_vector* resultv = CompileToSpecifiedOutputType(
|
||||
compiler, source_text, source_text_size, shader_kind, input_file_name,
|
||||
entry_point_name, additional_options,
|
||||
shaderc_util::Compiler::OutputType::SpirvAssemblyText);
|
||||
+ *result = resultv;
|
||||
+ return resultv ? resultv->compilation_status : shaderc_compilation_status_internal_error;
|
||||
}
|
||||
|
||||
-shaderc_compilation_result_t shaderc_compile_into_preprocessed_text(
|
||||
+shaderc_compilation_status shaderc_compile_into_preprocessed_text(
|
||||
const shaderc_compiler_t compiler, const char* source_text,
|
||||
size_t source_text_size, shaderc_shader_kind shader_kind,
|
||||
const char* input_file_name, const char* entry_point_name,
|
||||
- const shaderc_compile_options_t additional_options) {
|
||||
- return CompileToSpecifiedOutputType(
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result) {
|
||||
+ shaderc_compilation_result_vector* resultv = CompileToSpecifiedOutputType(
|
||||
compiler, source_text, source_text_size, shader_kind, input_file_name,
|
||||
entry_point_name, additional_options,
|
||||
shaderc_util::Compiler::OutputType::PreprocessedText);
|
||||
+ *result = resultv;
|
||||
+ return resultv ? resultv->compilation_status : shaderc_compilation_status_internal_error;
|
||||
}
|
||||
|
||||
-shaderc_compilation_result_t shaderc_assemble_into_spv(
|
||||
+shaderc_compilation_status shaderc_assemble_into_spv(
|
||||
const shaderc_compiler_t compiler, const char* source_assembly,
|
||||
size_t source_assembly_size,
|
||||
- const shaderc_compile_options_t additional_options) {
|
||||
- auto* result = new (std::nothrow) shaderc_compilation_result_spv_binary;
|
||||
- if (!result) return nullptr;
|
||||
- result->compilation_status = shaderc_compilation_status_invalid_assembly;
|
||||
- if (!compiler->initializer) return result;
|
||||
- if (source_assembly == nullptr) return result;
|
||||
+ const shaderc_compile_options_t additional_options,
|
||||
+ shaderc_compilation_result_t* result) {
|
||||
+ auto* bresult = new (std::nothrow) shaderc_compilation_result_spv_binary;
|
||||
+ if (!bresult) return shaderc_compilation_status_internal_error;
|
||||
+ bresult->compilation_status = shaderc_compilation_status_invalid_assembly;
|
||||
+ *result = bresult;
|
||||
+ if (!compiler->initializer) return bresult->compilation_status;
|
||||
+ if (source_assembly == nullptr) return bresult->compilation_status;
|
||||
|
||||
TRY_IF_EXCEPTIONS_ENABLED {
|
||||
spv_binary assembling_output_data = nullptr;
|
||||
@@ -724,22 +762,22 @@ shaderc_compilation_result_t shaderc_assemble_into_spv(
|
||||
GetCompilerTargetEnvVersion(target_env_version),
|
||||
{source_assembly, source_assembly + source_assembly_size},
|
||||
&assembling_output_data, &errors);
|
||||
- result->num_errors = !assembling_succeeded;
|
||||
+ bresult->num_errors = !assembling_succeeded;
|
||||
if (assembling_succeeded) {
|
||||
- result->SetOutputData(assembling_output_data);
|
||||
- result->output_data_size =
|
||||
+ bresult->SetOutputData(assembling_output_data);
|
||||
+ bresult->output_data_size =
|
||||
assembling_output_data->wordCount * sizeof(uint32_t);
|
||||
- result->compilation_status = shaderc_compilation_status_success;
|
||||
+ bresult->compilation_status = shaderc_compilation_status_success;
|
||||
} else {
|
||||
- result->messages = std::move(errors);
|
||||
- result->compilation_status = shaderc_compilation_status_invalid_assembly;
|
||||
+ bresult->messages = std::move(errors);
|
||||
+ bresult->compilation_status = shaderc_compilation_status_invalid_assembly;
|
||||
}
|
||||
}
|
||||
CATCH_IF_EXCEPTIONS_ENABLED(...) {
|
||||
- result->compilation_status = shaderc_compilation_status_internal_error;
|
||||
+ bresult->compilation_status = shaderc_compilation_status_internal_error;
|
||||
}
|
||||
|
||||
- return result;
|
||||
+ return bresult->compilation_status;
|
||||
}
|
||||
|
||||
size_t shaderc_result_get_length(const shaderc_compilation_result_t result) {
|
||||
diff --git a/libshaderc_util/include/libshaderc_util/compiler.h b/libshaderc_util/include/libshaderc_util/compiler.h
|
||||
index d9d02b9..b076ec8 100644
|
||||
--- a/libshaderc_util/include/libshaderc_util/compiler.h
|
||||
|
||||
@@ -6,6 +6,9 @@ set -e
|
||||
|
||||
# While we use custom Qt builds for our releases, the Qt6 package will be good enough
|
||||
# for just updating translations. Saves building it for this action alone.
|
||||
"$SCRIPTDIR/../../../../tools/retry.sh" sudo apt-get -y install qt6-l10n-tools
|
||||
"$SCRIPTDIR/../../../../tools/retry.sh" sudo apt-get -y install qt6-l10n-tools python3
|
||||
|
||||
"$SCRIPTDIR/../../../../tools/generate_fullscreen_ui_translation_strings.py"
|
||||
"$SCRIPTDIR/../../../../pcsx2-qt/Translations/update_glyph_ranges.py"
|
||||
"$SCRIPTDIR/../../../../tools/generate_update_fa_glyph_ranges.py"
|
||||
PATH=/usr/lib/qt6/bin:$PATH "$SCRIPTDIR/../../../../pcsx2-qt/Translations/update_base_translation.sh"
|
||||
|
||||
@@ -16,11 +16,11 @@ fi
|
||||
|
||||
LIBBACKTRACE=ad106d5fdd5d960bd33fae1c48a351af567fd075
|
||||
LIBJPEG=9f
|
||||
LIBPNG=1.6.43
|
||||
LIBPNG=1.6.44
|
||||
LIBWEBP=1.4.0
|
||||
LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
SDL=SDL2-2.30.7
|
||||
QT=6.7.2
|
||||
SDL=SDL2-2.30.9
|
||||
QT=6.8.0
|
||||
ZSTD=1.5.6
|
||||
|
||||
SHADERC=2024.1
|
||||
@@ -34,24 +34,24 @@ cd deps-build
|
||||
cat > SHASUMS <<EOF
|
||||
fd6f417fe9e3a071cf1424a5152d926a34c4a3c5070745470be6cf12a404ed79 $LIBBACKTRACE.zip
|
||||
04705c110cb2469caa79fb71fba3d7bf834914706e9641a4589485c1f832565b jpegsrc.v$LIBJPEG.tar.gz
|
||||
6a5ca0652392a2d7c9db2ae5b40210843c0bbc081cbd410825ab00cc59f14a6c libpng-$LIBPNG.tar.xz
|
||||
60c4da1d5b7f0aa8d158da48e8f8afa9773c1c8baa5d21974df61f1886b8ce8e libpng-$LIBPNG.tar.xz
|
||||
61f873ec69e3be1b99535634340d5bde750b2e4447caa1db9f61be3fd49ab1e5 libwebp-$LIBWEBP.tar.gz
|
||||
0728800155f3ed0a0c87e03addbd30ecbe374f7b080678bbca1506051d50dec3 $LZ4.tar.gz
|
||||
2508c80438cd5ff3bbeb8fe36b8f3ce7805018ff30303010b61b03bb83ab9694 $SDL.tar.gz
|
||||
24b574f71c87a763f50704bbb630cbe38298d544a1f890f099a4696b1d6beba4 $SDL.tar.gz
|
||||
8c29e06cf42aacc1eafc4077ae2ec6c6fcb96a626157e0593d5e82a34fd403c1 zstd-$ZSTD.tar.gz
|
||||
c5f22a5e10fb162895ded7de0963328e7307611c688487b5d152c9ee64767599 qtbase-everywhere-src-$QT.tar.xz
|
||||
e1a1d8785fae67d16ad0a443b01d5f32663a6b68d275f1806ebab257485ce5d6 qtimageformats-everywhere-src-$QT.tar.xz
|
||||
fb0d1286a35be3583fee34aeb5843c94719e07193bdf1d4d8b0dc14009caef01 qtsvg-everywhere-src-$QT.tar.xz
|
||||
58e855ad1b2533094726c8a425766b63a04a0eede2ed85086860e54593aa4b2a qttools-everywhere-src-$QT.tar.xz
|
||||
9845780b5dc1b7279d57836db51aeaf2e4a1160c42be09750616f39157582ca9 qttranslations-everywhere-src-$QT.tar.xz
|
||||
a2a057e1dd644bd44abb9990fecc194b2e25c2e0f39e81aa9fee4c1e5e2a8a5b qtwayland-everywhere-src-$QT.tar.xz
|
||||
1bad481710aa27f872de6c9f72651f89a6107f0077003d0ebfcc9fd15cba3c75 qtbase-everywhere-src-$QT.tar.xz
|
||||
595bf8557b91e1f8ebc726f1e09868a3c7e610ff5045068f2d4ea2428c49a5d4 qtimageformats-everywhere-src-$QT.tar.xz
|
||||
cf7a593d5e520f8177240610d9e55d5b75b0887fe5f385554ff64377f1646199 qtsvg-everywhere-src-$QT.tar.xz
|
||||
403115d8268503c6cc6e43310c8ae28eb9e605072a5d04e4a2de8b6af39981f7 qttools-everywhere-src-$QT.tar.xz
|
||||
84bf2b67c243cd0c50a08acd7bfa9df2b1965028511815c1b6b65a0687437cb6 qttranslations-everywhere-src-$QT.tar.xz
|
||||
175758591638ebf1c6fbb66ac11c7fa0eb8d4ed52e9243cc59075d06a6a2060a qtwayland-everywhere-src-$QT.tar.xz
|
||||
eb3b5f0c16313d34f208d90c2fa1e588a23283eed63b101edd5422be6165d528 shaderc-$SHADERC.tar.gz
|
||||
aa27e4454ce631c5a17924ce0624eac736da19fc6f5a2ab15a6c58da7b36950f shaderc-glslang-$SHADERC_GLSLANG.tar.gz
|
||||
5d866ce34a4b6908e262e5ebfffc0a5e11dd411640b5f24c85a80ad44c0d4697 shaderc-spirv-headers-$SHADERC_SPIRVHEADERS.tar.gz
|
||||
03ee1a2c06f3b61008478f4abe9423454e53e580b9488b47c8071547c6a9db47 shaderc-spirv-tools-$SHADERC_SPIRVTOOLS.tar.gz
|
||||
EOF
|
||||
|
||||
curl -C - -L \
|
||||
curl -L \
|
||||
-O "https://github.com/ianlancetaylor/libbacktrace/archive/$LIBBACKTRACE.zip" \
|
||||
-O "https://ijg.org/files/jpegsrc.v$LIBJPEG.tar.gz" \
|
||||
-O "https://downloads.sourceforge.net/project/libpng/libpng16/$LIBPNG/libpng-$LIBPNG.tar.xz" \
|
||||
@@ -150,7 +150,7 @@ tar xf "qtbase-everywhere-src-$QT.tar.xz"
|
||||
cd "qtbase-everywhere-src-$QT"
|
||||
mkdir build
|
||||
cd build
|
||||
../configure -prefix "$INSTALLDIR" -release -dbus-linked -gui -widgets -fontconfig -qt-doubleconversion -ssl -openssl-runtime -opengl desktop -qpa xcb,wayland -xkbcommon -xcb -gtk -- -DFEATURE_dbus=ON -DFEATURE_icu=OFF -DFEATURE_sql=OFF -DFEATURE_system_png=ON -DFEATURE_system_jpeg=ON -DFEATURE_system_zlib=ON -DFEATURE_system_freetype=ON -DFEATURE_system_harfbuzz=ON
|
||||
../configure -prefix "$INSTALLDIR" -release -dbus-linked -gui -widgets -fontconfig -qt-doubleconversion -ssl -openssl-runtime -opengl desktop -qpa xcb,wayland -xkbcommon -xcb -gtk -- -DFEATURE_dbus=ON -DFEATURE_icu=OFF -DFEATURE_printsupport=OFF -DFEATURE_sql=OFF -DFEATURE_system_png=ON -DFEATURE_system_jpeg=ON -DFEATURE_system_zlib=ON -DFEATURE_system_freetype=ON -DFEATURE_system_harfbuzz=ON
|
||||
cmake --build . --parallel
|
||||
ninja install
|
||||
cd ../../
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/the-tcpdump-group/libpcap.git",
|
||||
"tag": "libpcap-1.10.4",
|
||||
"commit": "104271ba4a14de6743e43bcf87536786d8fddea4"
|
||||
"tag": "libpcap-1.10.5",
|
||||
"commit": "bbcbc9174df3298a854daee2b3e666a4b6e5383a"
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://libsdl.org/release/SDL2-2.30.7.tar.gz",
|
||||
"sha256": "2508c80438cd5ff3bbeb8fe36b8f3ce7805018ff30303010b61b03bb83ab9694"
|
||||
"url": "https://libsdl.org/release/SDL2-2.30.9.tar.gz",
|
||||
"sha256": "24b574f71c87a763f50704bbb630cbe38298d544a1f890f099a4696b1d6beba4"
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"app-id": "net.pcsx2.PCSX2",
|
||||
"runtime": "org.kde.Platform",
|
||||
"runtime-version": "6.7",
|
||||
"runtime-version": "6.8",
|
||||
"sdk": "org.kde.Sdk",
|
||||
"sdk-extensions": [
|
||||
"org.freedesktop.Sdk.Extension.llvm17"
|
||||
"org.freedesktop.Sdk.Extension.llvm18"
|
||||
],
|
||||
"add-extensions": {
|
||||
"org.freedesktop.Platform.ffmpeg-full": {
|
||||
"directory": "lib/ffmpeg",
|
||||
"version": "23.08",
|
||||
"version": "24.08",
|
||||
"add-ld-path": ".",
|
||||
"autodownload": true
|
||||
}
|
||||
@@ -44,8 +44,8 @@
|
||||
"config-opts": [
|
||||
"-DCMAKE_BUILD_TYPE=Release",
|
||||
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON",
|
||||
"-DCMAKE_C_COMPILER=/usr/lib/sdk/llvm17/bin/clang",
|
||||
"-DCMAKE_CXX_COMPILER=/usr/lib/sdk/llvm17/bin/clang++",
|
||||
"-DCMAKE_C_COMPILER=/usr/lib/sdk/llvm18/bin/clang",
|
||||
"-DCMAKE_CXX_COMPILER=/usr/lib/sdk/llvm18/bin/clang++",
|
||||
"-DCMAKE_EXE_LINKER_FLAGS_INIT=-fuse-ld=lld",
|
||||
"-DCMAKE_MODULE_LINKER_FLAGS_INIT=-fuse-ld=lld",
|
||||
"-DCMAKE_SHARED_LINKER_FLAGS_INIT=-fuse-ld=lld",
|
||||
|
||||
@@ -38,17 +38,17 @@ if [ "${INSTALLDIR:0:1}" != "/" ]; then
|
||||
INSTALLDIR="$PWD/$INSTALLDIR"
|
||||
fi
|
||||
|
||||
FREETYPE=2.13.2
|
||||
HARFBUZZ=8.3.1
|
||||
SDL=SDL2-2.30.3
|
||||
ZSTD=1.5.5
|
||||
FREETYPE=2.13.3
|
||||
HARFBUZZ=10.0.1
|
||||
SDL=SDL2-2.30.9
|
||||
ZSTD=1.5.6
|
||||
LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
LIBPNG=1.6.43
|
||||
LIBPNG=1.6.44
|
||||
LIBJPEG=9f
|
||||
LIBWEBP=1.3.2
|
||||
LIBWEBP=1.4.0
|
||||
FFMPEG=6.0
|
||||
MOLTENVK=1.2.8
|
||||
QT=6.7.1
|
||||
MOLTENVK=1.2.9
|
||||
QT=6.7.2
|
||||
|
||||
SHADERC=2024.1
|
||||
SHADERC_GLSLANG=142052fa30f9eca191aa9dcf65359fcaed09eeec
|
||||
@@ -74,21 +74,21 @@ CMAKE_ARCH_ARM64=-DCMAKE_OSX_ARCHITECTURES="arm64"
|
||||
CMAKE_ARCH_UNIVERSAL=-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
|
||||
|
||||
cat > SHASUMS <<EOF
|
||||
12991c4e55c506dd7f9b765933e62fd2be2e06d421505d7950a132e4f1bb484d freetype-$FREETYPE.tar.xz
|
||||
19a54fe9596f7a47c502549fce8e8a10978c697203774008cc173f8360b19a9a harfbuzz-$HARFBUZZ.tar.gz
|
||||
820440072f8f5b50188c1dae104f2ad25984de268785be40c41a099a510f0aec $SDL.tar.gz
|
||||
9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4 zstd-$ZSTD.tar.gz
|
||||
0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289 freetype-$FREETYPE.tar.xz
|
||||
e7358ea86fe10fb9261931af6f010d4358dac64f7074420ca9bc94aae2bdd542 harfbuzz-$HARFBUZZ.tar.gz
|
||||
24b574f71c87a763f50704bbb630cbe38298d544a1f890f099a4696b1d6beba4 $SDL.tar.gz
|
||||
8c29e06cf42aacc1eafc4077ae2ec6c6fcb96a626157e0593d5e82a34fd403c1 zstd-$ZSTD.tar.gz
|
||||
0728800155f3ed0a0c87e03addbd30ecbe374f7b080678bbca1506051d50dec3 $LZ4.tar.gz
|
||||
6a5ca0652392a2d7c9db2ae5b40210843c0bbc081cbd410825ab00cc59f14a6c libpng-$LIBPNG.tar.xz
|
||||
2a499607df669e40258e53d0ade8035ba4ec0175244869d1025d460562aa09b4 libwebp-$LIBWEBP.tar.gz
|
||||
60c4da1d5b7f0aa8d158da48e8f8afa9773c1c8baa5d21974df61f1886b8ce8e libpng-$LIBPNG.tar.xz
|
||||
61f873ec69e3be1b99535634340d5bde750b2e4447caa1db9f61be3fd49ab1e5 libwebp-$LIBWEBP.tar.gz
|
||||
04705c110cb2469caa79fb71fba3d7bf834914706e9641a4589485c1f832565b jpegsrc.v$LIBJPEG.tar.gz
|
||||
57be87c22d9b49c112b6d24bc67d42508660e6b718b3db89c44e47e289137082 ffmpeg-$FFMPEG.tar.xz
|
||||
85beaf8abfcc54d9da0ff0257ae311abd9e7aa96e53da37e1c37d6bc04ac83cd v$MOLTENVK.tar.gz
|
||||
b7338da1bdccb4d861e714efffaa83f174dfe37e194916bfd7ec82279a6ace19 qtbase-everywhere-src-$QT.tar.xz
|
||||
a733b98f771064d000476b8861f822143982749448ba8abf9f1813edb8dfe79f qtimageformats-everywhere-src-$QT.tar.xz
|
||||
3ed5b80f7228c41dd463b7a57284ed273d224d1c323c0dd78c5209635807cbce qtsvg-everywhere-src-$QT.tar.xz
|
||||
0953cddf6248f3959279a10904892e8a98eb3e463d729a174b6fc47febd99824 qttools-everywhere-src-$QT.tar.xz
|
||||
03d71565872b0e0e7303349071df031ab0f922f6dbdd3a5ec1ade9e188e4fbf4 qttranslations-everywhere-src-$QT.tar.xz
|
||||
f415a09385030c6510a936155ce211f617c31506db5fbc563e804345f1ecf56e v$MOLTENVK.tar.gz
|
||||
c5f22a5e10fb162895ded7de0963328e7307611c688487b5d152c9ee64767599 qtbase-everywhere-src-$QT.tar.xz
|
||||
e1a1d8785fae67d16ad0a443b01d5f32663a6b68d275f1806ebab257485ce5d6 qtimageformats-everywhere-src-$QT.tar.xz
|
||||
fb0d1286a35be3583fee34aeb5843c94719e07193bdf1d4d8b0dc14009caef01 qtsvg-everywhere-src-$QT.tar.xz
|
||||
58e855ad1b2533094726c8a425766b63a04a0eede2ed85086860e54593aa4b2a qttools-everywhere-src-$QT.tar.xz
|
||||
9845780b5dc1b7279d57836db51aeaf2e4a1160c42be09750616f39157582ca9 qttranslations-everywhere-src-$QT.tar.xz
|
||||
eb3b5f0c16313d34f208d90c2fa1e588a23283eed63b101edd5422be6165d528 shaderc-$SHADERC.tar.gz
|
||||
aa27e4454ce631c5a17924ce0624eac736da19fc6f5a2ab15a6c58da7b36950f shaderc-glslang-$SHADERC_GLSLANG.tar.gz
|
||||
5d866ce34a4b6908e262e5ebfffc0a5e11dd411640b5f24c85a80ad44c0d4697 shaderc-spirv-headers-$SHADERC_SPIRVHEADERS.tar.gz
|
||||
@@ -330,20 +330,6 @@ echo "Installing Qt Tools..."
|
||||
rm -fr "qttools-everywhere-src-$QT"
|
||||
tar xf "qttools-everywhere-src-$QT.tar.xz"
|
||||
cd "qttools-everywhere-src-$QT"
|
||||
# Linguist relies on a library in the Designer target, which takes 5-7 minutes to build on the CI
|
||||
# Avoid it by not building Linguist, since we only need the tools that come with it
|
||||
patch -u src/linguist/CMakeLists.txt <<EOF
|
||||
--- src/linguist/CMakeLists.txt
|
||||
+++ src/linguist/CMakeLists.txt
|
||||
@@ -14,7 +14,7 @@
|
||||
add_subdirectory(lrelease-pro)
|
||||
add_subdirectory(lupdate)
|
||||
add_subdirectory(lupdate-pro)
|
||||
-if(QT_FEATURE_process AND QT_FEATURE_pushbutton AND QT_FEATURE_toolbutton AND TARGET Qt::Widgets AND NOT no-png)
|
||||
+if(QT_FEATURE_process AND QT_FEATURE_pushbutton AND QT_FEATURE_toolbutton AND TARGET Qt::Widgets AND TARGET Qt::PrintSupport AND NOT no-png)
|
||||
add_subdirectory(linguist)
|
||||
endif()
|
||||
EOF
|
||||
mkdir build
|
||||
cd build
|
||||
"$INSTALLDIR/bin/qt-configure-module" .. -- "${CMAKE_COMMON[@]}" "$CMAKE_ARCH_UNIVERSAL" -DFEATURE_assistant=OFF -DFEATURE_clang=OFF -DFEATURE_designer=OFF -DFEATURE_kmap2qmap=OFF -DFEATURE_pixeltool=OFF -DFEATURE_pkg_config=OFF -DFEATURE_qev=OFF -DFEATURE_qtattributionsscanner=OFF -DFEATURE_qtdiag=OFF -DFEATURE_qtplugininfo=OFF
|
||||
|
||||
@@ -20,12 +20,12 @@ if [ "${INSTALLDIR:0:1}" != "/" ]; then
|
||||
INSTALLDIR="$PWD/$INSTALLDIR"
|
||||
fi
|
||||
|
||||
FREETYPE=2.13.2
|
||||
HARFBUZZ=8.3.1
|
||||
SDL=SDL2-2.30.7
|
||||
FREETYPE=2.13.3
|
||||
HARFBUZZ=10.0.1
|
||||
SDL=SDL2-2.30.9
|
||||
ZSTD=1.5.6
|
||||
LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
LIBPNG=1.6.43
|
||||
LIBPNG=1.6.44
|
||||
LIBJPEG=9f
|
||||
LIBWEBP=1.4.0
|
||||
FFMPEG=6.0
|
||||
@@ -54,12 +54,12 @@ CMAKE_COMMON=(
|
||||
)
|
||||
|
||||
cat > SHASUMS <<EOF
|
||||
12991c4e55c506dd7f9b765933e62fd2be2e06d421505d7950a132e4f1bb484d freetype-$FREETYPE.tar.xz
|
||||
19a54fe9596f7a47c502549fce8e8a10978c697203774008cc173f8360b19a9a harfbuzz-$HARFBUZZ.tar.gz
|
||||
2508c80438cd5ff3bbeb8fe36b8f3ce7805018ff30303010b61b03bb83ab9694 $SDL.tar.gz
|
||||
0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289 freetype-$FREETYPE.tar.xz
|
||||
e7358ea86fe10fb9261931af6f010d4358dac64f7074420ca9bc94aae2bdd542 harfbuzz-$HARFBUZZ.tar.gz
|
||||
24b574f71c87a763f50704bbb630cbe38298d544a1f890f099a4696b1d6beba4 $SDL.tar.gz
|
||||
8c29e06cf42aacc1eafc4077ae2ec6c6fcb96a626157e0593d5e82a34fd403c1 zstd-$ZSTD.tar.gz
|
||||
0728800155f3ed0a0c87e03addbd30ecbe374f7b080678bbca1506051d50dec3 $LZ4.tar.gz
|
||||
6a5ca0652392a2d7c9db2ae5b40210843c0bbc081cbd410825ab00cc59f14a6c libpng-$LIBPNG.tar.xz
|
||||
60c4da1d5b7f0aa8d158da48e8f8afa9773c1c8baa5d21974df61f1886b8ce8e libpng-$LIBPNG.tar.xz
|
||||
61f873ec69e3be1b99535634340d5bde750b2e4447caa1db9f61be3fd49ab1e5 libwebp-$LIBWEBP.tar.gz
|
||||
04705c110cb2469caa79fb71fba3d7bf834914706e9641a4589485c1f832565b jpegsrc.v$LIBJPEG.tar.gz
|
||||
57be87c22d9b49c112b6d24bc67d42508660e6b718b3db89c44e47e289137082 ffmpeg-$FFMPEG.tar.xz
|
||||
|
||||
@@ -42,14 +42,14 @@ echo INSTALLDIR=%INSTALLDIR%
|
||||
|
||||
cd "%BUILDDIR%"
|
||||
|
||||
set FREETYPE=2.13.2
|
||||
set HARFBUZZ=8.3.1
|
||||
set FREETYPE=2.13.3
|
||||
set HARFBUZZ=10.0.1
|
||||
set LIBJPEG=9f
|
||||
set LIBPNG=1643
|
||||
set LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
set QT=6.7.2
|
||||
set QTMINOR=6.7
|
||||
set SDL=SDL2-2.30.7
|
||||
set QT=6.8.0
|
||||
set QTMINOR=6.8
|
||||
set SDL=SDL2-2.30.9
|
||||
set WEBP=1.4.0
|
||||
set ZLIB=1.3.1
|
||||
set ZLIBSHORT=131
|
||||
@@ -60,21 +60,21 @@ set SHADERC_GLSLANG=142052fa30f9eca191aa9dcf65359fcaed09eeec
|
||||
set SHADERC_SPIRVHEADERS=5e3ad389ee56fca27c9705d093ae5387ce404df4
|
||||
set SHADERC_SPIRVTOOLS=dd4b663e13c07fea4fbb3f70c1c91c86731099f7
|
||||
|
||||
call :downloadfile "freetype-%FREETYPE%.tar.gz" https://sourceforge.net/projects/freetype/files/freetype2/%FREETYPE%/freetype-%FREETYPE%.tar.gz/download 1ac27e16c134a7f2ccea177faba19801131116fd682efc1f5737037c5db224b5 || goto error
|
||||
call :downloadfile "harfbuzz-%HARFBUZZ%.zip" https://github.com/harfbuzz/harfbuzz/archive/refs/tags/%HARFBUZZ%.zip b2bc56184ae37324bc4829fde7d3f9e6916866ad711ee85792e457547c9fd127 || goto error
|
||||
call :downloadfile "freetype-%FREETYPE%.tar.gz" https://sourceforge.net/projects/freetype/files/freetype2/%FREETYPE%/freetype-%FREETYPE%.tar.gz/download 5c3a8e78f7b24c20b25b54ee575d6daa40007a5f4eea2845861c3409b3021747 || goto error
|
||||
call :downloadfile "harfbuzz-%HARFBUZZ%.zip" https://github.com/harfbuzz/harfbuzz/archive/refs/tags/%HARFBUZZ%.zip 8adf9f5a4b6022aa2744f45c89ce347df46fea8403e99f01d650b11c417d0aa8 || goto error
|
||||
call :downloadfile "lpng%LIBPNG%.zip" https://download.sourceforge.net/libpng/lpng1643.zip fc466a1e638e635d6c66363bdf3f38555b81b0141d0b06ba45b49ccca327436d || goto error
|
||||
call :downloadfile "jpegsr%LIBJPEG%.zip" https://ijg.org/files/jpegsr%LIBJPEG%.zip 6255da8c89e09d694e6800688c76145eb6870a76ac0d36c74fccd61b3940aafa || goto error
|
||||
call :downloadfile "libwebp-%WEBP%.tar.gz" "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-%WEBP%.tar.gz" 61f873ec69e3be1b99535634340d5bde750b2e4447caa1db9f61be3fd49ab1e5 || goto error
|
||||
call :downloadfile "lz4-%LZ4%.zip" "https://github.com/lz4/lz4/archive/%LZ4%.zip" 0c33119688d6b180c7e760b0acd70059222389cfd581632623784bee27e51a31 || goto error
|
||||
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" e5d592a60c1a4428095af323849e207e93cfbbe7a94931db526ce1213a2effed || goto error
|
||||
call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" 488119aad60719a085a1e45c31641ac2406ef86fc088a3c99885c18e9d6b4bb9 || goto error
|
||||
call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 8e736b02db7dd67dbe834d56503b242344ce85d3532da692f1812b30ccf80997 || goto error
|
||||
call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" 85a22142270a92be0dd0ab5d27cc53617b2a2f1a45fc0a3890024164032f8475 || goto error
|
||||
call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" 9e15f1fdbd83e4123e733bff20aff1b45921c09056c3790fa42eb71d0a5cd01f || goto error
|
||||
call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" d1f25e0f68a1282feffdd5fe795a027ee5f16ad19e3b1fa2e04a51cea19110ec || goto error
|
||||
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" ec855bcd815b4b63d0c958c42c2923311c656227d6e0c1ae1e721406d346444b || goto error
|
||||
call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" c3b41915341d853b6374cf93f1fcced2c8e4be9360f29c656960e1d0d15046a3 || goto error
|
||||
call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 809081a7bdf7e48262fbe9437e4e756df6ad2649433e803c4040026e650d7c91 || goto error
|
||||
call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" 89f1ef4595f68c3d34c63a7c1c4ce475e701e103f0473f3fd0718a2e5234de6e || goto error
|
||||
call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" 3f813f49d6d28c532dc4b104084f60ff382337f184698fcd6e70ab9efad977c1 || goto error
|
||||
call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" 91c33d9946279c9c613b02e52a33df610cc01d13ea6e321b4c4d8ee708b9a03e || goto error
|
||||
call :downloadfile "zlib%ZLIBSHORT%.zip" "https://zlib.net/zlib%ZLIBSHORT%.zip" 72af66d44fcc14c22013b46b814d5d2514673dda3d115e64b690c1ad636e7b17 || goto error
|
||||
call :downloadfile "zstd-%ZSTD%.zip" "https://github.com/facebook/zstd/archive/refs/tags/v%ZSTD%.zip" 3b1c3b46e416d36931efd34663122d7f51b550c87f74de2d38249516fe7d8be5 || goto error
|
||||
call :downloadfile "zstd-fd5f8106a58601a963ee816e6a57aa7c61fafc53.patch" https://github.com/facebook/zstd/commit/fd5f8106a58601a963ee816e6a57aa7c61fafc53.patch 675f144b11f8ab2424b64bed8ccdca5d3f35b9326046fa7a883925dd180f0651 || goto error
|
||||
call :downloadfile "zstd-fd5f8106a58601a963ee816e6a57aa7c61fafc53.patch" https://github.com/facebook/zstd/commit/fd5f8106a58601a963ee816e6a57aa7c61fafc53.patch 8df152f4969b308546306c074628de761f0b80265de7de534e3822fab22d7535 || goto error
|
||||
|
||||
call :downloadfile "shaderc-%SHADERC%.zip" "https://github.com/google/shaderc/archive/refs/tags/v%SHADERC%.zip" 6c9f42ed6bf42750f5369b089909abfdcf0101488b4a1f41116d5159d00af8e7 || goto error
|
||||
call :downloadfile "shaderc-glslang-%SHADERC_GLSLANG%.zip" "https://github.com/KhronosGroup/glslang/archive/%SHADERC_GLSLANG%.zip" 03ad8a6fa987af4653d0cfe6bdaed41bcf617f1366a151fb1574da75950cd3e8 || goto error
|
||||
|
||||
@@ -40,14 +40,14 @@ set "PATH=%PATH%;%INSTALLDIR%\bin"
|
||||
|
||||
cd "%BUILDDIR%"
|
||||
|
||||
set FREETYPE=2.13.2
|
||||
set HARFBUZZ=8.3.1
|
||||
set FREETYPE=2.13.3
|
||||
set HARFBUZZ=10.0.1
|
||||
set LIBJPEG=9f
|
||||
set LIBPNG=1643
|
||||
set LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
set QT=6.7.2
|
||||
set QTMINOR=6.7
|
||||
set SDL=SDL2-2.30.7
|
||||
set QT=6.8.0
|
||||
set QTMINOR=6.8
|
||||
set SDL=SDL2-2.30.9
|
||||
set WEBP=1.4.0
|
||||
set ZLIB=1.3.1
|
||||
set ZLIBSHORT=131
|
||||
@@ -58,21 +58,21 @@ set SHADERC_GLSLANG=142052fa30f9eca191aa9dcf65359fcaed09eeec
|
||||
set SHADERC_SPIRVHEADERS=5e3ad389ee56fca27c9705d093ae5387ce404df4
|
||||
set SHADERC_SPIRVTOOLS=dd4b663e13c07fea4fbb3f70c1c91c86731099f7
|
||||
|
||||
call :downloadfile "freetype-%FREETYPE%.tar.gz" https://sourceforge.net/projects/freetype/files/freetype2/%FREETYPE%/freetype-%FREETYPE%.tar.gz/download 1ac27e16c134a7f2ccea177faba19801131116fd682efc1f5737037c5db224b5 || goto error
|
||||
call :downloadfile "harfbuzz-%HARFBUZZ%.zip" https://github.com/harfbuzz/harfbuzz/archive/refs/tags/%HARFBUZZ%.zip b2bc56184ae37324bc4829fde7d3f9e6916866ad711ee85792e457547c9fd127 || goto error
|
||||
call :downloadfile "freetype-%FREETYPE%.tar.gz" https://sourceforge.net/projects/freetype/files/freetype2/%FREETYPE%/freetype-%FREETYPE%.tar.gz/download 5c3a8e78f7b24c20b25b54ee575d6daa40007a5f4eea2845861c3409b3021747 || goto error
|
||||
call :downloadfile "harfbuzz-%HARFBUZZ%.zip" https://github.com/harfbuzz/harfbuzz/archive/refs/tags/%HARFBUZZ%.zip 8adf9f5a4b6022aa2744f45c89ce347df46fea8403e99f01d650b11c417d0aa8 || goto error
|
||||
call :downloadfile "lpng%LIBPNG%.zip" https://download.sourceforge.net/libpng/lpng1643.zip fc466a1e638e635d6c66363bdf3f38555b81b0141d0b06ba45b49ccca327436d || goto error
|
||||
call :downloadfile "jpegsr%LIBJPEG%.zip" https://ijg.org/files/jpegsr%LIBJPEG%.zip 6255da8c89e09d694e6800688c76145eb6870a76ac0d36c74fccd61b3940aafa || goto error
|
||||
call :downloadfile "libwebp-%WEBP%.tar.gz" "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-%WEBP%.tar.gz" 61f873ec69e3be1b99535634340d5bde750b2e4447caa1db9f61be3fd49ab1e5 || goto error
|
||||
call :downloadfile "lz4-%LZ4%.zip" "https://github.com/lz4/lz4/archive/%LZ4%.zip" 0c33119688d6b180c7e760b0acd70059222389cfd581632623784bee27e51a31 || goto error
|
||||
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" e5d592a60c1a4428095af323849e207e93cfbbe7a94931db526ce1213a2effed || goto error
|
||||
call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" 488119aad60719a085a1e45c31641ac2406ef86fc088a3c99885c18e9d6b4bb9 || goto error
|
||||
call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 8e736b02db7dd67dbe834d56503b242344ce85d3532da692f1812b30ccf80997 || goto error
|
||||
call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" 85a22142270a92be0dd0ab5d27cc53617b2a2f1a45fc0a3890024164032f8475 || goto error
|
||||
call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" 9e15f1fdbd83e4123e733bff20aff1b45921c09056c3790fa42eb71d0a5cd01f || goto error
|
||||
call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" d1f25e0f68a1282feffdd5fe795a027ee5f16ad19e3b1fa2e04a51cea19110ec || goto error
|
||||
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" ec855bcd815b4b63d0c958c42c2923311c656227d6e0c1ae1e721406d346444b || goto error
|
||||
call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" c3b41915341d853b6374cf93f1fcced2c8e4be9360f29c656960e1d0d15046a3 || goto error
|
||||
call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 809081a7bdf7e48262fbe9437e4e756df6ad2649433e803c4040026e650d7c91 || goto error
|
||||
call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" 89f1ef4595f68c3d34c63a7c1c4ce475e701e103f0473f3fd0718a2e5234de6e || goto error
|
||||
call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" 3f813f49d6d28c532dc4b104084f60ff382337f184698fcd6e70ab9efad977c1 || goto error
|
||||
call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" 91c33d9946279c9c613b02e52a33df610cc01d13ea6e321b4c4d8ee708b9a03e || goto error
|
||||
call :downloadfile "zlib%ZLIBSHORT%.zip" "https://zlib.net/zlib%ZLIBSHORT%.zip" 72af66d44fcc14c22013b46b814d5d2514673dda3d115e64b690c1ad636e7b17 || goto error
|
||||
call :downloadfile "zstd-%ZSTD%.zip" "https://github.com/facebook/zstd/archive/refs/tags/v%ZSTD%.zip" 3b1c3b46e416d36931efd34663122d7f51b550c87f74de2d38249516fe7d8be5 || goto error
|
||||
call :downloadfile "zstd-fd5f8106a58601a963ee816e6a57aa7c61fafc53.patch" https://github.com/facebook/zstd/commit/fd5f8106a58601a963ee816e6a57aa7c61fafc53.patch 675f144b11f8ab2424b64bed8ccdca5d3f35b9326046fa7a883925dd180f0651 || goto error
|
||||
call :downloadfile "zstd-fd5f8106a58601a963ee816e6a57aa7c61fafc53.patch" https://github.com/facebook/zstd/commit/fd5f8106a58601a963ee816e6a57aa7c61fafc53.patch 8df152f4969b308546306c074628de761f0b80265de7de534e3822fab22d7535 || goto error
|
||||
|
||||
call :downloadfile "shaderc-%SHADERC%.zip" "https://github.com/google/shaderc/archive/refs/tags/v%SHADERC%.zip" 6c9f42ed6bf42750f5369b089909abfdcf0101488b4a1f41116d5159d00af8e7 || goto error
|
||||
call :downloadfile "shaderc-glslang-%SHADERC_GLSLANG%.zip" "https://github.com/KhronosGroup/glslang/archive/%SHADERC_GLSLANG%.zip" 03ad8a6fa987af4653d0cfe6bdaed41bcf617f1366a151fb1574da75950cd3e8 || goto error
|
||||
@@ -195,6 +195,9 @@ cd "qtbase-everywhere-src-%QT%" || goto error
|
||||
rem Disable the PCRE2 JIT, it doesn't properly verify AVX2 support.
|
||||
%PATCH% -p1 < "%SCRIPTDIR%\qtbase-disable-pcre2-jit.patch" || goto error
|
||||
|
||||
rem Hackfix settings icon stretching
|
||||
%PATCH% -p1 < "%SCRIPTDIR%\qtbase-fix-icon-stretch.patch" || goto error
|
||||
|
||||
cmake -B build -DFEATURE_sql=OFF -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" %FORCEPDB% -DINPUT_gui=yes -DINPUT_widgets=yes -DINPUT_ssl=yes -DINPUT_openssl=no -DINPUT_schannel=yes -DFEATURE_system_png=ON -DFEATURE_system_jpeg=ON -DFEATURE_system_zlib=ON -DFEATURE_system_freetype=ON -DFEATURE_system_harfbuzz=ON %QTBUILDSPEC% || goto error
|
||||
cmake --build build --parallel || goto error
|
||||
ninja -C build install || goto error
|
||||
|
||||
13
.github/workflows/scripts/windows/qtbase-fix-icon-stretch.patch
vendored
Normal file
13
.github/workflows/scripts/windows/qtbase-fix-icon-stretch.patch
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
|
||||
index 208420d7e8..26ef6f31ef 100644
|
||||
--- a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
|
||||
+++ b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
|
||||
@@ -4232,8 +4232,6 @@ QRect QWindowsVistaStyle::subElementRect(SubElement element, const QStyleOption
|
||||
|
||||
case SE_ItemViewItemDecoration:
|
||||
rect = QWindowsStyle::subElementRect(element, option, widget);
|
||||
- if (qstyleoption_cast<const QStyleOptionViewItem *>(option))
|
||||
- rect.adjust(-2, 0, 2, 0);
|
||||
break;
|
||||
|
||||
case SE_ItemViewItemFocusRect:
|
||||
2
.github/workflows/windows_build_qt.yml
vendored
2
.github/workflows/windows_build_qt.yml
vendored
@@ -100,7 +100,7 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: deps
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/windows/build-dependencies.bat') }}
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/windows/build-dependencies.bat', '.github/workflows/scripts/common/*.patch') }}
|
||||
|
||||
- name: Build Dependencies
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
|
||||
31
3rdparty/ccc/src/ccc/elf.cpp
vendored
31
3rdparty/ccc/src/ccc/elf.cpp
vendored
@@ -10,34 +10,35 @@ Result<ElfFile> ElfFile::parse(std::vector<u8> image)
|
||||
ElfFile elf;
|
||||
elf.image = std::move(image);
|
||||
|
||||
const ElfIdentHeader* ident = get_packed<ElfIdentHeader>(elf.image, 0);
|
||||
const ElfIdentHeader* ident = get_unaligned<ElfIdentHeader>(elf.image, 0);
|
||||
CCC_CHECK(ident, "ELF ident header out of range.");
|
||||
CCC_CHECK(ident->magic == CCC_FOURCC("\x7f\x45\x4c\x46"), "Not an ELF file.");
|
||||
CCC_CHECK(ident->e_class == ElfIdentClass::B32, "Wrong ELF class (not 32 bit).");
|
||||
|
||||
const ElfFileHeader* header = get_packed<ElfFileHeader>(elf.image, sizeof(ElfIdentHeader));
|
||||
const ElfFileHeader* header = get_unaligned<ElfFileHeader>(elf.image, sizeof(ElfIdentHeader));
|
||||
CCC_CHECK(header, "ELF file header out of range.");
|
||||
elf.file_header = *header;
|
||||
|
||||
const ElfSectionHeader* shstr_section_header = get_packed<ElfSectionHeader>(elf.image, header->shoff + header->shstrndx * sizeof(ElfSectionHeader));
|
||||
const ElfSectionHeader* shstr_section_header =
|
||||
get_unaligned<ElfSectionHeader>(elf.image, header->shoff + header->shstrndx * sizeof(ElfSectionHeader));
|
||||
CCC_CHECK(shstr_section_header, "ELF section name header out of range.");
|
||||
|
||||
for(u32 i = 0; i < header->shnum; i++) {
|
||||
u64 header_offset = header->shoff + i * sizeof(ElfSectionHeader);
|
||||
const ElfSectionHeader* section_header = get_packed<ElfSectionHeader>(elf.image, header_offset);
|
||||
const ElfSectionHeader* section_header = get_unaligned<ElfSectionHeader>(elf.image, header_offset);
|
||||
CCC_CHECK(section_header, "ELF section header out of range.");
|
||||
|
||||
const char* name = get_string(elf.image, shstr_section_header->offset + section_header->name);
|
||||
CCC_CHECK(section_header, "ELF section name out of range.");
|
||||
std::optional<std::string_view> name = get_string(elf.image, shstr_section_header->offset + section_header->name);
|
||||
CCC_CHECK(name.has_value(), "ELF section name out of range.");
|
||||
|
||||
ElfSection& section = elf.sections.emplace_back();
|
||||
section.name = name;
|
||||
section.name = *name;
|
||||
section.header = *section_header;
|
||||
}
|
||||
|
||||
for(u32 i = 0; i < header->phnum; i++) {
|
||||
u64 header_offset = header->phoff + i * sizeof(ElfProgramHeader);
|
||||
const ElfProgramHeader* program_header = get_packed<ElfProgramHeader>(elf.image, header_offset);
|
||||
const ElfProgramHeader* program_header = get_unaligned<ElfProgramHeader>(elf.image, header_offset);
|
||||
CCC_CHECK(program_header, "ELF program header out of range.");
|
||||
|
||||
elf.segments.emplace_back(*program_header);
|
||||
@@ -93,7 +94,7 @@ const ElfProgramHeader* ElfFile::entry_point_segment() const
|
||||
return entry_segment;
|
||||
}
|
||||
|
||||
Result<std::span<const u8>> ElfFile::get_virtual(u32 address, u32 size) const
|
||||
std::optional<std::span<const u8>> ElfFile::get_virtual(u32 address, u32 size) const
|
||||
{
|
||||
u32 end_address = address + size;
|
||||
|
||||
@@ -109,17 +110,19 @@ Result<std::span<const u8>> ElfFile::get_virtual(u32 address, u32 size) const
|
||||
}
|
||||
}
|
||||
|
||||
return CCC_FAILURE("No ELF segment for address range 0x%x to 0x%x.", address, end_address);
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
Result<void> ElfFile::copy_virtual(u8* dest, u32 address, u32 size) const
|
||||
bool ElfFile::copy_virtual(u8* dest, u32 address, u32 size) const
|
||||
{
|
||||
Result<std::span<const u8>> block = get_virtual(address, size);
|
||||
CCC_RETURN_IF_ERROR(block);
|
||||
std::optional<std::span<const u8>> block = get_virtual(address, size);
|
||||
if(!block.has_value()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
memcpy(dest, block->data(), size);
|
||||
|
||||
return Result<void>();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
20
3rdparty/ccc/src/ccc/elf.h
vendored
20
3rdparty/ccc/src/ccc/elf.h
vendored
@@ -125,18 +125,20 @@ struct ElfFile {
|
||||
const ElfProgramHeader* entry_point_segment() const;
|
||||
|
||||
// Retrieve a block of data in an ELF file given its address and size.
|
||||
Result<std::span<const u8>> get_virtual(u32 address, u32 size) const;
|
||||
std::optional<std::span<const u8>> get_virtual(u32 address, u32 size) const;
|
||||
|
||||
// Copy a block of data in an ELF file to the destination buffer given its
|
||||
// address and size.
|
||||
Result<void> copy_virtual(u8* dest, u32 address, u32 size) const;
|
||||
bool copy_virtual(u8* dest, u32 address, u32 size) const;
|
||||
|
||||
// Retrieve an object of type T from an ELF file given its address.
|
||||
template <typename T>
|
||||
Result<T> get_object_virtual(u32 address) const
|
||||
std::optional<T> get_object_virtual(u32 address) const
|
||||
{
|
||||
Result<std::span<const u8>> result = get_virtual(address, sizeof(T));
|
||||
CCC_RETURN_IF_ERROR(result);
|
||||
std::optional<std::span<const u8>> result = get_virtual(address, sizeof(T));
|
||||
if(!result.has_value()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return *(T*) result->data();
|
||||
}
|
||||
@@ -144,10 +146,12 @@ struct ElfFile {
|
||||
// Retrieve an array of objects of type T from an ELF file given its
|
||||
// address and element count.
|
||||
template <typename T>
|
||||
Result<std::span<const T>> get_array_virtual(u32 address, u32 element_count) const
|
||||
std::optional<std::span<const T>> get_array_virtual(u32 address, u32 element_count) const
|
||||
{
|
||||
Result<std::span<const u8>> result = get_virtual(address, element_count * sizeof(T));
|
||||
CCC_RETURN_IF_ERROR(result);
|
||||
std::optional<std::span<const u8>> result = get_virtual(address, element_count * sizeof(T));
|
||||
if(!result.has_value()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return std::span<const T>((T*) result->data(), (T*) (result->data() + result->size()));
|
||||
}
|
||||
|
||||
25
3rdparty/ccc/src/ccc/elf_symtab.cpp
vendored
25
3rdparty/ccc/src/ccc/elf_symtab.cpp
vendored
@@ -60,7 +60,7 @@ Result<void> import_symbols(
|
||||
DemanglerFunctions demangler)
|
||||
{
|
||||
for(u32 i = 0; i < symtab.size() / sizeof(Symbol); i++) {
|
||||
const Symbol* symbol = get_packed<Symbol>(symtab, i * sizeof(Symbol));
|
||||
const Symbol* symbol = get_unaligned<Symbol>(symtab, i * sizeof(Symbol));
|
||||
CCC_ASSERT(symbol);
|
||||
|
||||
Address address;
|
||||
@@ -86,13 +86,14 @@ Result<void> import_symbols(
|
||||
}
|
||||
}
|
||||
|
||||
const char* string = get_string(strtab, symbol->name);
|
||||
CCC_CHECK(string, "Symbol string out of range.");
|
||||
std::optional<std::string_view> string_view = get_string(strtab, symbol->name);
|
||||
CCC_CHECK(string_view.has_value(), "Symbol string out of range.");
|
||||
std::string string(*string_view);
|
||||
|
||||
switch(symbol->type()) {
|
||||
case SymbolType::NOTYPE: {
|
||||
Result<Label*> label = database.labels.create_symbol(
|
||||
string, group.source, group.module_symbol, address, importer_flags, demangler);
|
||||
std::move(string), group.source, group.module_symbol, address, importer_flags, demangler);
|
||||
CCC_RETURN_IF_ERROR(label);
|
||||
|
||||
// These symbols get emitted at the same addresses as functions
|
||||
@@ -108,7 +109,7 @@ Result<void> import_symbols(
|
||||
case SymbolType::OBJECT: {
|
||||
if(symbol->size != 0) {
|
||||
Result<GlobalVariable*> global_variable = database.global_variables.create_symbol(
|
||||
string, group.source, group.module_symbol, address, importer_flags, demangler);
|
||||
std::move(string), group.source, group.module_symbol, address, importer_flags, demangler);
|
||||
CCC_RETURN_IF_ERROR(global_variable);
|
||||
|
||||
if(*global_variable) {
|
||||
@@ -116,7 +117,7 @@ Result<void> import_symbols(
|
||||
}
|
||||
} else {
|
||||
Result<Label*> label = database.labels.create_symbol(
|
||||
string, group.source, group.module_symbol, address, importer_flags, demangler);
|
||||
std::move(string), group.source, group.module_symbol, address, importer_flags, demangler);
|
||||
CCC_RETURN_IF_ERROR(label);
|
||||
}
|
||||
|
||||
@@ -124,7 +125,7 @@ Result<void> import_symbols(
|
||||
}
|
||||
case SymbolType::FUNC: {
|
||||
Result<Function*> function = database.functions.create_symbol(
|
||||
string, group.source, group.module_symbol, address, importer_flags, demangler);
|
||||
std::move(string), group.source, group.module_symbol, address, importer_flags, demangler);
|
||||
CCC_RETURN_IF_ERROR(function);
|
||||
|
||||
if(*function) {
|
||||
@@ -135,7 +136,7 @@ Result<void> import_symbols(
|
||||
}
|
||||
case SymbolType::FILE: {
|
||||
Result<SourceFile*> source_file = database.source_files.create_symbol(
|
||||
string, group.source, group.module_symbol);
|
||||
std::move(string), group.source, group.module_symbol);
|
||||
CCC_RETURN_IF_ERROR(source_file);
|
||||
|
||||
break;
|
||||
@@ -153,18 +154,18 @@ Result<void> print_symbol_table(FILE* out, std::span<const u8> symtab, std::span
|
||||
fprintf(out, " Num: Value Size Type Bind Vis Ndx Name\n");
|
||||
|
||||
for(u32 i = 0; i < symtab.size() / sizeof(Symbol); i++) {
|
||||
const Symbol* symbol = get_packed<Symbol>(symtab, i * sizeof(Symbol));
|
||||
const Symbol* symbol = get_unaligned<Symbol>(symtab, i * sizeof(Symbol));
|
||||
CCC_ASSERT(symbol);
|
||||
|
||||
const char* type = symbol_type_to_string(symbol->type());
|
||||
const char* bind = symbol_bind_to_string(symbol->bind());
|
||||
const char* visibility = symbol_visibility_to_string(symbol->visibility());
|
||||
|
||||
const char* string = get_string(strtab, symbol->name);
|
||||
CCC_CHECK(string, "Symbol string out of range.");
|
||||
std::optional<std::string_view> string = get_string(strtab, symbol->name);
|
||||
CCC_CHECK(string.has_value(), "Symbol string out of range.");
|
||||
|
||||
fprintf(out, "%6u: %08x %5u %-7s %-7s %-7s %3u %s\n",
|
||||
i, symbol->value, symbol->size, type, bind, visibility, symbol->shndx, string);
|
||||
i, symbol->value, symbol->size, type, bind, visibility, symbol->shndx, string->data());
|
||||
|
||||
}
|
||||
|
||||
|
||||
22
3rdparty/ccc/src/ccc/mdebug_section.cpp
vendored
22
3rdparty/ccc/src/ccc/mdebug_section.cpp
vendored
@@ -90,7 +90,7 @@ Result<void> SymbolTableReader::init(std::span<const u8> elf, s32 section_offset
|
||||
m_elf = elf;
|
||||
m_section_offset = section_offset;
|
||||
|
||||
m_hdrr = get_packed<SymbolicHeader>(m_elf, m_section_offset);
|
||||
m_hdrr = get_unaligned<SymbolicHeader>(m_elf, m_section_offset);
|
||||
CCC_CHECK(m_hdrr != nullptr, "MIPS debug section header out of bounds.");
|
||||
CCC_CHECK(m_hdrr->magic == 0x7009, "Invalid symbolic header.");
|
||||
|
||||
@@ -116,7 +116,7 @@ Result<File> SymbolTableReader::parse_file(s32 index) const
|
||||
File file;
|
||||
|
||||
u64 fd_offset = m_hdrr->file_descriptors_offset + index * sizeof(FileDescriptor);
|
||||
const FileDescriptor* fd_header = get_packed<FileDescriptor>(m_elf, fd_offset + m_fudge_offset);
|
||||
const FileDescriptor* fd_header = get_unaligned<FileDescriptor>(m_elf, fd_offset + m_fudge_offset);
|
||||
CCC_CHECK(fd_header != nullptr, "MIPS debug file descriptor out of bounds.");
|
||||
CCC_CHECK(fd_header->f_big_endian == 0, "Not little endian or bad file descriptor table.");
|
||||
|
||||
@@ -124,16 +124,16 @@ Result<File> SymbolTableReader::parse_file(s32 index) const
|
||||
|
||||
s32 rel_raw_path_offset = fd_header->strings_offset + fd_header->file_path_string_offset;
|
||||
s32 raw_path_offset = m_hdrr->local_strings_offset + rel_raw_path_offset + m_fudge_offset;
|
||||
const char* command_line_path = get_string(m_elf, raw_path_offset);
|
||||
if(command_line_path) {
|
||||
file.command_line_path = command_line_path;
|
||||
std::optional<std::string_view> command_line_path = get_string(m_elf, raw_path_offset);
|
||||
if(command_line_path.has_value()) {
|
||||
file.command_line_path = *command_line_path;
|
||||
}
|
||||
|
||||
// Parse local symbols.
|
||||
for(s64 j = 0; j < fd_header->symbol_count; j++) {
|
||||
u64 rel_symbol_offset = (fd_header->isym_base + j) * sizeof(SymbolHeader);
|
||||
u64 symbol_offset = m_hdrr->local_symbols_offset + rel_symbol_offset + m_fudge_offset;
|
||||
const SymbolHeader* symbol_header = get_packed<SymbolHeader>(m_elf, symbol_offset);
|
||||
const SymbolHeader* symbol_header = get_unaligned<SymbolHeader>(m_elf, symbol_offset);
|
||||
CCC_CHECK(symbol_header != nullptr, "Symbol header out of bounds.");
|
||||
|
||||
s32 strings_offset = m_hdrr->local_strings_offset + fd_header->strings_offset + m_fudge_offset;
|
||||
@@ -155,7 +155,7 @@ Result<File> SymbolTableReader::parse_file(s32 index) const
|
||||
for(s64 i = 0; i < fd_header->procedure_descriptor_count; i++) {
|
||||
u64 rel_procedure_offset = (fd_header->ipd_first + i) * sizeof(ProcedureDescriptor);
|
||||
u64 procedure_offset = m_hdrr->procedure_descriptors_offset + rel_procedure_offset + m_fudge_offset;
|
||||
const ProcedureDescriptor* procedure_descriptor = get_packed<ProcedureDescriptor>(m_elf, procedure_offset);
|
||||
const ProcedureDescriptor* procedure_descriptor = get_unaligned<ProcedureDescriptor>(m_elf, procedure_offset);
|
||||
CCC_CHECK(procedure_descriptor != nullptr, "Procedure descriptor out of bounds.");
|
||||
|
||||
CCC_CHECK(procedure_descriptor->symbol_index < file.symbols.size(), "Symbol index out of bounds.");
|
||||
@@ -175,7 +175,7 @@ Result<std::vector<Symbol>> SymbolTableReader::parse_external_symbols() const
|
||||
std::vector<Symbol> external_symbols;
|
||||
for(s64 i = 0; i < m_hdrr->external_symbols_count; i++) {
|
||||
u64 sym_offset = m_hdrr->external_symbols_offset + i * sizeof(ExternalSymbolHeader);
|
||||
const ExternalSymbolHeader* external_header = get_packed<ExternalSymbolHeader>(m_elf, sym_offset + m_fudge_offset);
|
||||
const ExternalSymbolHeader* external_header = get_unaligned<ExternalSymbolHeader>(m_elf, sym_offset + m_fudge_offset);
|
||||
CCC_CHECK(external_header != nullptr, "External header out of bounds.");
|
||||
|
||||
Result<Symbol> sym = get_symbol(external_header->symbol, m_elf, m_hdrr->external_strings_offset + m_fudge_offset);
|
||||
@@ -351,9 +351,9 @@ static Result<Symbol> get_symbol(const SymbolHeader& header, std::span<const u8>
|
||||
{
|
||||
Symbol symbol;
|
||||
|
||||
const char* string = get_string(elf, strings_offset + header.iss);
|
||||
CCC_CHECK(string, "Symbol has invalid string.");
|
||||
symbol.string = string;
|
||||
std::optional<std::string_view> string = get_string(elf, strings_offset + header.iss);
|
||||
CCC_CHECK(string.has_value(), "Symbol has invalid string.");
|
||||
symbol.string = string->data();
|
||||
|
||||
symbol.value = header.value;
|
||||
symbol.symbol_type = (SymbolType) header.st;
|
||||
|
||||
22
3rdparty/ccc/src/ccc/sndll.cpp
vendored
22
3rdparty/ccc/src/ccc/sndll.cpp
vendored
@@ -54,18 +54,19 @@ static const char* sndll_symbol_type_to_string(SNDLLSymbolType type);
|
||||
|
||||
Result<SNDLLFile> parse_sndll_file(std::span<const u8> image, Address address, SNDLLType type)
|
||||
{
|
||||
const u32* magic = get_packed<u32>(image, 0);
|
||||
std::optional<u32> magic = copy_unaligned<u32>(image, 0);
|
||||
CCC_CHECK(magic.has_value(), "Failed to read SNDLL header.");
|
||||
CCC_CHECK((*magic & 0xffffff) == CCC_FOURCC("SNR\00"), "Not a SNDLL %s.", address.valid() ? "section" : "file");
|
||||
|
||||
char version = *magic >> 24;
|
||||
switch(version) {
|
||||
case '1': {
|
||||
const SNDLLHeaderV1* header = get_packed<SNDLLHeaderV1>(image, 0);
|
||||
const SNDLLHeaderV1* header = get_unaligned<SNDLLHeaderV1>(image, 0);
|
||||
CCC_CHECK(header, "File too small to contain SNDLL V1 header.");
|
||||
return parse_sndll_common(image, address, type, header->common, SNDLL_V1);
|
||||
}
|
||||
case '2': {
|
||||
const SNDLLHeaderV2* header = get_packed<SNDLLHeaderV2>(image, 0);
|
||||
const SNDLLHeaderV2* header = get_unaligned<SNDLLHeaderV2>(image, 0);
|
||||
CCC_CHECK(header, "File too small to contain SNDLL V2 header.");
|
||||
return parse_sndll_common(image, address, type, header->common, SNDLL_V2);
|
||||
}
|
||||
@@ -84,10 +85,9 @@ static Result<SNDLLFile> parse_sndll_common(
|
||||
sndll.version = version;
|
||||
|
||||
if(common.elf_path) {
|
||||
const char* elf_path = get_string(image, common.elf_path);
|
||||
if(elf_path) {
|
||||
sndll.elf_path = elf_path;
|
||||
}
|
||||
std::optional<std::string_view> elf_path = get_string(image, common.elf_path);
|
||||
CCC_CHECK(elf_path.has_value(), "SNDLL header has invalid ELF path field.");
|
||||
sndll.elf_path = *elf_path;
|
||||
}
|
||||
|
||||
CCC_CHECK(common.symbol_count < (32 * 1024 * 1024) / sizeof(SNDLLSymbol), "SNDLL symbol count is too high.");
|
||||
@@ -95,10 +95,10 @@ static Result<SNDLLFile> parse_sndll_common(
|
||||
|
||||
for(u32 i = 0; i < common.symbol_count; i++) {
|
||||
u32 symbol_offset = common.symbols - address.get_or_zero() + i * sizeof(SNDLLSymbolHeader);
|
||||
const SNDLLSymbolHeader* symbol_header = get_packed<SNDLLSymbolHeader>(image, symbol_offset);
|
||||
const SNDLLSymbolHeader* symbol_header = get_unaligned<SNDLLSymbolHeader>(image, symbol_offset);
|
||||
CCC_CHECK(symbol_header, "SNDLL symbol out of range.");
|
||||
|
||||
const char* string = nullptr;
|
||||
std::optional<std::string_view> string;
|
||||
if(symbol_header->string) {
|
||||
string = get_string(image, symbol_header->string - address.get_or_zero());
|
||||
}
|
||||
@@ -106,7 +106,9 @@ static Result<SNDLLFile> parse_sndll_common(
|
||||
SNDLLSymbol& symbol = sndll.symbols.emplace_back();
|
||||
symbol.type = symbol_header->type;
|
||||
symbol.value = symbol_header->value;
|
||||
symbol.string = string;
|
||||
if(string.has_value()) {
|
||||
symbol.string = *string;
|
||||
}
|
||||
}
|
||||
|
||||
return sndll;
|
||||
|
||||
2
3rdparty/ccc/src/ccc/symbol_database.cpp
vendored
2
3rdparty/ccc/src/ccc/symbol_database.cpp
vendored
@@ -753,7 +753,7 @@ void SourceFile::check_functions_match(const SymbolDatabase& database)
|
||||
u32 modified = 0;
|
||||
for(FunctionHandle function_handle : functions()) {
|
||||
const ccc::Function* function = database.functions.symbol_from_handle(function_handle);
|
||||
if(!function || function->original_hash() == 0) {
|
||||
if(!function || function->current_hash() == 0 || function->original_hash() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
2
3rdparty/ccc/src/ccc/symbol_database.h
vendored
2
3rdparty/ccc/src/ccc/symbol_database.h
vendored
@@ -435,7 +435,7 @@ class Label : public Symbol {
|
||||
public:
|
||||
static constexpr const SymbolDescriptor DESCRIPTOR = LABEL;
|
||||
static constexpr const char* NAME = "Label";
|
||||
static constexpr u32 FLAGS = WITH_ADDRESS_MAP;
|
||||
static constexpr u32 FLAGS = WITH_ADDRESS_MAP | WITH_NAME_MAP;
|
||||
|
||||
LabelHandle handle() const { return m_handle; }
|
||||
|
||||
|
||||
4
3rdparty/ccc/src/ccc/symbol_file.cpp
vendored
4
3rdparty/ccc/src/ccc/symbol_file.cpp
vendored
@@ -7,8 +7,8 @@ namespace ccc {
|
||||
|
||||
Result<std::unique_ptr<SymbolFile>> parse_symbol_file(std::vector<u8> image, std::string file_name)
|
||||
{
|
||||
const u32* magic = get_packed<u32>(image, 0);
|
||||
CCC_CHECK(magic, "File too small.");
|
||||
const std::optional<u32> magic = copy_unaligned<u32>(image, 0);
|
||||
CCC_CHECK(magic.has_value(), "File too small.");
|
||||
|
||||
std::unique_ptr<SymbolFile> symbol_file;
|
||||
|
||||
|
||||
6
3rdparty/ccc/src/ccc/symbol_table.cpp
vendored
6
3rdparty/ccc/src/ccc/symbol_table.cpp
vendored
@@ -100,8 +100,9 @@ Result<std::unique_ptr<SymbolTable>> create_elf_symbol_table(
|
||||
|
||||
Result<ModuleHandle> import_symbol_tables(
|
||||
SymbolDatabase& database,
|
||||
std::string module_name,
|
||||
const std::vector<std::unique_ptr<SymbolTable>>& symbol_tables,
|
||||
std::string module_name,
|
||||
Address base_address,
|
||||
u32 importer_flags,
|
||||
DemanglerFunctions demangler,
|
||||
const std::atomic_bool* interrupt)
|
||||
@@ -109,7 +110,8 @@ Result<ModuleHandle> import_symbol_tables(
|
||||
Result<SymbolSourceHandle> module_source = database.get_symbol_source("Symbol Table Importer");
|
||||
CCC_RETURN_IF_ERROR(module_source);
|
||||
|
||||
Result<Module*> module_symbol = database.modules.create_symbol(std::move(module_name), *module_source, nullptr);
|
||||
Result<Module*> module_symbol = database.modules.create_symbol(
|
||||
std::move(module_name), base_address, *module_source, nullptr);
|
||||
CCC_RETURN_IF_ERROR(module_symbol);
|
||||
|
||||
ModuleHandle module_handle = (*module_symbol)->handle();
|
||||
|
||||
3
3rdparty/ccc/src/ccc/symbol_table.h
vendored
3
3rdparty/ccc/src/ccc/symbol_table.h
vendored
@@ -71,8 +71,9 @@ Result<std::unique_ptr<SymbolTable>> create_elf_symbol_table(
|
||||
// and to generate a module handle.
|
||||
Result<ModuleHandle> import_symbol_tables(
|
||||
SymbolDatabase& database,
|
||||
std::string module_name,
|
||||
const std::vector<std::unique_ptr<SymbolTable>>& symbol_tables,
|
||||
std::string module_name,
|
||||
Address base_address,
|
||||
u32 importer_flags,
|
||||
DemanglerFunctions demangler,
|
||||
const std::atomic_bool* interrupt);
|
||||
|
||||
13
3rdparty/ccc/src/ccc/util.cpp
vendored
13
3rdparty/ccc/src/ccc/util.cpp
vendored
@@ -51,14 +51,17 @@ void set_custom_error_callback(CustomErrorCallback callback)
|
||||
custom_error_callback = callback;
|
||||
}
|
||||
|
||||
const char* get_string(std::span<const u8> bytes, u64 offset)
|
||||
std::optional<std::string_view> get_string(std::span<const u8> bytes, u64 offset)
|
||||
{
|
||||
for(const unsigned char* c = bytes.data() + offset; c < bytes.data() + bytes.size(); c++) {
|
||||
if(*c == '\0') {
|
||||
return (const char*) &bytes[offset];
|
||||
for(u64 i = offset; i < bytes.size(); i++) {
|
||||
if(bytes[i] == '\0') {
|
||||
return std::string_view(
|
||||
reinterpret_cast<const char*>(&bytes[offset]),
|
||||
reinterpret_cast<const char*>(&bytes[i]));
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::string merge_paths(const std::string& base, const std::string& path)
|
||||
|
||||
41
3rdparty/ccc/src/ccc/util.h
vendored
41
3rdparty/ccc/src/ccc/util.h
vendored
@@ -71,8 +71,15 @@ void set_custom_error_callback(CustomErrorCallback callback);
|
||||
exit(1); \
|
||||
}
|
||||
|
||||
#define CCC_ABORT_IF_FALSE(condition, ...) \
|
||||
if(!(condition)) { \
|
||||
ccc::Error error = ccc::format_error(__FILE__, __LINE__, __VA_ARGS__); \
|
||||
ccc::report_error(error); \
|
||||
abort(); \
|
||||
}
|
||||
|
||||
#define CCC_ASSERT(condition) \
|
||||
CCC_CHECK_FATAL(condition, #condition)
|
||||
CCC_ABORT_IF_FALSE(condition, #condition)
|
||||
|
||||
// The main error handling construct in CCC. This class is used to bundle
|
||||
// together a return value and a pointer to error information, so that errors
|
||||
@@ -201,16 +208,38 @@ void warn_impl(const char* source_file, int source_line, const char* format, Arg
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
const T* get_packed(std::span<const u8> bytes, u64 offset)
|
||||
const T* get_aligned(std::span<const u8> bytes, u64 offset)
|
||||
{
|
||||
if(offset + sizeof(T) <= bytes.size()) {
|
||||
return reinterpret_cast<const T*>(&bytes[offset]);
|
||||
} else {
|
||||
if(offset > bytes.size() || bytes.size() - offset < sizeof(T) || offset % alignof(T) != 0) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return reinterpret_cast<const T*>(&bytes[offset]);
|
||||
}
|
||||
|
||||
const char* get_string(std::span<const u8> bytes, u64 offset);
|
||||
template <typename T>
|
||||
const T* get_unaligned(std::span<const u8> bytes, u64 offset)
|
||||
{
|
||||
if(offset > bytes.size() || bytes.size() - offset < sizeof(T)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return reinterpret_cast<const T*>(&bytes[offset]);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::optional<T> copy_unaligned(std::span<const u8> bytes, u64 offset)
|
||||
{
|
||||
if(offset > bytes.size() || bytes.size() - offset < sizeof(T)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
T value;
|
||||
memcpy(&value, &bytes[offset], sizeof(T));
|
||||
return value;
|
||||
}
|
||||
|
||||
std::optional<std::string_view> get_string(std::span<const u8> bytes, u64 offset);
|
||||
|
||||
#define CCC_BEGIN_END(x) (x).begin(), (x).end()
|
||||
#define CCC_ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
2
3rdparty/cpuinfo/include/cpuinfo-mock.h
vendored
2
3rdparty/cpuinfo/include/cpuinfo-mock.h
vendored
@@ -60,7 +60,7 @@ ssize_t CPUINFO_ABI cpuinfo_mock_read(int fd, void* buffer, size_t capacity);
|
||||
void CPUINFO_ABI cpuinfo_set_hwcap(uint32_t hwcap);
|
||||
#endif
|
||||
#if CPUINFO_ARCH_ARM
|
||||
void CPUINFO_ABI cpuinfo_set_hwcap2(uint32_t hwcap2);
|
||||
void CPUINFO_ABI cpuinfo_set_hwcap2(uint64_t hwcap2);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
79
3rdparty/cpuinfo/include/cpuinfo.h
vendored
79
3rdparty/cpuinfo/include/cpuinfo.h
vendored
@@ -496,13 +496,19 @@ enum cpuinfo_uarch {
|
||||
cpuinfo_uarch_cortex_x2 = 0x00300502,
|
||||
/** ARM Cortex-X3. */
|
||||
cpuinfo_uarch_cortex_x3 = 0x00300503,
|
||||
/** ARM Cortex-X4. */
|
||||
cpuinfo_uarch_cortex_x4 = 0x00300504,
|
||||
|
||||
/** ARM Cortex-A510. */
|
||||
cpuinfo_uarch_cortex_a510 = 0x00300551,
|
||||
/** ARM Cortex-A520. */
|
||||
cpuinfo_uarch_cortex_a520 = 0x00300552,
|
||||
/** ARM Cortex-A710. */
|
||||
cpuinfo_uarch_cortex_a710 = 0x00300571,
|
||||
/** ARM Cortex-A715. */
|
||||
cpuinfo_uarch_cortex_a715 = 0x00300572,
|
||||
/** ARM Cortex-A720. */
|
||||
cpuinfo_uarch_cortex_a720 = 0x00300573,
|
||||
|
||||
/** Qualcomm Scorpion. */
|
||||
cpuinfo_uarch_scorpion = 0x00400100,
|
||||
@@ -1664,6 +1670,14 @@ struct cpuinfo_arm_isa {
|
||||
bool sve;
|
||||
bool sve2;
|
||||
bool i8mm;
|
||||
bool sme;
|
||||
bool sme2;
|
||||
bool sme2p1;
|
||||
bool sme_i16i32;
|
||||
bool sme_bi32i32;
|
||||
bool sme_b16b16;
|
||||
bool sme_f16f16;
|
||||
uint32_t svelen;
|
||||
#endif
|
||||
bool rdm;
|
||||
bool fp16arith;
|
||||
@@ -2036,6 +2050,71 @@ static inline bool cpuinfo_has_arm_sve2(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
// Function to get the max SVE vector length on ARM CPU's which support SVE.
|
||||
static inline uint32_t cpuinfo_get_max_arm_sve_length(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.svelen * 8; // bytes * 8 = bit length(vector length)
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_sme(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.sme;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_sme2(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.sme2;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_sme2p1(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.sme2p1;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_sme_i16i32(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.sme_i16i32;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_sme_bi32i32(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.sme_bi32i32;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_sme_b16b16(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.sme_b16b16;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool cpuinfo_has_arm_sme_f16f16(void) {
|
||||
#if CPUINFO_ARCH_ARM64
|
||||
return cpuinfo_isa.sme_f16f16;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
|
||||
/* This structure is not a part of stable API. Use cpuinfo_has_riscv_* functions
|
||||
* instead. */
|
||||
|
||||
1
3rdparty/cpuinfo/src/arm/api.h
vendored
1
3rdparty/cpuinfo/src/arm/api.h
vendored
@@ -64,6 +64,7 @@ enum cpuinfo_arm_chipset_series {
|
||||
cpuinfo_arm_chipset_series_telechips_tcc,
|
||||
cpuinfo_arm_chipset_series_texas_instruments_omap,
|
||||
cpuinfo_arm_chipset_series_unisoc_t,
|
||||
cpuinfo_arm_chipset_series_unisoc_ums,
|
||||
cpuinfo_arm_chipset_series_wondermedia_wm,
|
||||
cpuinfo_arm_chipset_series_max,
|
||||
};
|
||||
|
||||
4
3rdparty/cpuinfo/src/arm/linux/aarch32-isa.c
vendored
4
3rdparty/cpuinfo/src/arm/linux/aarch32-isa.c
vendored
@@ -24,7 +24,7 @@ void cpuinfo_set_wcid(uint32_t wcid) {
|
||||
|
||||
void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
|
||||
uint32_t features,
|
||||
uint32_t features2,
|
||||
uint64_t features2,
|
||||
uint32_t midr,
|
||||
uint32_t architecture_version,
|
||||
uint32_t architecture_flags,
|
||||
@@ -147,6 +147,8 @@ void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
|
||||
"VDOT instructions disabled: cause occasional SIGILL on Spreadtrum SC9863A");
|
||||
} else if (chipset->series == cpuinfo_arm_chipset_series_unisoc_t && chipset->model == 310) {
|
||||
cpuinfo_log_warning("VDOT instructions disabled: cause occasional SIGILL on Unisoc T310");
|
||||
} else if (chipset->series == cpuinfo_arm_chipset_series_unisoc_ums && chipset->model == 312) {
|
||||
cpuinfo_log_warning("VDOT instructions disabled: cause occasional SIGILL on Unisoc UMS312");
|
||||
} else {
|
||||
switch (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
|
||||
case UINT32_C(0x4100D0B0): /* Cortex-A76 */
|
||||
|
||||
42
3rdparty/cpuinfo/src/arm/linux/aarch64-isa.c
vendored
42
3rdparty/cpuinfo/src/arm/linux/aarch64-isa.c
vendored
@@ -3,9 +3,11 @@
|
||||
#include <arm/linux/api.h>
|
||||
#include <cpuinfo/log.h>
|
||||
|
||||
#include <sys/prctl.h>
|
||||
|
||||
void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
|
||||
uint32_t features,
|
||||
uint32_t features2,
|
||||
uint64_t features2,
|
||||
uint32_t midr,
|
||||
const struct cpuinfo_arm_chipset chipset[restrict static 1],
|
||||
struct cpuinfo_arm_isa isa[restrict static 1]) {
|
||||
@@ -142,6 +144,27 @@ void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
|
||||
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SVE2) {
|
||||
isa->sve2 = true;
|
||||
}
|
||||
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SME) {
|
||||
isa->sme = true;
|
||||
}
|
||||
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SME2) {
|
||||
isa->sme2 = true;
|
||||
}
|
||||
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SME2P1) {
|
||||
isa->sme2p1 = true;
|
||||
}
|
||||
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SME_I16I32) {
|
||||
isa->sme_i16i32 = true;
|
||||
}
|
||||
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SME_BI32I32) {
|
||||
isa->sme_bi32i32 = true;
|
||||
}
|
||||
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SME_B16B16) {
|
||||
isa->sme_b16b16 = true;
|
||||
}
|
||||
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SME_F16F16) {
|
||||
isa->sme_f16f16 = true;
|
||||
}
|
||||
// SVEBF16 is set iff SVE and BF16 are both supported, but the SVEBF16
|
||||
// feature flag was added in Linux kernel before the BF16 feature flag,
|
||||
// so we check for either.
|
||||
@@ -151,4 +174,21 @@ void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
|
||||
if (features & CPUINFO_ARM_LINUX_FEATURE_ASIMDFHM) {
|
||||
isa->fhm = true;
|
||||
}
|
||||
|
||||
#ifndef PR_SVE_GET_VL
|
||||
#define PR_SVE_GET_VL 51
|
||||
#endif
|
||||
|
||||
#ifndef PR_SVE_VL_LEN_MASK
|
||||
#define PR_SVE_VL_LEN_MASK 0xffff
|
||||
#endif
|
||||
|
||||
int ret = prctl(PR_SVE_GET_VL);
|
||||
if (ret < 0) {
|
||||
cpuinfo_log_warning("No SVE support on this machine");
|
||||
isa->svelen = 0; // Assume no SVE support if the call fails
|
||||
} else {
|
||||
// Mask out the SVE vector length bits
|
||||
isa->svelen = ret & PR_SVE_VL_LEN_MASK;
|
||||
}
|
||||
}
|
||||
|
||||
19
3rdparty/cpuinfo/src/arm/linux/api.h
vendored
19
3rdparty/cpuinfo/src/arm/linux/api.h
vendored
@@ -137,6 +137,13 @@ struct cpuinfo_arm_linux_proc_cpuinfo_cache {
|
||||
#define CPUINFO_ARM_LINUX_FEATURE2_DGH UINT32_C(0x00008000)
|
||||
#define CPUINFO_ARM_LINUX_FEATURE2_RNG UINT32_C(0x00010000)
|
||||
#define CPUINFO_ARM_LINUX_FEATURE2_BTI UINT32_C(0x00020000)
|
||||
#define CPUINFO_ARM_LINUX_FEATURE2_SME UINT32_C(0x00800000)
|
||||
#define CPUINFO_ARM_LINUX_FEATURE2_SME2 UINT64_C(0x0000002000000000)
|
||||
#define CPUINFO_ARM_LINUX_FEATURE2_SME2P1 UINT64_C(0x0000004000000000)
|
||||
#define CPUINFO_ARM_LINUX_FEATURE2_SME_I16I32 UINT64_C(0x0000008000000000)
|
||||
#define CPUINFO_ARM_LINUX_FEATURE2_SME_BI32I32 UINT64_C(0x0000010000000000)
|
||||
#define CPUINFO_ARM_LINUX_FEATURE2_SME_B16B16 UINT64_C(0x0000020000000000)
|
||||
#define CPUINFO_ARM_LINUX_FEATURE2_SME_F16F16 UINT64_C(0x0000040000000000)
|
||||
#endif
|
||||
|
||||
#define CPUINFO_ARM_LINUX_VALID_ARCHITECTURE UINT32_C(0x00010000)
|
||||
@@ -172,7 +179,7 @@ struct cpuinfo_arm_linux_processor {
|
||||
struct cpuinfo_arm_linux_proc_cpuinfo_cache proc_cpuinfo_cache;
|
||||
#endif
|
||||
uint32_t features;
|
||||
uint32_t features2;
|
||||
uint64_t features2;
|
||||
/**
|
||||
* Main ID Register value.
|
||||
*/
|
||||
@@ -295,14 +302,14 @@ CPUINFO_INTERNAL bool cpuinfo_arm_linux_parse_proc_cpuinfo(
|
||||
#if CPUINFO_ARCH_ARM
|
||||
CPUINFO_INTERNAL bool cpuinfo_arm_linux_hwcap_from_getauxval(
|
||||
uint32_t hwcap[restrict static 1],
|
||||
uint32_t hwcap2[restrict static 1]);
|
||||
uint64_t hwcap2[restrict static 1]);
|
||||
CPUINFO_INTERNAL bool cpuinfo_arm_linux_hwcap_from_procfs(
|
||||
uint32_t hwcap[restrict static 1],
|
||||
uint32_t hwcap2[restrict static 1]);
|
||||
uint64_t hwcap2[restrict static 1]);
|
||||
|
||||
CPUINFO_INTERNAL void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
|
||||
uint32_t features,
|
||||
uint32_t features2,
|
||||
uint64_t features2,
|
||||
uint32_t midr,
|
||||
uint32_t architecture_version,
|
||||
uint32_t architecture_flags,
|
||||
@@ -311,11 +318,11 @@ CPUINFO_INTERNAL void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
|
||||
#elif CPUINFO_ARCH_ARM64
|
||||
CPUINFO_INTERNAL void cpuinfo_arm_linux_hwcap_from_getauxval(
|
||||
uint32_t hwcap[restrict static 1],
|
||||
uint32_t hwcap2[restrict static 1]);
|
||||
uint64_t hwcap2[restrict static 1]);
|
||||
|
||||
CPUINFO_INTERNAL void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
|
||||
uint32_t features,
|
||||
uint32_t features2,
|
||||
uint64_t features2,
|
||||
uint32_t midr,
|
||||
const struct cpuinfo_arm_chipset chipset[restrict static 1],
|
||||
struct cpuinfo_arm_isa isa[restrict static 1]);
|
||||
|
||||
76
3rdparty/cpuinfo/src/arm/linux/chipset.c
vendored
76
3rdparty/cpuinfo/src/arm/linux/chipset.c
vendored
@@ -85,6 +85,7 @@ static enum cpuinfo_arm_chipset_vendor chipset_series_vendor[cpuinfo_arm_chipset
|
||||
[cpuinfo_arm_chipset_series_telechips_tcc] = cpuinfo_arm_chipset_vendor_telechips,
|
||||
[cpuinfo_arm_chipset_series_texas_instruments_omap] = cpuinfo_arm_chipset_vendor_texas_instruments,
|
||||
[cpuinfo_arm_chipset_series_unisoc_t] = cpuinfo_arm_chipset_vendor_unisoc,
|
||||
[cpuinfo_arm_chipset_series_unisoc_ums] = cpuinfo_arm_chipset_vendor_unisoc,
|
||||
[cpuinfo_arm_chipset_series_wondermedia_wm] = cpuinfo_arm_chipset_vendor_wondermedia,
|
||||
};
|
||||
|
||||
@@ -959,6 +960,70 @@ static bool match_t(const char* start, const char* end, struct cpuinfo_arm_chips
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to match, case-sentitively, /Unisoc UMS\d{3,4}/ signature for Unisoc UMS
|
||||
* chipset. If match successful, extracts model information into \p chipset
|
||||
* argument.
|
||||
*
|
||||
* @param start - start of the platform identifier (/proc/cpuinfo Hardware
|
||||
* string, ro.product.board, ro.board.platform, or ro.chipname) to match.
|
||||
* @param end - end of the platform identifier (/proc/cpuinfo Hardware string,
|
||||
* ro.product.board, ro.board.platform, or ro.chipname) to match.
|
||||
* @param[out] chipset - location where chipset information will be stored upon
|
||||
* a successful match.
|
||||
*
|
||||
* @returns true if signature matched, false otherwise.
|
||||
*/
|
||||
static bool match_ums(const char* start, const char* end, struct cpuinfo_arm_chipset chipset[restrict static 1]) {
|
||||
/* Expect 13-14 symbols: "Unisoc UMS" (10 symbols) + 3-4-digit model number
|
||||
*/
|
||||
const size_t length = end - start;
|
||||
switch (length) {
|
||||
case 13:
|
||||
case 14:
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Check that string starts with "Unisoc UMS". The first four characters
|
||||
* are loaded as 32-bit little endian word */
|
||||
const uint32_t expected_unis = load_u32le(start);
|
||||
if (expected_unis != UINT32_C(0x73696E55) /* "sinU" = reverse("Unis") */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* The next four characters are loaded as 32-bit little endian word */
|
||||
const uint32_t expected_oc_u = load_u32le(start + 4);
|
||||
if (expected_oc_u != UINT32_C(0x5520636F) /* "U co" = reverse("oc U") */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* The next four characters are loaded as 16-bit little endian word */
|
||||
const uint16_t expected_ms = load_u16le(start + 8);
|
||||
if (expected_ms != UINT16_C(0x534D) /* "SM" = reverse("MS") */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Validate and parse 3-4 digit model number */
|
||||
uint32_t model = 0;
|
||||
for (uint32_t i = 10; i < length; i++) {
|
||||
const uint32_t digit = (uint32_t)(uint8_t)start[i] - '0';
|
||||
if (digit >= 10) {
|
||||
/* Not really a digit */
|
||||
return false;
|
||||
}
|
||||
model = model * 10 + digit;
|
||||
}
|
||||
|
||||
*chipset = (struct cpuinfo_arm_chipset){
|
||||
.vendor = cpuinfo_arm_chipset_vendor_unisoc,
|
||||
.series = cpuinfo_arm_chipset_series_unisoc_ums,
|
||||
.model = model,
|
||||
};
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to match /lc\d{4}[a-z]?$/ signature for Leadcore LC chipsets.
|
||||
* If match successful, extracts model information into \p chipset argument.
|
||||
@@ -2508,6 +2573,16 @@ struct cpuinfo_arm_chipset cpuinfo_arm_linux_decode_chipset_from_proc_cpuinfo_ha
|
||||
return chipset;
|
||||
}
|
||||
|
||||
/* Check Unisoc UMS signature */
|
||||
if (match_ums(hardware, hardware_end, &chipset)) {
|
||||
cpuinfo_log_debug(
|
||||
"matched Unisoc UMS signature in /proc/cpuinfo Hardware string \"%.*s\"",
|
||||
(int)hardware_length,
|
||||
hardware);
|
||||
|
||||
return chipset;
|
||||
}
|
||||
|
||||
#if CPUINFO_ARCH_ARM
|
||||
/* Check Marvell PXA signature */
|
||||
if (match_pxa(hardware, hardware_end, &chipset)) {
|
||||
@@ -3726,6 +3801,7 @@ static const char* chipset_series_string[cpuinfo_arm_chipset_series_max] = {
|
||||
[cpuinfo_arm_chipset_series_telechips_tcc] = "TCC",
|
||||
[cpuinfo_arm_chipset_series_texas_instruments_omap] = "OMAP",
|
||||
[cpuinfo_arm_chipset_series_unisoc_t] = "T",
|
||||
[cpuinfo_arm_chipset_series_unisoc_ums] = "UMS",
|
||||
[cpuinfo_arm_chipset_series_wondermedia_wm] = "WM",
|
||||
};
|
||||
|
||||
|
||||
16
3rdparty/cpuinfo/src/arm/linux/hwcap.c
vendored
16
3rdparty/cpuinfo/src/arm/linux/hwcap.c
vendored
@@ -31,8 +31,8 @@ void cpuinfo_set_hwcap(uint32_t hwcap) {
|
||||
mock_hwcap = hwcap;
|
||||
}
|
||||
|
||||
static uint32_t mock_hwcap2 = 0;
|
||||
void cpuinfo_set_hwcap2(uint32_t hwcap2) {
|
||||
static uint64_t mock_hwcap2 = 0;
|
||||
void cpuinfo_set_hwcap2(uint64_t hwcap2) {
|
||||
mock_hwcap2 = hwcap2;
|
||||
}
|
||||
#endif
|
||||
@@ -40,7 +40,7 @@ void cpuinfo_set_hwcap2(uint32_t hwcap2) {
|
||||
#if CPUINFO_ARCH_ARM
|
||||
typedef unsigned long (*getauxval_function_t)(unsigned long);
|
||||
|
||||
bool cpuinfo_arm_linux_hwcap_from_getauxval(uint32_t hwcap[restrict static 1], uint32_t hwcap2[restrict static 1]) {
|
||||
bool cpuinfo_arm_linux_hwcap_from_getauxval(uint32_t hwcap[restrict static 1], uint64_t hwcap2[restrict static 1]) {
|
||||
#if CPUINFO_MOCK
|
||||
*hwcap = mock_hwcap;
|
||||
*hwcap2 = mock_hwcap2;
|
||||
@@ -83,13 +83,13 @@ cleanup:
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
bool cpuinfo_arm_linux_hwcap_from_procfs(uint32_t hwcap[restrict static 1], uint32_t hwcap2[restrict static 1]) {
|
||||
bool cpuinfo_arm_linux_hwcap_from_procfs(uint32_t hwcap[restrict static 1], uint64_t hwcap2[restrict static 1]) {
|
||||
#if CPUINFO_MOCK
|
||||
*hwcap = mock_hwcap;
|
||||
*hwcap2 = mock_hwcap2;
|
||||
return true;
|
||||
#else
|
||||
uint32_t hwcaps[2] = {0, 0};
|
||||
uint64_t hwcaps[2] = {0, 0};
|
||||
bool result = false;
|
||||
int file = -1;
|
||||
|
||||
@@ -113,7 +113,7 @@ bool cpuinfo_arm_linux_hwcap_from_procfs(uint32_t hwcap[restrict static 1], uint
|
||||
hwcaps[0] = (uint32_t)elf_auxv.a_un.a_val;
|
||||
break;
|
||||
case AT_HWCAP2:
|
||||
hwcaps[1] = (uint32_t)elf_auxv.a_un.a_val;
|
||||
hwcaps[1] = (uint64_t)elf_auxv.a_un.a_val;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -141,13 +141,13 @@ cleanup:
|
||||
}
|
||||
#endif /* __ANDROID__ */
|
||||
#elif CPUINFO_ARCH_ARM64
|
||||
void cpuinfo_arm_linux_hwcap_from_getauxval(uint32_t hwcap[restrict static 1], uint32_t hwcap2[restrict static 1]) {
|
||||
void cpuinfo_arm_linux_hwcap_from_getauxval(uint32_t hwcap[restrict static 1], uint64_t hwcap2[restrict static 1]) {
|
||||
#if CPUINFO_MOCK
|
||||
*hwcap = mock_hwcap;
|
||||
*hwcap2 = mock_hwcap2;
|
||||
#else
|
||||
*hwcap = (uint32_t)getauxval(AT_HWCAP);
|
||||
*hwcap2 = (uint32_t)getauxval(AT_HWCAP2);
|
||||
*hwcap2 = (uint64_t)getauxval(AT_HWCAP2);
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
42
3rdparty/cpuinfo/src/arm/linux/init.c
vendored
42
3rdparty/cpuinfo/src/arm/linux/init.c
vendored
@@ -247,7 +247,8 @@ void cpuinfo_arm_linux_init(void) {
|
||||
#endif
|
||||
|
||||
#if CPUINFO_ARCH_ARM
|
||||
uint32_t isa_features = 0, isa_features2 = 0;
|
||||
uint32_t isa_features = 0;
|
||||
uint64_t isa_features2 = 0;
|
||||
#ifdef __ANDROID__
|
||||
/*
|
||||
* On Android before API 20, libc.so does not provide getauxval
|
||||
@@ -299,7 +300,8 @@ void cpuinfo_arm_linux_init(void) {
|
||||
&chipset,
|
||||
&cpuinfo_isa);
|
||||
#elif CPUINFO_ARCH_ARM64
|
||||
uint32_t isa_features = 0, isa_features2 = 0;
|
||||
uint32_t isa_features = 0;
|
||||
uint64_t isa_features2 = 0;
|
||||
/* getauxval is always available on ARM64 Android */
|
||||
cpuinfo_arm_linux_hwcap_from_getauxval(&isa_features, &isa_features2);
|
||||
cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
|
||||
@@ -333,18 +335,52 @@ void cpuinfo_arm_linux_init(void) {
|
||||
}
|
||||
|
||||
/* Propagate topology group IDs among siblings */
|
||||
bool detected_core_siblings_list_node = false;
|
||||
bool detected_cluster_cpus_list_node = false;
|
||||
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
|
||||
if (!bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (arm_linux_processors[i].flags & CPUINFO_LINUX_FLAG_PACKAGE_ID) {
|
||||
if (!bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_PACKAGE_ID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Use the cluster_cpus_list topology node if available. If not
|
||||
* found, cache the result to avoid repeatedly attempting to
|
||||
* read the non-existent paths.
|
||||
* */
|
||||
if (!detected_core_siblings_list_node && !detected_cluster_cpus_list_node) {
|
||||
if (cpuinfo_linux_detect_cluster_cpus(
|
||||
arm_linux_processors_count,
|
||||
i,
|
||||
(cpuinfo_siblings_callback)cluster_siblings_parser,
|
||||
arm_linux_processors)) {
|
||||
detected_cluster_cpus_list_node = true;
|
||||
continue;
|
||||
} else {
|
||||
detected_core_siblings_list_node = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* The cached result above will guarantee only one of the blocks
|
||||
* below will execute, with a bias towards cluster_cpus_list.
|
||||
**/
|
||||
if (detected_core_siblings_list_node) {
|
||||
cpuinfo_linux_detect_core_siblings(
|
||||
arm_linux_processors_count,
|
||||
i,
|
||||
(cpuinfo_siblings_callback)cluster_siblings_parser,
|
||||
arm_linux_processors);
|
||||
}
|
||||
|
||||
if (detected_cluster_cpus_list_node) {
|
||||
cpuinfo_linux_detect_cluster_cpus(
|
||||
arm_linux_processors_count,
|
||||
i,
|
||||
(cpuinfo_siblings_callback)cluster_siblings_parser,
|
||||
arm_linux_processors);
|
||||
}
|
||||
}
|
||||
|
||||
/* Propagate all cluster IDs */
|
||||
|
||||
10
3rdparty/cpuinfo/src/arm/mach/init.c
vendored
10
3rdparty/cpuinfo/src/arm/mach/init.c
vendored
@@ -399,6 +399,16 @@ void cpuinfo_arm_mach_init(void) {
|
||||
cpuinfo_isa.i8mm = true;
|
||||
}
|
||||
|
||||
const uint32_t has_feat_sme = get_sys_info_by_name("hw.optional.arm.FEAT_SME");
|
||||
if (has_feat_sme != 0) {
|
||||
cpuinfo_isa.sme = true;
|
||||
}
|
||||
|
||||
const uint32_t has_feat_sme2 = get_sys_info_by_name("hw.optional.arm.FEAT_SME2");
|
||||
if (has_feat_sme2 != 0) {
|
||||
cpuinfo_isa.sme2 = true;
|
||||
}
|
||||
|
||||
uint32_t num_clusters = 1;
|
||||
for (uint32_t i = 0; i < mach_topology.cores; i++) {
|
||||
cores[i] = (struct cpuinfo_core){
|
||||
|
||||
26
3rdparty/cpuinfo/src/freebsd/topology.c
vendored
26
3rdparty/cpuinfo/src/freebsd/topology.c
vendored
@@ -24,8 +24,10 @@ static char* sysctl_str(const char* name) {
|
||||
size_t value_size = 0;
|
||||
if (sysctlbyname(name, NULL, &value_size, NULL, 0) != 0) {
|
||||
cpuinfo_log_error("sysctlbyname(\"%s\") failed: %s", name, strerror(errno));
|
||||
return NULL;
|
||||
} else if (value_size <= 0) {
|
||||
cpuinfo_log_error("sysctlbyname(\"%s\") returned invalid value size %zu", name, value_size);
|
||||
return NULL;
|
||||
}
|
||||
value_size += 1;
|
||||
char* value = calloc(value_size, 1);
|
||||
@@ -52,29 +54,22 @@ struct cpuinfo_freebsd_topology cpuinfo_freebsd_detect_topology(void) {
|
||||
if (!topology_spec) {
|
||||
return topology;
|
||||
}
|
||||
const char* group_tag = "<group level=\"1\" cache-level=\"0\">";
|
||||
char* p = strstr(topology_spec, group_tag);
|
||||
while (p) {
|
||||
const char* cpu_tag = "cpu count=\"";
|
||||
char* q = strstr(p, cpu_tag);
|
||||
if (q) {
|
||||
p = q + strlen(cpu_tag);
|
||||
topology.packages += atoi(p);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (topology.packages == 0) {
|
||||
const char* group_tag = "<group level=\"1\"";
|
||||
const char* group_tags[] = {"<group level=\"2\" cache-level=\"0\">", "<group level=\"1\" "};
|
||||
for (size_t i = 0; i < sizeof(group_tags) / sizeof(group_tags[0]); i++) {
|
||||
const char* group_tag = group_tags[i];
|
||||
char* p = strstr(topology_spec, group_tag);
|
||||
while (p) {
|
||||
topology.packages += 1;
|
||||
p++;
|
||||
p = strstr(p, group_tag);
|
||||
}
|
||||
if (topology.packages > 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (topology.packages == 0) {
|
||||
cpuinfo_log_error("failed to parse topology_spec:%s", topology_spec);
|
||||
cpuinfo_log_error("failed to parse topology_spec: %s", topology_spec);
|
||||
free(topology_spec);
|
||||
goto fail;
|
||||
}
|
||||
@@ -84,6 +79,7 @@ struct cpuinfo_freebsd_topology cpuinfo_freebsd_detect_topology(void) {
|
||||
goto fail;
|
||||
}
|
||||
if (topology.cores < topology.packages) {
|
||||
cpuinfo_log_error("invalid numbers of package and core: %d %d", topology.packages, topology.cores);
|
||||
goto fail;
|
||||
}
|
||||
topology.threads_per_core = sysctl_int("kern.smp.threads_per_core");
|
||||
|
||||
26
3rdparty/cpuinfo/src/x86/freebsd/init.c
vendored
26
3rdparty/cpuinfo/src/x86/freebsd/init.c
vendored
@@ -135,6 +135,10 @@ void cpuinfo_x86_freebsd_init(void) {
|
||||
if (x86_processor.cache.l1i.size != 0 || x86_processor.cache.l1d.size != 0) {
|
||||
/* Assume that threads on the same core share L1 */
|
||||
threads_per_l1 = freebsd_topology.threads / freebsd_topology.cores;
|
||||
if (threads_per_l1 == 0) {
|
||||
cpuinfo_log_error("failed to detect threads_per_l1");
|
||||
goto cleanup;
|
||||
}
|
||||
cpuinfo_log_warning(
|
||||
"freebsd kernel did not report number of "
|
||||
"threads sharing L1 cache; assume %" PRIu32,
|
||||
@@ -154,6 +158,10 @@ void cpuinfo_x86_freebsd_init(void) {
|
||||
* the same package share L2 */
|
||||
threads_per_l2 = freebsd_topology.threads / freebsd_topology.packages;
|
||||
}
|
||||
if (threads_per_l2 == 0) {
|
||||
cpuinfo_log_error("failed to detect threads_per_l1");
|
||||
goto cleanup;
|
||||
}
|
||||
cpuinfo_log_warning(
|
||||
"freebsd kernel did not report number of "
|
||||
"threads sharing L2 cache; assume %" PRIu32,
|
||||
@@ -170,6 +178,10 @@ void cpuinfo_x86_freebsd_init(void) {
|
||||
* may be L4 cache as well)
|
||||
*/
|
||||
threads_per_l3 = freebsd_topology.threads / freebsd_topology.packages;
|
||||
if (threads_per_l3 == 0) {
|
||||
cpuinfo_log_error("failed to detect threads_per_l3");
|
||||
goto cleanup;
|
||||
}
|
||||
cpuinfo_log_warning(
|
||||
"freebsd kernel did not report number of "
|
||||
"threads sharing L3 cache; assume %" PRIu32,
|
||||
@@ -187,6 +199,10 @@ void cpuinfo_x86_freebsd_init(void) {
|
||||
* shared L4 (like on IBM POWER8).
|
||||
*/
|
||||
threads_per_l4 = freebsd_topology.threads;
|
||||
if (threads_per_l4 == 0) {
|
||||
cpuinfo_log_error("failed to detect threads_per_l4");
|
||||
goto cleanup;
|
||||
}
|
||||
cpuinfo_log_warning(
|
||||
"freebsd kernel did not report number of "
|
||||
"threads sharing L4 cache; assume %" PRIu32,
|
||||
@@ -203,7 +219,7 @@ void cpuinfo_x86_freebsd_init(void) {
|
||||
"%" PRIu32 " L1I caches",
|
||||
l1_count * sizeof(struct cpuinfo_cache),
|
||||
l1_count);
|
||||
return;
|
||||
goto cleanup;
|
||||
}
|
||||
for (uint32_t c = 0; c < l1_count; c++) {
|
||||
l1i[c] = (struct cpuinfo_cache){
|
||||
@@ -230,7 +246,7 @@ void cpuinfo_x86_freebsd_init(void) {
|
||||
"%" PRIu32 " L1D caches",
|
||||
l1_count * sizeof(struct cpuinfo_cache),
|
||||
l1_count);
|
||||
return;
|
||||
goto cleanup;
|
||||
}
|
||||
for (uint32_t c = 0; c < l1_count; c++) {
|
||||
l1d[c] = (struct cpuinfo_cache){
|
||||
@@ -257,7 +273,7 @@ void cpuinfo_x86_freebsd_init(void) {
|
||||
"%" PRIu32 " L2 caches",
|
||||
l2_count * sizeof(struct cpuinfo_cache),
|
||||
l2_count);
|
||||
return;
|
||||
goto cleanup;
|
||||
}
|
||||
for (uint32_t c = 0; c < l2_count; c++) {
|
||||
l2[c] = (struct cpuinfo_cache){
|
||||
@@ -284,7 +300,7 @@ void cpuinfo_x86_freebsd_init(void) {
|
||||
"%" PRIu32 " L3 caches",
|
||||
l3_count * sizeof(struct cpuinfo_cache),
|
||||
l3_count);
|
||||
return;
|
||||
goto cleanup;
|
||||
}
|
||||
for (uint32_t c = 0; c < l3_count; c++) {
|
||||
l3[c] = (struct cpuinfo_cache){
|
||||
@@ -311,7 +327,7 @@ void cpuinfo_x86_freebsd_init(void) {
|
||||
"%" PRIu32 " L4 caches",
|
||||
l4_count * sizeof(struct cpuinfo_cache),
|
||||
l4_count);
|
||||
return;
|
||||
goto cleanup;
|
||||
}
|
||||
for (uint32_t c = 0; c < l4_count; c++) {
|
||||
l4[c] = (struct cpuinfo_cache){
|
||||
|
||||
2
3rdparty/libzip/AUTHORS
vendored
2
3rdparty/libzip/AUTHORS
vendored
@@ -1,2 +1,2 @@
|
||||
Dieter Baron <dillo@nih.at>
|
||||
Thomas Klausner <tk@giga.or.at>
|
||||
Thomas Klausner <wiz@gatalith.at>
|
||||
|
||||
1
3rdparty/libzip/CMakeLists.txt
vendored
1
3rdparty/libzip/CMakeLists.txt
vendored
@@ -250,6 +250,7 @@ add_library(zip STATIC
|
||||
lib/zip_unchange_archive.c
|
||||
lib/zip_unchange_data.c
|
||||
lib/zip_utf-8.c
|
||||
lib/zip_source_get_dostime.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/zip_err_str.c
|
||||
)
|
||||
|
||||
|
||||
343
3rdparty/libzip/NEWS.md
vendored
Normal file
343
3rdparty/libzip/NEWS.md
vendored
Normal file
@@ -0,0 +1,343 @@
|
||||
# 1.11.1 [2024-09-19]
|
||||
|
||||
* Fix zipconf.h for version number with missing third component.
|
||||
|
||||
# 1.11 [2024-09-19]
|
||||
|
||||
* Stop searching after finding acceptable central directory, even if it contains inconsistencies.
|
||||
* Only write Zip64 EOCD if fields don't fit in normal EOCD. Previously libzip also wrote it when any directory entry required Zip64.
|
||||
* Allow bytes from 0x00-0x1F as UTF-8.
|
||||
* Add new error code `ZIP_ER_TRUNCATED_ZIP` for files that start with a valid local header signature.
|
||||
* `zipcmp`: add `-T` option for comparing timestamps.
|
||||
* `zip_file_replace` now removes the target's extra field information.
|
||||
|
||||
# 1.10.1 [2023-08-23]
|
||||
|
||||
* Add `ZIP_LENGTH_TO_END` and `ZIP_LENGTH_UNCHECKED`. Unless `ZIP_LENGTH_UNCHECKED` is used as `length`, it is an error for a file to shrink between the time when the source is created and when its data is read.
|
||||
* Fix test on Windows.
|
||||
|
||||
# 1.10.0 [2023-06-23]
|
||||
|
||||
* Make support for layered sources public.
|
||||
* Add `zip_source_zip_file` and `zip_source_zip_file_create`, deprecate `zip_source_zip` and `zip_source_zip_create`.
|
||||
* Allow reading changed file data.
|
||||
* Fix handling of files of size 4294967295.
|
||||
* `zipmerge`: copy extra fields.
|
||||
* `zipmerge`: add option to keep files uncompressed.
|
||||
* Switch test framework to use nihtest instead of Perl.
|
||||
* Fix reading/writing compressed data with buffers > 4GiB.
|
||||
* Restore support for torrentzip.
|
||||
* Add warnings when using deprecated functions.
|
||||
* Allow keeping files for empty archives.
|
||||
* Support mbedTLS>=3.3.0.
|
||||
* Support OpenSSL 3.
|
||||
* Use ISO C secure library functions, if available.
|
||||
|
||||
|
||||
# 1.9.2 [2022-06-28]
|
||||
|
||||
* Fix version number in header file.
|
||||
|
||||
|
||||
# 1.9.1 [2022-06-28]
|
||||
|
||||
* Fix `zip_file_is_seekable()`.
|
||||
|
||||
|
||||
# 1.9.0 [2022-06-13]
|
||||
|
||||
* Add `zip_file_is_seekable()`.
|
||||
* Improve compatibility with WinAES.
|
||||
* Fix encoding handling in `zip_name_locate()`.
|
||||
* Add option to `zipcmp` to output summary of changes.
|
||||
* Various bug fixes and documentation improvements.
|
||||
|
||||
|
||||
# 1.8.0 [2021-06-18]
|
||||
|
||||
* Add support for zstd (Zstandard) compression.
|
||||
* Add support for lzma (ID 14) compression.
|
||||
* Add `zip_source_window_create()`.
|
||||
* Add `zip_source_zip_create()` variant to `zip_source_zip()`.
|
||||
* Allow method specific `comp_flags` in `zip_set_file_compression()`.
|
||||
* Allow `zip_source_tell()` on sources that don't support seeking and `zip_ftell()` on compressed data.
|
||||
* Provide more details for consistency check errors.
|
||||
* Improve output of `zipcmp`.
|
||||
* In `zipcmp`, don’t ignore empty directories when comparing directory listing.
|
||||
* Treat empty string as no password given in `zip_file_set_encryption()`, `zip_fopen_encrypted()`, and `zip_set_default_password()`.
|
||||
|
||||
|
||||
# 1.7.3 [2020-07-15]
|
||||
|
||||
* Support cmake < 3.17 again.
|
||||
* Fix pkgconfig file (regression in 1.7.2).
|
||||
|
||||
|
||||
# 1.7.2 [2020-07-11]
|
||||
|
||||
* Fixes for the CMake `find_project()` files.
|
||||
* libzip moved to the CMake `libzip::` `NAMESPACE`.
|
||||
* CMake usage best practice cleanups.
|
||||
|
||||
|
||||
# 1.7.1 [2020-06-13]
|
||||
|
||||
* Restore `LIBZIP_VERSION_{MAJOR,MINOR,MICRO}` symbols.
|
||||
* Fixes warnings reported by PVS-Studio.
|
||||
* Add `LIBZIP_DO_INSTALL` build setting to make it easier to use
|
||||
libzip as subproject.
|
||||
|
||||
|
||||
# 1.7.0 [2020-06-05]
|
||||
|
||||
* Add support for encrypting using traditional PKWare encryption.
|
||||
* Add `zip_compression_method_supported()`.
|
||||
* Add `zip_encryption_method_supported()`.
|
||||
* Add the `ZIP_SOURCE_GET_FILE_ATTRIBUTES` source command.
|
||||
* Refactor stdio file backend.
|
||||
* Add CMake find_project() support.
|
||||
|
||||
|
||||
# 1.6.1 [2020-02-03]
|
||||
|
||||
* Bugfix for double-free in `zipcmp(1)` during cleanup.
|
||||
|
||||
|
||||
# 1.6.0 [2020-01-24]
|
||||
|
||||
* Avoid using `umask()` since it's not thread-safe.
|
||||
* Set close-on-exec flag when opening files.
|
||||
* Do not accept empty files as valid zip archives any longer.
|
||||
* Add support for XZ compressed files (using liblzma).
|
||||
* Add support for cancelling while closing zip archives.
|
||||
* Add support for setting the time in the on-disk format.
|
||||
|
||||
|
||||
# 1.5.2 [2019-03-12]
|
||||
|
||||
* Fix bug in AES encryption affecting certain file sizes
|
||||
* Keep file permissions when modifying zip archives
|
||||
* Support systems with small stack size.
|
||||
* Support mbed TLS as crypto backend.
|
||||
* Add nullability annotations.
|
||||
|
||||
|
||||
# 1.5.1 [2018-04-11]
|
||||
|
||||
* Choose format of installed documentation based on available tools.
|
||||
* Fix visibility of symbols.
|
||||
* Fix zipcmp directory support.
|
||||
* Don't set RPATH on Linux.
|
||||
* Use Libs.private for link dependencies in pkg-config file.
|
||||
* Fix build with LibreSSL.
|
||||
* Various bugfixes.
|
||||
|
||||
|
||||
# 1.5.0 [2018-03-11]
|
||||
|
||||
* Use standard cryptographic library instead of custom AES implementation.
|
||||
This also simplifies the license.
|
||||
* Use `clang-format` to format the source code.
|
||||
* More Windows improvements.
|
||||
|
||||
|
||||
# 1.4.0 [2017-12-29]
|
||||
|
||||
* Improve build with cmake
|
||||
* Retire autoconf/automake build system
|
||||
* Add `zip_source_buffer_fragment()`.
|
||||
* Add support to clone unchanged beginning of archive (instead of rewriting it).
|
||||
Supported for buffer sources and on Apple File System.
|
||||
* Add support for Microsoft Universal Windows Platform.
|
||||
|
||||
|
||||
# 1.3.2 [2017-11-20]
|
||||
|
||||
* Fix bug introduced in last: zip_t was erroneously freed if zip_close() failed.
|
||||
|
||||
|
||||
# 1.3.1 [2017-11-19]
|
||||
|
||||
* Install zipconf.h into ${PREFIX}/include
|
||||
* Add zip_libzip_version()
|
||||
* Fix AES tests on Linux
|
||||
|
||||
|
||||
# 1.3.0 [2017-09-02]
|
||||
|
||||
* Support bzip2 compressed zip archives
|
||||
* Improve file progress callback code
|
||||
* Fix zip_fdopen()
|
||||
* CVE-2017-12858: Fix double free()
|
||||
* CVE-2017-14107: Improve EOCD64 parsing
|
||||
|
||||
|
||||
# 1.2.0 [2017-02-19]
|
||||
|
||||
* Support for AES encryption (Winzip version), both encryption
|
||||
and decryption
|
||||
* Support legacy zip files with >64k entries
|
||||
* Fix seeking in zip_source_file if start > 0
|
||||
* Add zip_fseek() for seeking in uncompressed data
|
||||
* Add zip_ftell() for telling position in uncompressed data
|
||||
* Add zip_register_progress_callback() for UI updates during zip_close()
|
||||
|
||||
|
||||
# 1.1.3 [2016-05-28]
|
||||
|
||||
* Fix build on Windows when using autoconf
|
||||
|
||||
|
||||
# 1.1.2 [2016-02-19]
|
||||
|
||||
* Improve support for 3MF files
|
||||
|
||||
|
||||
# 1.1.1 [2016-02-07]
|
||||
|
||||
* Build fixes for Linux
|
||||
* Fix some warnings reported by PVS-Studio
|
||||
|
||||
|
||||
# 1.1 [2016-01-26]
|
||||
|
||||
* ziptool(1): command line tool to modify zip archives
|
||||
* Speedups for archives with many entries
|
||||
* Coverity fixes
|
||||
* Better APK support
|
||||
* Support for running tests on Windows
|
||||
* More build fixes for Windows
|
||||
* Portability fixes
|
||||
* Documentation improvements
|
||||
|
||||
|
||||
# 1.0.1 [2015-05-04]
|
||||
|
||||
* Build fixes for Windows
|
||||
|
||||
|
||||
# 1.0 [2015-05-03]
|
||||
|
||||
* Implemented an I/O abstraction layer
|
||||
* Added support for native Windows API for files
|
||||
* Added support for setting the last modification time for a file
|
||||
* Added a new type zip_error_t for errors
|
||||
* Added more typedefs for structs
|
||||
* Torrentzip support was removed
|
||||
* CVE-2015-2331 was fixed
|
||||
* Addressed all Coverity CIDs
|
||||
|
||||
|
||||
# 0.11.2 [2013-12-19]
|
||||
|
||||
* Support querying/setting operating system and external attributes
|
||||
* For newly added files, set operating system to UNIX, permissions
|
||||
to 0666 (0777 for directories)
|
||||
* Fix bug when writing zip archives containing files bigger than 4GB
|
||||
|
||||
|
||||
# 0.11.1 [2013-04-27]
|
||||
|
||||
* Fix bugs in zip_set_file_compression()
|
||||
* Include Xcode build infrastructure
|
||||
|
||||
|
||||
# 0.11 [2013-03-23]
|
||||
|
||||
* Added Zip64 support (large file support)
|
||||
* Added UTF-8 support for file names, file comments, and archive comments
|
||||
* Changed API for name and comment related functions for UTF-8 support
|
||||
* Added zip_discard()
|
||||
* Added ZIP_TRUNCATE for zip_open()
|
||||
* Added zip_set_file_compression()
|
||||
* Added API for accessing and modifying extra fields
|
||||
* Improved API type consistency
|
||||
* Use gcc4's visibility __attribute__
|
||||
* More changes for Windows support
|
||||
* Additional test cases
|
||||
|
||||
|
||||
# 0.10.1 [2012-03-20]
|
||||
|
||||
* Fixed CVE-2012-1162
|
||||
* Fixed CVE-2012-1163
|
||||
|
||||
|
||||
# 0.10 [2010-03-18]
|
||||
|
||||
* Added zip_get_num_entries(), deprecated zip_get_num_files()
|
||||
* Better windows support
|
||||
* Support for traditional PKWARE encryption added
|
||||
* Fix opening archives with more than 65535 entries
|
||||
* Fix some memory leaks
|
||||
* Fix cmake build and installation
|
||||
* Fix memory leak in error case in zip_open()
|
||||
* Fixed CVE-2011-0421 (no security implications though)
|
||||
* More documentation
|
||||
|
||||
|
||||
# 0.9.3 [2010-02-01]
|
||||
|
||||
* Include m4/ directory in distribution; some packagers need it
|
||||
|
||||
|
||||
# 0.9.2 [2010-01-31]
|
||||
|
||||
* Avoid passing uninitialized data to deflate()
|
||||
* Fix memory leak when closing zip archives
|
||||
|
||||
|
||||
# 0.9.1 [2010-01-24]
|
||||
|
||||
* Fix infinite loop on reading some broken files
|
||||
* Optimization in time conversion (don't call localtime())
|
||||
* Clear data descriptor flag in central directory, fixing Open Office files
|
||||
* Allow more than 64k entries
|
||||
|
||||
|
||||
# 0.9 [2008-07-25]
|
||||
|
||||
* on Windows, explicitly set dllimport/dllexport
|
||||
* remove erroneous references to GPL
|
||||
* add support for torrentzip
|
||||
* new functions: zip_get_archive_flag, zip_set_archive_flag
|
||||
* zip_source_zip: add flag to force recompression
|
||||
* zip_sorce_file: only keep file open while reading from it
|
||||
|
||||
|
||||
# 0.8 [2007-06-06]
|
||||
|
||||
* fix for zip archives larger than 2GiB
|
||||
* fix zip_error_strerror to include libzip error string
|
||||
* add support for reading streamed zip files
|
||||
* new functions: zip_add_dir, zip_error_clear, zip_file_error_clear
|
||||
* add basic support for building with CMake (incomplete)
|
||||
|
||||
|
||||
# 0.7.1 [2006-05-18]
|
||||
|
||||
* bugfix for zip_close
|
||||
|
||||
|
||||
# 0.7 [2006-05-06]
|
||||
|
||||
* struct zip_stat increased for future encryption support
|
||||
* zip_add return value changed (now returns new index of added file)
|
||||
* shared library major bump because of previous two
|
||||
* added functions for reading and writing file and archive comments
|
||||
New functions: zip_get_archive_comment, zip_get_file_comment,
|
||||
zip_set_archive_comment, zip_set_file_comment, zip_unchange_archive
|
||||
|
||||
|
||||
# 0.6.1 [2005-07-14]
|
||||
|
||||
* various bug fixes
|
||||
|
||||
|
||||
# 0.6 [2005-06-09]
|
||||
|
||||
* first standalone release
|
||||
* changed license to three-clause BSD
|
||||
* overhauled API
|
||||
* added man pages
|
||||
* install zipcmp and zipmerge
|
||||
5
3rdparty/libzip/lib/CMakeLists.txt
vendored
5
3rdparty/libzip/lib/CMakeLists.txt
vendored
@@ -82,6 +82,7 @@ add_library(zip
|
||||
zip_source_file_stdio.c
|
||||
zip_source_free.c
|
||||
zip_source_function.c
|
||||
zip_source_get_dostime.c
|
||||
zip_source_get_file_attributes.c
|
||||
zip_source_is_deleted.c
|
||||
zip_source_layered.c
|
||||
@@ -117,6 +118,7 @@ add_library(zip
|
||||
add_library(libzip::zip ALIAS zip)
|
||||
|
||||
if(WIN32)
|
||||
target_compile_definitions(zip PRIVATE WIN32_LEAN_AND_MEAN)
|
||||
target_sources(zip PRIVATE
|
||||
zip_source_file_win32.c
|
||||
zip_source_file_win32_named.c
|
||||
@@ -172,7 +174,8 @@ if(HAVE_CRYPTO)
|
||||
endif()
|
||||
|
||||
if(SHARED_LIB_VERSIONNING)
|
||||
set_target_properties(zip PROPERTIES VERSION 5.5 SOVERSION 5)
|
||||
# MACHO_*_VERSION can be removed when SOVERSION gets increased. Cf #405
|
||||
set_target_properties(zip PROPERTIES VERSION 5.5 SOVERSION 5 MACHO_CURRENT_VERSION 6.5 MACHO_COMPATIBILITY_VERSION 6)
|
||||
endif()
|
||||
|
||||
target_link_libraries(zip PRIVATE ZLIB::ZLIB)
|
||||
|
||||
2
3rdparty/libzip/lib/compat.h
vendored
2
3rdparty/libzip/lib/compat.h
vendored
@@ -3,7 +3,7 @@
|
||||
|
||||
/*
|
||||
compat.h -- compatibility defines.
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
6
3rdparty/libzip/lib/zip.h
vendored
6
3rdparty/libzip/lib/zip.h
vendored
@@ -3,7 +3,7 @@
|
||||
|
||||
/*
|
||||
zip.h -- exported declarations.
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -154,6 +154,7 @@ extern "C" {
|
||||
#define ZIP_ER_CANCELLED 32 /* N Operation cancelled */
|
||||
#define ZIP_ER_DATA_LENGTH 33 /* N Unexpected length of data */
|
||||
#define ZIP_ER_NOT_ALLOWED 34 /* N Not allowed in torrentzip */
|
||||
#define ZIP_ER_TRUNCATED_ZIP 35 /* N Possibly truncated or corrupted zip archive */
|
||||
|
||||
/* type of system error value */
|
||||
|
||||
@@ -256,7 +257,8 @@ enum zip_source_cmd {
|
||||
ZIP_SOURCE_BEGIN_WRITE_CLONING, /* like ZIP_SOURCE_BEGIN_WRITE, but keep part of original file */
|
||||
ZIP_SOURCE_ACCEPT_EMPTY, /* whether empty files are valid archives */
|
||||
ZIP_SOURCE_GET_FILE_ATTRIBUTES, /* get additional file attributes */
|
||||
ZIP_SOURCE_SUPPORTS_REOPEN /* allow reading from changed entry */
|
||||
ZIP_SOURCE_SUPPORTS_REOPEN, /* allow reading from changed entry */
|
||||
ZIP_SOURCE_GET_DOS_TIME /* get last modification time in DOS format */
|
||||
};
|
||||
typedef enum zip_source_cmd zip_source_cmd_t;
|
||||
|
||||
|
||||
2
3rdparty/libzip/lib/zip_add.c
vendored
2
3rdparty/libzip/lib/zip_add.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_add.c -- add file via callback function
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_add_dir.c
vendored
2
3rdparty/libzip/lib/zip_add_dir.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_add_dir.c -- add directory
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
4
3rdparty/libzip/lib/zip_add_entry.c
vendored
4
3rdparty/libzip/lib/zip_add_entry.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_add_entry.c -- create and init struct zip_entry
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -64,7 +64,7 @@ _zip_add_entry(zip_t *za) {
|
||||
return -1;
|
||||
}
|
||||
rentries = (zip_entry_t *)realloc(za->entry, sizeof(struct zip_entry) * (size_t)nalloc);
|
||||
if (!rentries) {
|
||||
if (rentries == NULL) {
|
||||
zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
2
3rdparty/libzip/lib/zip_algorithm_bzip2.c
vendored
2
3rdparty/libzip/lib/zip_algorithm_bzip2.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_algorithm_bzip2.c -- bzip2 (de)compression routines
|
||||
Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2017-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_algorithm_deflate.c
vendored
2
3rdparty/libzip/lib/zip_algorithm_deflate.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_algorithm_deflate.c -- deflate (de)compression routines
|
||||
Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2017-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_algorithm_xz.c
vendored
2
3rdparty/libzip/lib/zip_algorithm_xz.c
vendored
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
zip_algorithm_xz.c -- LZMA/XZ (de)compression routines
|
||||
Bazed on zip_algorithm_deflate.c -- deflate (de)compression routines
|
||||
Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2017-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_algorithm_zstd.c
vendored
2
3rdparty/libzip/lib/zip_algorithm_zstd.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_algorithm_zstd.c -- zstd (de)compression routines
|
||||
Copyright (C) 2020-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2020-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
5
3rdparty/libzip/lib/zip_buffer.c
vendored
5
3rdparty/libzip/lib/zip_buffer.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_buffer.c -- bounds checked access to memory buffer
|
||||
Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2014-2024 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -306,8 +306,7 @@ _zip_buffer_put_8(zip_buffer_t *buffer, zip_uint8_t i) {
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
_zip_buffer_set_offset(zip_buffer_t *buffer, zip_uint64_t offset) {
|
||||
int _zip_buffer_set_offset(zip_buffer_t *buffer, zip_uint64_t offset) {
|
||||
if (offset > buffer->size) {
|
||||
buffer->ok = false;
|
||||
return -1;
|
||||
|
||||
45
3rdparty/libzip/lib/zip_close.c
vendored
45
3rdparty/libzip/lib/zip_close.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_close.c -- close zip archive and update changes
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
static int add_data(zip_t *, zip_source_t *, zip_dirent_t *, zip_uint32_t);
|
||||
static int copy_data(zip_t *, zip_uint64_t);
|
||||
static int copy_source(zip_t *, zip_source_t *, zip_int64_t);
|
||||
static int copy_source(zip_t *, zip_source_t *, zip_source_t *, zip_int64_t);
|
||||
static int torrentzip_compare_names(const void *a, const void *b);
|
||||
static int write_cdir(zip_t *, const zip_filelist_t *, zip_uint64_t);
|
||||
static int write_data_descriptor(zip_t *za, const zip_dirent_t *dirent, int is_zip64);
|
||||
@@ -468,11 +468,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) {
|
||||
|
||||
/* PKWare encryption uses last_mod, make sure it gets the right value. */
|
||||
if (de->changed & ZIP_DIRENT_LAST_MOD) {
|
||||
zip_stat_t st_mtime;
|
||||
zip_stat_init(&st_mtime);
|
||||
st_mtime.valid = ZIP_STAT_MTIME;
|
||||
st_mtime.mtime = de->last_mod;
|
||||
if ((src_tmp = _zip_source_window_new(src_final, 0, -1, &st_mtime, 0, NULL, NULL, 0, true, &za->error)) == NULL) {
|
||||
if ((src_tmp = _zip_source_window_new(src_final, 0, -1, NULL, 0, NULL, &de->last_mod, NULL, 0, true, &za->error)) == NULL) {
|
||||
zip_source_free(src_final);
|
||||
return -1;
|
||||
}
|
||||
@@ -495,7 +491,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = copy_source(za, src_final, data_length);
|
||||
ret = copy_source(za, src_final, src, data_length);
|
||||
|
||||
if (zip_source_stat(src_final, &st) < 0) {
|
||||
zip_error_set_from_source(&za->error, src_final);
|
||||
@@ -529,10 +525,23 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) {
|
||||
}
|
||||
|
||||
if ((de->changed & ZIP_DIRENT_LAST_MOD) == 0) {
|
||||
if (st.valid & ZIP_STAT_MTIME)
|
||||
de->last_mod = st.mtime;
|
||||
else
|
||||
time(&de->last_mod);
|
||||
int ret2 = zip_source_get_dos_time(src, &de->last_mod);
|
||||
if (ret2 < 0) {
|
||||
zip_error_set_from_source(&za->error, src);
|
||||
return -1;
|
||||
}
|
||||
if (ret2 == 0) {
|
||||
time_t mtime;
|
||||
if (st.valid & ZIP_STAT_MTIME) {
|
||||
mtime = st.mtime;
|
||||
}
|
||||
else {
|
||||
time(&mtime);
|
||||
}
|
||||
if (_zip_u2d_time(mtime, &de->last_mod, &za->error) < 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
de->comp_method = st.comp_method;
|
||||
de->crc = st.crc;
|
||||
@@ -605,7 +614,7 @@ copy_data(zip_t *za, zip_uint64_t len) {
|
||||
|
||||
|
||||
static int
|
||||
copy_source(zip_t *za, zip_source_t *src, zip_int64_t data_length) {
|
||||
copy_source(zip_t *za, zip_source_t *src, zip_source_t *src_for_length, zip_int64_t data_length) {
|
||||
DEFINE_BYTE_ARRAY(buf, BUFSIZE);
|
||||
zip_int64_t n, current;
|
||||
int ret;
|
||||
@@ -628,7 +637,13 @@ copy_source(zip_t *za, zip_source_t *src, zip_int64_t data_length) {
|
||||
break;
|
||||
}
|
||||
if (n == BUFSIZE && za->progress && data_length > 0) {
|
||||
current += n;
|
||||
zip_int64_t t;
|
||||
t = zip_source_tell(src_for_length);
|
||||
if (t >= 0) {
|
||||
current = t;
|
||||
} else {
|
||||
current += n;
|
||||
}
|
||||
if (_zip_progress_update(za->progress, (double)current / (double)data_length) != 0) {
|
||||
zip_error_set(&za->error, ZIP_ER_CANCELLED, 0);
|
||||
ret = -1;
|
||||
@@ -742,4 +757,4 @@ static int torrentzip_compare_names(const void *a, const void *b) {
|
||||
}
|
||||
|
||||
return strcasecmp(aname, bname);
|
||||
}
|
||||
}
|
||||
|
||||
2
3rdparty/libzip/lib/zip_crypto.h
vendored
2
3rdparty/libzip/lib/zip_crypto.h
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto.h -- crypto definitions
|
||||
Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2017-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_commoncrypto.c -- CommonCrypto wrapper.
|
||||
Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_commoncrypto.h -- definitions for CommonCrypto wrapper.
|
||||
Copyright (C) 2018 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_crypto_gnutls.c
vendored
2
3rdparty/libzip/lib/zip_crypto_gnutls.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_gnutls.c -- GnuTLS wrapper.
|
||||
Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_crypto_gnutls.h
vendored
2
3rdparty/libzip/lib/zip_crypto_gnutls.h
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_gnutls.h -- definitions for GnuTLS wrapper.
|
||||
Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_crypto_mbedtls.c
vendored
2
3rdparty/libzip/lib/zip_crypto_mbedtls.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_mbedtls.c -- mbed TLS wrapper
|
||||
Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_crypto_mbedtls.h
vendored
2
3rdparty/libzip/lib/zip_crypto_mbedtls.h
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_mbedtls.h -- definitions for mbedtls wrapper
|
||||
Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
13
3rdparty/libzip/lib/zip_crypto_openssl.c
vendored
13
3rdparty/libzip/lib/zip_crypto_openssl.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_openssl.c -- OpenSSL wrapper.
|
||||
Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -126,8 +126,9 @@ _zip_crypto_aes_free(_zip_crypto_aes_t *aes) {
|
||||
|
||||
bool
|
||||
_zip_crypto_aes_encrypt_block(_zip_crypto_aes_t *aes, const zip_uint8_t *in, zip_uint8_t *out) {
|
||||
int len;
|
||||
if (EVP_EncryptUpdate(aes, out, &len, in, ZIP_CRYPTO_AES_BLOCK_LENGTH) != 1) {
|
||||
int len = 0;
|
||||
if (EVP_EncryptUpdate(aes, out, &len, in, ZIP_CRYPTO_AES_BLOCK_LENGTH) != 1
|
||||
|| len != ZIP_CRYPTO_AES_BLOCK_LENGTH) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -214,11 +215,11 @@ _zip_crypto_hmac_free(_zip_crypto_hmac_t *hmac) {
|
||||
bool
|
||||
_zip_crypto_hmac_output(_zip_crypto_hmac_t *hmac, zip_uint8_t *data) {
|
||||
#ifdef USE_OPENSSL_3_API
|
||||
size_t length;
|
||||
size_t length = 0;
|
||||
return EVP_MAC_final(hmac->ctx, data, &length, ZIP_CRYPTO_SHA1_LENGTH) == 1 && length == ZIP_CRYPTO_SHA1_LENGTH;
|
||||
#else
|
||||
unsigned int length;
|
||||
return HMAC_Final(hmac, data, &length) == 1;
|
||||
unsigned int length = 0;
|
||||
return HMAC_Final(hmac, data, &length) == 1 && length == ZIP_CRYPTO_SHA1_LENGTH;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
2
3rdparty/libzip/lib/zip_crypto_openssl.h
vendored
2
3rdparty/libzip/lib/zip_crypto_openssl.h
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_openssl.h -- definitions for OpenSSL wrapper.
|
||||
Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
5
3rdparty/libzip/lib/zip_crypto_win.c
vendored
5
3rdparty/libzip/lib/zip_crypto_win.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_win.c -- Windows Crypto API wrapper.
|
||||
Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -37,9 +37,6 @@
|
||||
|
||||
#include "zip_crypto.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOCRYPT
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <bcrypt.h>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_crypto_win.h
vendored
2
3rdparty/libzip/lib/zip_crypto_win.h
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_win.h -- Windows Crypto API wrapper.
|
||||
Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_delete.c
vendored
2
3rdparty/libzip/lib/zip_delete.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_delete.c -- delete file from zip archive
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_dir_add.c
vendored
2
3rdparty/libzip/lib/zip_dir_add.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_dir_add.c -- add directory
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
195
3rdparty/libzip/lib/zip_dirent.c
vendored
195
3rdparty/libzip/lib/zip_dirent.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_dirent.c -- read directory entry (local or central), clean dirent
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -39,9 +39,10 @@
|
||||
#include <time.h>
|
||||
#include <zlib.h>
|
||||
|
||||
#include "zip.h"
|
||||
#include "zipint.h"
|
||||
|
||||
static zip_string_t *_zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string_t *str);
|
||||
static zip_string_t *_zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string_t *str, bool check_consistency);
|
||||
static zip_extra_field_t *_zip_ef_utf8(zip_uint16_t, zip_string_t *, zip_error_t *);
|
||||
static bool _zip_dirent_process_winzip_aes(zip_dirent_t *de, zip_error_t *error);
|
||||
|
||||
@@ -50,8 +51,9 @@ void
|
||||
_zip_cdir_free(zip_cdir_t *cd) {
|
||||
zip_uint64_t i;
|
||||
|
||||
if (!cd)
|
||||
if (cd == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < cd->nentry; i++)
|
||||
_zip_entry_finalize(cd->entry + i);
|
||||
@@ -62,7 +64,7 @@ _zip_cdir_free(zip_cdir_t *cd) {
|
||||
|
||||
|
||||
zip_cdir_t *
|
||||
_zip_cdir_new(zip_uint64_t nentry, zip_error_t *error) {
|
||||
_zip_cdir_new(zip_error_t *error) {
|
||||
zip_cdir_t *cd;
|
||||
|
||||
if ((cd = (zip_cdir_t *)malloc(sizeof(*cd))) == NULL) {
|
||||
@@ -76,11 +78,6 @@ _zip_cdir_new(zip_uint64_t nentry, zip_error_t *error) {
|
||||
cd->comment = NULL;
|
||||
cd->is_zip64 = false;
|
||||
|
||||
if (!_zip_cdir_grow(cd, nentry, error)) {
|
||||
_zip_cdir_free(cd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return cd;
|
||||
}
|
||||
|
||||
@@ -126,8 +123,6 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor
|
||||
zip_buffer_t *buffer;
|
||||
zip_int64_t off;
|
||||
zip_uint64_t i;
|
||||
bool is_zip64;
|
||||
int ret;
|
||||
zip_uint32_t cdir_crc;
|
||||
|
||||
if ((off = zip_source_tell_write(za->src)) < 0) {
|
||||
@@ -136,8 +131,6 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor
|
||||
}
|
||||
offset = (zip_uint64_t)off;
|
||||
|
||||
is_zip64 = false;
|
||||
|
||||
if (ZIP_WANT_TORRENTZIP(za)) {
|
||||
cdir_crc = (zip_uint32_t)crc32(0, NULL, 0);
|
||||
za->write_crc = &cdir_crc;
|
||||
@@ -146,10 +139,10 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor
|
||||
for (i = 0; i < survivors; i++) {
|
||||
zip_entry_t *entry = za->entry + filelist[i].idx;
|
||||
|
||||
if ((ret = _zip_dirent_write(za, entry->changes ? entry->changes : entry->orig, ZIP_FL_CENTRAL)) < 0)
|
||||
if (_zip_dirent_write(za, entry->changes ? entry->changes : entry->orig, ZIP_FL_CENTRAL) < 0) {
|
||||
za->write_crc = NULL;
|
||||
return -1;
|
||||
if (ret)
|
||||
is_zip64 = true;
|
||||
}
|
||||
}
|
||||
|
||||
za->write_crc = NULL;
|
||||
@@ -160,16 +153,12 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor
|
||||
}
|
||||
size = (zip_uint64_t)off - offset;
|
||||
|
||||
if (offset > ZIP_UINT32_MAX || survivors > ZIP_UINT16_MAX) {
|
||||
is_zip64 = true;
|
||||
}
|
||||
|
||||
if ((buffer = _zip_buffer_new(buf, sizeof(buf))) == NULL) {
|
||||
zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (is_zip64) {
|
||||
if (survivors > ZIP_UINT16_MAX || offset > ZIP_UINT32_MAX || size > ZIP_UINT32_MAX) {
|
||||
_zip_buffer_put(buffer, EOCD64_MAGIC, 4);
|
||||
_zip_buffer_put_64(buffer, EOCD64LEN - 12);
|
||||
_zip_buffer_put_16(buffer, 45);
|
||||
@@ -298,7 +287,8 @@ _zip_dirent_init(zip_dirent_t *de) {
|
||||
de->version_needed = 10; /* 1.0 */
|
||||
de->bitflags = 0;
|
||||
de->comp_method = ZIP_CM_DEFAULT;
|
||||
de->last_mod = 0;
|
||||
de->last_mod.date = 0;
|
||||
de->last_mod.time = 0;
|
||||
de->crc = 0;
|
||||
de->comp_size = 0;
|
||||
de->uncomp_size = 0;
|
||||
@@ -336,7 +326,7 @@ _zip_dirent_new(void) {
|
||||
}
|
||||
|
||||
|
||||
/* _zip_dirent_read(zde, fp, bufp, left, localp, error):
|
||||
/*
|
||||
Fills the zip directory entry zde.
|
||||
|
||||
If buffer is non-NULL, data is taken from there; otherwise data is read from fp as needed.
|
||||
@@ -347,11 +337,12 @@ _zip_dirent_new(void) {
|
||||
*/
|
||||
|
||||
zip_int64_t
|
||||
_zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, bool local, zip_error_t *error) {
|
||||
_zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, bool local, zip_uint64_t central_compressed_size, bool check_consistency, zip_error_t *error) {
|
||||
zip_uint8_t buf[CDENTRYSIZE];
|
||||
zip_uint16_t dostime, dosdate;
|
||||
zip_uint32_t size, variable_size;
|
||||
zip_uint16_t filename_len, comment_len, ef_len;
|
||||
zip_string_t *utf8_string;
|
||||
bool is_zip64 = false;
|
||||
|
||||
bool from_buffer = (buffer != NULL);
|
||||
|
||||
@@ -389,9 +380,8 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo
|
||||
zde->comp_method = _zip_buffer_get_16(buffer);
|
||||
|
||||
/* convert to time_t */
|
||||
dostime = _zip_buffer_get_16(buffer);
|
||||
dosdate = _zip_buffer_get_16(buffer);
|
||||
zde->last_mod = _zip_d2u_time(dostime, dosdate);
|
||||
zde->last_mod.time = _zip_buffer_get_16(buffer);
|
||||
zde->last_mod.date = _zip_buffer_get_16(buffer);
|
||||
|
||||
zde->crc = _zip_buffer_get_32(buffer);
|
||||
zde->comp_size = _zip_buffer_get_32(buffer);
|
||||
@@ -458,7 +448,7 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo
|
||||
|
||||
if (filename_len) {
|
||||
zde->filename = _zip_read_string(buffer, src, filename_len, 1, error);
|
||||
if (!zde->filename) {
|
||||
if (zde->filename == NULL) {
|
||||
if (zip_error_code_zip(error) == ZIP_ER_EOF) {
|
||||
zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_VARIABLE_SIZE_OVERFLOW);
|
||||
}
|
||||
@@ -502,7 +492,7 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo
|
||||
|
||||
if (comment_len) {
|
||||
zde->comment = _zip_read_string(buffer, src, comment_len, 0, error);
|
||||
if (!zde->comment) {
|
||||
if (zde->comment == NULL) {
|
||||
if (!from_buffer) {
|
||||
_zip_buffer_free(buffer);
|
||||
}
|
||||
@@ -519,8 +509,24 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo
|
||||
}
|
||||
}
|
||||
|
||||
zde->filename = _zip_dirent_process_ef_utf_8(zde, ZIP_EF_UTF_8_NAME, zde->filename);
|
||||
zde->comment = _zip_dirent_process_ef_utf_8(zde, ZIP_EF_UTF_8_COMMENT, zde->comment);
|
||||
if ((utf8_string = _zip_dirent_process_ef_utf_8(zde, ZIP_EF_UTF_8_NAME, zde->filename, check_consistency)) == NULL && zde->filename != NULL) {
|
||||
zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_UTF8_FILENAME_MISMATCH);
|
||||
if (!from_buffer) {
|
||||
_zip_buffer_free(buffer);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
zde->filename = utf8_string;
|
||||
if (!local) {
|
||||
if ((utf8_string = _zip_dirent_process_ef_utf_8(zde, ZIP_EF_UTF_8_COMMENT, zde->comment, check_consistency)) == NULL && zde->comment != NULL) {
|
||||
zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_UTF8_COMMENT_MISMATCH);
|
||||
if (!from_buffer) {
|
||||
_zip_buffer_free(buffer);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
zde->comment = utf8_string;
|
||||
}
|
||||
|
||||
/* Zip64 */
|
||||
|
||||
@@ -535,6 +541,7 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
is_zip64 = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -545,10 +552,40 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!from_buffer) {
|
||||
_zip_buffer_free(buffer);
|
||||
}
|
||||
|
||||
if (local && zde->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) {
|
||||
zip_uint32_t df_crc;
|
||||
zip_uint64_t df_comp_size, df_uncomp_size;
|
||||
if (zip_source_seek(src, central_compressed_size, SEEK_CUR) != 0 || (buffer = _zip_buffer_new_from_source(src, MAX_DATA_DESCRIPTOR_LENGTH, buf, error)) == NULL) {
|
||||
return -1;
|
||||
}
|
||||
if (memcmp(_zip_buffer_peek(buffer, MAGIC_LEN), DATADES_MAGIC, MAGIC_LEN) == 0) {
|
||||
_zip_buffer_skip(buffer, MAGIC_LEN);
|
||||
}
|
||||
df_crc = _zip_buffer_get_32(buffer);
|
||||
df_comp_size = is_zip64 ? _zip_buffer_get_64(buffer) : _zip_buffer_get_32(buffer);
|
||||
df_uncomp_size = is_zip64 ? _zip_buffer_get_64(buffer) : _zip_buffer_get_32(buffer);
|
||||
|
||||
if (!_zip_buffer_ok(buffer)) {
|
||||
zip_error_set(error, ZIP_ER_INTERNAL, 0);
|
||||
_zip_buffer_free(buffer);
|
||||
return -1;
|
||||
}
|
||||
_zip_buffer_free(buffer);
|
||||
|
||||
if ((zde->crc != 0 && zde->crc != df_crc) || (zde->comp_size != 0 && zde->comp_size != df_comp_size) || (zde->uncomp_size != 0 && zde->uncomp_size != df_uncomp_size)) {
|
||||
zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_DATA_DESCRIPTOR_MISMATCH);
|
||||
return -1;
|
||||
}
|
||||
zde->crc = df_crc;
|
||||
zde->comp_size = df_comp_size;
|
||||
zde->uncomp_size = df_uncomp_size;
|
||||
}
|
||||
|
||||
/* zip_source_seek / zip_source_tell don't support values > ZIP_INT64_MAX */
|
||||
if (zde->offset > ZIP_INT64_MAX) {
|
||||
zip_error_set(error, ZIP_ER_SEEK, EFBIG);
|
||||
@@ -564,7 +601,8 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo
|
||||
return (zip_int64_t)size + (zip_int64_t)variable_size;
|
||||
}
|
||||
|
||||
bool zip_dirent_process_ef_zip64(zip_dirent_t* zde, const zip_uint8_t* ef, zip_uint64_t got_len, bool local, zip_error_t* error) {
|
||||
bool
|
||||
zip_dirent_process_ef_zip64(zip_dirent_t *zde, const zip_uint8_t *ef, zip_uint64_t got_len, bool local, zip_error_t *error) {
|
||||
zip_buffer_t *ef_buffer;
|
||||
|
||||
if ((ef_buffer = _zip_buffer_new((zip_uint8_t *)ef, got_len)) == NULL) {
|
||||
@@ -625,7 +663,7 @@ bool zip_dirent_process_ef_zip64(zip_dirent_t* zde, const zip_uint8_t* ef, zip_u
|
||||
|
||||
|
||||
static zip_string_t *
|
||||
_zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string_t *str) {
|
||||
_zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string_t *str, bool check_consistency) {
|
||||
zip_uint16_t ef_len;
|
||||
zip_uint32_t ef_crc;
|
||||
zip_buffer_t *buffer;
|
||||
@@ -648,6 +686,14 @@ _zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string
|
||||
zip_string_t *ef_str = _zip_string_new(_zip_buffer_get(buffer, len), len, ZIP_FL_ENC_UTF_8, NULL);
|
||||
|
||||
if (ef_str != NULL) {
|
||||
if (check_consistency) {
|
||||
if (!_zip_string_equal(str, ef_str) && _zip_string_is_ascii(ef_str)) {
|
||||
_zip_string_free(ef_str);
|
||||
_zip_buffer_free(buffer);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
_zip_string_free(str);
|
||||
str = ef_str;
|
||||
}
|
||||
@@ -688,18 +734,18 @@ _zip_dirent_process_winzip_aes(zip_dirent_t *de, zip_error_t *error) {
|
||||
|
||||
crc_valid = true;
|
||||
switch (_zip_buffer_get_16(buffer)) {
|
||||
case 1:
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
|
||||
case 2:
|
||||
crc_valid = false;
|
||||
/* TODO: When checking consistency, check that crc is 0. */
|
||||
break;
|
||||
|
||||
default:
|
||||
zip_error_set(error, ZIP_ER_ENCRNOTSUPP, 0);
|
||||
_zip_buffer_free(buffer);
|
||||
return false;
|
||||
case 2:
|
||||
crc_valid = false;
|
||||
/* TODO: When checking consistency, check that crc is 0. */
|
||||
break;
|
||||
|
||||
default:
|
||||
zip_error_set(error, ZIP_ER_ENCRNOTSUPP, 0);
|
||||
_zip_buffer_free(buffer);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* vendor */
|
||||
@@ -787,7 +833,7 @@ _zip_dirent_size(zip_source_t *src, zip_uint16_t flags, zip_error_t *error) {
|
||||
|
||||
int
|
||||
_zip_dirent_write(zip_t *za, zip_dirent_t *de, zip_flags_t flags) {
|
||||
zip_uint16_t dostime, dosdate;
|
||||
zip_dostime_t dostime;
|
||||
zip_encoding_type_t com_enc, name_enc;
|
||||
zip_extra_field_t *ef;
|
||||
zip_extra_field_t *ef64;
|
||||
@@ -926,14 +972,14 @@ _zip_dirent_write(zip_t *za, zip_dirent_t *de, zip_flags_t flags) {
|
||||
}
|
||||
|
||||
if (ZIP_WANT_TORRENTZIP(za)) {
|
||||
dostime = 0xbc00;
|
||||
dosdate = 0x2198;
|
||||
dostime.time = 0xbc00;
|
||||
dostime.date = 0x2198;
|
||||
}
|
||||
else {
|
||||
_zip_u2d_time(de->last_mod, &dostime, &dosdate);
|
||||
dostime = de->last_mod;
|
||||
}
|
||||
_zip_buffer_put_16(buffer, dostime);
|
||||
_zip_buffer_put_16(buffer, dosdate);
|
||||
_zip_buffer_put_16(buffer, dostime.time);
|
||||
_zip_buffer_put_16(buffer, dostime.date);
|
||||
|
||||
if (is_winzip_aes && de->uncomp_size < 20) {
|
||||
_zip_buffer_put_32(buffer, 0);
|
||||
@@ -1034,7 +1080,7 @@ _zip_dirent_write(zip_t *za, zip_dirent_t *de, zip_flags_t flags) {
|
||||
|
||||
|
||||
time_t
|
||||
_zip_d2u_time(zip_uint16_t dtime, zip_uint16_t ddate) {
|
||||
_zip_d2u_time(const zip_dostime_t *dtime) {
|
||||
struct tm tm;
|
||||
|
||||
memset(&tm, 0, sizeof(tm));
|
||||
@@ -1042,13 +1088,13 @@ _zip_d2u_time(zip_uint16_t dtime, zip_uint16_t ddate) {
|
||||
/* let mktime decide if DST is in effect */
|
||||
tm.tm_isdst = -1;
|
||||
|
||||
tm.tm_year = ((ddate >> 9) & 127) + 1980 - 1900;
|
||||
tm.tm_mon = ((ddate >> 5) & 15) - 1;
|
||||
tm.tm_mday = ddate & 31;
|
||||
tm.tm_year = ((dtime->date >> 9) & 127) + 1980 - 1900;
|
||||
tm.tm_mon = ((dtime->date >> 5) & 15) - 1;
|
||||
tm.tm_mday = dtime->date & 31;
|
||||
|
||||
tm.tm_hour = (dtime >> 11) & 31;
|
||||
tm.tm_min = (dtime >> 5) & 63;
|
||||
tm.tm_sec = (dtime << 1) & 62;
|
||||
tm.tm_hour = (dtime->time >> 11) & 31;
|
||||
tm.tm_min = (dtime->time >> 5) & 63;
|
||||
tm.tm_sec = (dtime->time << 1) & 62;
|
||||
|
||||
return mktime(&tm);
|
||||
}
|
||||
@@ -1119,23 +1165,28 @@ _zip_get_dirent(zip_t *za, zip_uint64_t idx, zip_flags_t flags, zip_error_t *err
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_zip_u2d_time(time_t intime, zip_uint16_t *dtime, zip_uint16_t *ddate) {
|
||||
int
|
||||
_zip_u2d_time(time_t intime, zip_dostime_t *dtime, zip_error_t *ze) {
|
||||
struct tm *tpm;
|
||||
struct tm tm;
|
||||
tpm = zip_localtime(&intime, &tm);
|
||||
if (tpm == NULL) {
|
||||
/* if localtime fails, return an arbitrary date (1980-01-01 00:00:00) */
|
||||
*ddate = (1 << 5) + 1;
|
||||
*dtime = 0;
|
||||
return;
|
||||
dtime->date = (1 << 5) + 1;
|
||||
dtime->time = 0;
|
||||
if (ze) {
|
||||
zip_error_set(ze, ZIP_ER_INVAL, errno);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
if (tpm->tm_year < 80) {
|
||||
tpm->tm_year = 80;
|
||||
}
|
||||
|
||||
*ddate = (zip_uint16_t)(((tpm->tm_year + 1900 - 1980) << 9) + ((tpm->tm_mon + 1) << 5) + tpm->tm_mday);
|
||||
*dtime = (zip_uint16_t)(((tpm->tm_hour) << 11) + ((tpm->tm_min) << 5) + ((tpm->tm_sec) >> 1));
|
||||
dtime->date = (zip_uint16_t)(((tpm->tm_year + 1900 - 1980) << 9) + ((tpm->tm_mon + 1) << 5) + tpm->tm_mday);
|
||||
dtime->time = (zip_uint16_t)(((tpm->tm_hour) << 11) + ((tpm->tm_min) << 5) + ((tpm->tm_sec) >> 1));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1192,10 +1243,11 @@ _zip_dirent_apply_attributes(zip_dirent_t *de, zip_file_attributes_t *attributes
|
||||
Set values suitable for torrentzip.
|
||||
*/
|
||||
|
||||
void zip_dirent_torrentzip_normalize(zip_dirent_t *de) {
|
||||
void
|
||||
zip_dirent_torrentzip_normalize(zip_dirent_t *de) {
|
||||
de->version_madeby = 0;
|
||||
de->version_needed = 20; /* 2.0 */
|
||||
de->bitflags = 2; /* maximum compression */
|
||||
de->bitflags = 2; /* maximum compression */
|
||||
de->comp_method = ZIP_CM_DEFLATE;
|
||||
de->compression_level = TORRENTZIP_COMPRESSION_FLAGS;
|
||||
de->disk_number = 0;
|
||||
@@ -1203,5 +1255,12 @@ void zip_dirent_torrentzip_normalize(zip_dirent_t *de) {
|
||||
de->ext_attrib = 0;
|
||||
|
||||
/* last_mod, extra_fields, and comment are normalized in zip_dirent_write() directly */
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
zip_dirent_check_consistency(zip_dirent_t *dirent) {
|
||||
if (dirent->comp_method == ZIP_CM_STORE && dirent->comp_size != dirent->uncomp_size) {
|
||||
return ZIP_ER_DETAIL_STORED_SIZE_MISMATCH;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
2
3rdparty/libzip/lib/zip_discard.c
vendored
2
3rdparty/libzip/lib/zip_discard.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_discard.c -- discard and free struct zip
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_entry.c
vendored
2
3rdparty/libzip/lib/zip_entry.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_entry.c -- struct zip_entry helper functions
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_error.c
vendored
2
3rdparty/libzip/lib/zip_error.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_error.c -- zip_error_t helper functions
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_error_clear.c
vendored
2
3rdparty/libzip/lib/zip_error_clear.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_error_clear.c -- clear zip error
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_error_get.c
vendored
2
3rdparty/libzip/lib/zip_error_get.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_error_get.c -- get zip error
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_error_get_sys_type.c
vendored
2
3rdparty/libzip/lib/zip_error_get_sys_type.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_error_get_sys_type.c -- return type of system error code
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
14
3rdparty/libzip/lib/zip_error_strerror.c
vendored
14
3rdparty/libzip/lib/zip_error_strerror.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_error_sterror.c -- get string representation of struct zip_error
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -49,6 +49,9 @@ zip_error_strerror(zip_error_t *err) {
|
||||
|
||||
if (err->zip_err < 0 || err->zip_err >= _zip_err_str_count) {
|
||||
system_error_buffer = (char *)malloc(128);
|
||||
if (system_error_buffer == NULL) {
|
||||
return _zip_err_str[ZIP_ER_MEMORY].description;
|
||||
}
|
||||
snprintf_s(system_error_buffer, 128, "Unknown error %d", err->zip_err);
|
||||
system_error_buffer[128 - 1] = '\0'; /* make sure string is NUL-terminated */
|
||||
zip_error_string = NULL;
|
||||
@@ -61,6 +64,9 @@ zip_error_strerror(zip_error_t *err) {
|
||||
case ZIP_ET_SYS: {
|
||||
size_t len = strerrorlen_s(err->sys_err) + 1;
|
||||
system_error_buffer = malloc(len);
|
||||
if (system_error_buffer == NULL) {
|
||||
return _zip_err_str[ZIP_ER_MEMORY].description;
|
||||
}
|
||||
strerror_s(system_error_buffer, len, err->sys_err);
|
||||
system_error_string = system_error_buffer;
|
||||
break;
|
||||
@@ -79,12 +85,18 @@ zip_error_strerror(zip_error_t *err) {
|
||||
}
|
||||
else if (error >= _zip_err_details_count) {
|
||||
system_error_buffer = (char *)malloc(128);
|
||||
if (system_error_buffer == NULL) {
|
||||
return _zip_err_str[ZIP_ER_MEMORY].description;
|
||||
}
|
||||
snprintf_s(system_error_buffer, 128, "invalid detail error %u", error);
|
||||
system_error_buffer[128 - 1] = '\0'; /* make sure string is NUL-terminated */
|
||||
system_error_string = system_error_buffer;
|
||||
}
|
||||
else if (_zip_err_details[error].type == ZIP_DETAIL_ET_ENTRY && index < MAX_DETAIL_INDEX) {
|
||||
system_error_buffer = (char *)malloc(128);
|
||||
if (system_error_buffer == NULL) {
|
||||
return _zip_err_str[ZIP_ER_MEMORY].description;
|
||||
}
|
||||
snprintf_s(system_error_buffer, 128, "entry %d: %s", index, _zip_err_details[error].description);
|
||||
system_error_buffer[128 - 1] = '\0'; /* make sure string is NUL-terminated */
|
||||
system_error_string = system_error_buffer;
|
||||
|
||||
2
3rdparty/libzip/lib/zip_error_to_str.c
vendored
2
3rdparty/libzip/lib/zip_error_to_str.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_error_to_str.c -- get string representation of zip error code
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_extra_field.c
vendored
2
3rdparty/libzip/lib/zip_extra_field.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_extra_field.c -- manipulate extra fields
|
||||
Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2012-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
6
3rdparty/libzip/lib/zip_extra_field_api.c
vendored
6
3rdparty/libzip/lib/zip_extra_field_api.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_extra_field_api.c -- public extra fields API functions
|
||||
Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2012-2024 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -56,10 +56,6 @@ zip_file_extra_field_delete(zip_t *za, zip_uint64_t idx, zip_uint16_t ef_idx, zi
|
||||
zip_error_set(&za->error, ZIP_ER_RDONLY, 0);
|
||||
return -1;
|
||||
}
|
||||
if (ZIP_WANT_TORRENTZIP(za)) {
|
||||
zip_error_set(&za->error, ZIP_ER_NOT_ALLOWED, 0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (_zip_file_extra_field_prepare_for_change(za, idx) < 0)
|
||||
return -1;
|
||||
|
||||
2
3rdparty/libzip/lib/zip_fclose.c
vendored
2
3rdparty/libzip/lib/zip_fclose.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_fclose.c -- close file in zip archive
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_fdopen.c
vendored
2
3rdparty/libzip/lib/zip_fdopen.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_fdopen.c -- open read-only archive from file descriptor
|
||||
Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2009-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_file_add.c
vendored
2
3rdparty/libzip/lib/zip_file_add.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_add.c -- add file via callback function
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_file_error_clear.c
vendored
2
3rdparty/libzip/lib/zip_file_error_clear.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_error_clear.c -- clear zip file error
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_file_error_get.c
vendored
2
3rdparty/libzip/lib/zip_file_error_get.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_error_get.c -- get zip file error
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_file_get_comment.c
vendored
2
3rdparty/libzip/lib/zip_file_get_comment.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_get_comment.c -- get file comment
|
||||
Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2006-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_get_external_attributes.c -- get opsys/external attributes
|
||||
Copyright (C) 2013-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2013-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_file_get_offset.c
vendored
2
3rdparty/libzip/lib/zip_file_get_offset.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_get_offset.c -- get offset of file data in archive.
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_file_rename.c
vendored
2
3rdparty/libzip/lib/zip_file_rename.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_rename.c -- rename file in zip archive
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
8
3rdparty/libzip/lib/zip_file_replace.c
vendored
8
3rdparty/libzip/lib/zip_file_replace.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_replace.c -- replace file via callback function
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -83,6 +83,12 @@ _zip_file_replace(zip_t *za, zip_uint64_t idx, const char *name, zip_source_t *s
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* delete all extra fields - these are usually data that are
|
||||
* strongly coupled with the original data */
|
||||
if (zip_file_extra_field_delete(za, idx, ZIP_EXTRA_FIELD_ALL, ZIP_FL_CENTRAL | ZIP_FL_LOCAL) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* does not change any name related data, so we can do it here;
|
||||
* needed for a double add of the same file name */
|
||||
_zip_unchange_data(za->entry + idx);
|
||||
|
||||
2
3rdparty/libzip/lib/zip_file_set_comment.c
vendored
2
3rdparty/libzip/lib/zip_file_set_comment.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_set_comment.c -- set comment for file in archive
|
||||
Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2006-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_set_encryption.c -- set encryption for file in archive
|
||||
Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2016-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_set_external_attributes.c -- set external attributes for entry
|
||||
Copyright (C) 2013-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2013-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
26
3rdparty/libzip/lib/zip_file_set_mtime.c
vendored
26
3rdparty/libzip/lib/zip_file_set_mtime.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_set_mtime.c -- set modification time of entry.
|
||||
Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2014-2024 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -35,17 +35,11 @@
|
||||
|
||||
ZIP_EXTERN int
|
||||
zip_file_set_dostime(zip_t *za, zip_uint64_t idx, zip_uint16_t dtime, zip_uint16_t ddate, zip_flags_t flags) {
|
||||
time_t mtime;
|
||||
mtime = _zip_d2u_time(dtime, ddate);
|
||||
return zip_file_set_mtime(za, idx, mtime, flags);
|
||||
}
|
||||
|
||||
ZIP_EXTERN int
|
||||
zip_file_set_mtime(zip_t *za, zip_uint64_t idx, time_t mtime, zip_flags_t flags) {
|
||||
zip_entry_t *e;
|
||||
|
||||
if (_zip_get_dirent(za, idx, 0, NULL) == NULL)
|
||||
if (_zip_get_dirent(za, idx, 0, NULL) == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ZIP_IS_RDONLY(za)) {
|
||||
zip_error_set(&za->error, ZIP_ER_RDONLY, 0);
|
||||
@@ -70,8 +64,20 @@ zip_file_set_mtime(zip_t *za, zip_uint64_t idx, time_t mtime, zip_flags_t flags)
|
||||
}
|
||||
}
|
||||
|
||||
e->changes->last_mod = mtime;
|
||||
e->changes->last_mod.time = dtime;
|
||||
e->changes->last_mod.date = ddate;
|
||||
e->changes->changed |= ZIP_DIRENT_LAST_MOD;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ZIP_EXTERN int
|
||||
zip_file_set_mtime(zip_t *za, zip_uint64_t idx, time_t mtime, zip_flags_t flags) {
|
||||
zip_dostime_t dostime;
|
||||
|
||||
if (_zip_u2d_time(mtime, &dostime, &za->error) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return zip_file_set_dostime(za, idx, dostime.time, dostime.date, flags);
|
||||
}
|
||||
|
||||
2
3rdparty/libzip/lib/zip_file_strerror.c
vendored
2
3rdparty/libzip/lib/zip_file_strerror.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_file_sterror.c -- get string representation of zip file error
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_fopen.c
vendored
2
3rdparty/libzip/lib/zip_fopen.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_fopen.c -- open file in zip archive for reading
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_fopen_encrypted.c
vendored
2
3rdparty/libzip/lib/zip_fopen_encrypted.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_fopen_encrypted.c -- open file for reading with password
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
2
3rdparty/libzip/lib/zip_fopen_index.c
vendored
2
3rdparty/libzip/lib/zip_fopen_index.c
vendored
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_fopen_index.c -- open file in zip archive for reading by index
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_fopen_index_encrypted.c -- open file for reading by index w/ password
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user