mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
Fix ZipOS extraction of ZIP64 assets
This commit is contained in:
parent
bef2cb05ff
commit
9ff65cff63
7 changed files with 50 additions and 24 deletions
|
@ -22,14 +22,14 @@
|
|||
# - tool/build/runit.c
|
||||
# - tool/build/runitd.c
|
||||
|
||||
.PRECIOUS: o/$(MODE)/%.com.ok
|
||||
o/$(MODE)/%.com.ok: private .PLEDGE = stdio rpath wpath cpath proc fattr inet dns
|
||||
o/$(MODE)/%.com.ok: private .UNVEIL += r:/etc/resolv.conf
|
||||
o/$(MODE)/%.com.ok: \
|
||||
o/$(MODE)/tool/build/runit.com \
|
||||
o/$(MODE)/tool/build/runitd.com \
|
||||
o/$(MODE)/%.com
|
||||
.PRECIOUS: o/$(MODE)/%.ok
|
||||
o/$(MODE)/%.ok: private .PLEDGE = stdio rpath wpath cpath proc fattr inet dns
|
||||
o/$(MODE)/%.ok: private .UNVEIL += r:/etc/resolv.conf
|
||||
o/$(MODE)/%.ok: \
|
||||
o/$(MODE)/tool/build/runit \
|
||||
o/$(MODE)/tool/build/runitd \
|
||||
o/$(MODE)/%
|
||||
@$(COMPILE) -wATEST -tT$@ $^ $(HOSTS)
|
||||
|
||||
.PHONY:
|
||||
o/tiny/tool/build/runit.com:
|
||||
o/tiny/tool/build/runit:
|
||||
|
|
|
@ -154,6 +154,7 @@
|
|||
#define X86_XTPR 1H, ECX, 14, 0
|
||||
#define X86_ZERO_FCS_FDS 7H, EBX, 13, 0
|
||||
#define X86_JIT 80000001H, ECX, 31, 0 /* IsGenuineBlink() */
|
||||
#define X86_HYBRID_CPU 7H, EDX, 15, 0 /* Has performance and efficiency cores */
|
||||
/* clang-format on */
|
||||
|
||||
/* AMD specific features */
|
||||
|
|
|
@ -29,8 +29,12 @@ int64_t GetZipCfileCompressedSize(const uint8_t *z) {
|
|||
const uint8_t *pe = p + ZIP_CFILE_EXTRASIZE(z);
|
||||
for (; p + ZIP_EXTRA_SIZE(p) <= pe; p += ZIP_EXTRA_SIZE(p)) {
|
||||
if (ZIP_EXTRA_HEADERID(p) == kZipExtraZip64) {
|
||||
if (8 <= ZIP_EXTRA_CONTENTSIZE(p)) {
|
||||
return ZIP_READ64(ZIP_EXTRA_CONTENT(p));
|
||||
int offset = 0;
|
||||
if (ZIP_CFILE_UNCOMPRESSEDSIZE(z) == 0xFFFFFFFFu) {
|
||||
offset += 8;
|
||||
}
|
||||
if (offset + 8 <= ZIP_EXTRA_CONTENTSIZE(p)) {
|
||||
return ZIP_READ64(ZIP_EXTRA_CONTENT(p) + offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,12 +29,8 @@ int64_t GetZipCfileUncompressedSize(const uint8_t *z) {
|
|||
const uint8_t *pe = p + ZIP_CFILE_EXTRASIZE(z);
|
||||
for (; p + ZIP_EXTRA_SIZE(p) <= pe; p += ZIP_EXTRA_SIZE(p)) {
|
||||
if (ZIP_EXTRA_HEADERID(p) == kZipExtraZip64) {
|
||||
int offset = 0;
|
||||
if (ZIP_CFILE_COMPRESSEDSIZE(z) == 0xFFFFFFFFu) {
|
||||
offset += 8;
|
||||
}
|
||||
if (offset + 8 <= ZIP_EXTRA_CONTENTSIZE(p)) {
|
||||
return ZIP_READ64(ZIP_EXTRA_CONTENT(p) + offset);
|
||||
if (8 <= ZIP_EXTRA_CONTENTSIZE(p)) {
|
||||
return ZIP_READ64(ZIP_EXTRA_CONTENT(p));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,8 +29,12 @@ int64_t GetZipLfileCompressedSize(const uint8_t *z) {
|
|||
const uint8_t *pe = p + ZIP_LFILE_EXTRASIZE(z);
|
||||
for (; p + ZIP_EXTRA_SIZE(p) <= pe; p += ZIP_EXTRA_SIZE(p)) {
|
||||
if (ZIP_EXTRA_HEADERID(p) == kZipExtraZip64) {
|
||||
if (8 <= ZIP_EXTRA_CONTENTSIZE(p)) {
|
||||
return ZIP_READ64(ZIP_EXTRA_CONTENT(p));
|
||||
int offset = 0;
|
||||
if (ZIP_LFILE_UNCOMPRESSEDSIZE(z) == 0xFFFFFFFFu) {
|
||||
offset += 8;
|
||||
}
|
||||
if (offset + 8 <= ZIP_EXTRA_CONTENTSIZE(p)) {
|
||||
return ZIP_READ64(ZIP_EXTRA_CONTENT(p) + offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,12 +29,8 @@ int64_t GetZipLfileUncompressedSize(const uint8_t *z) {
|
|||
const uint8_t *pe = p + ZIP_LFILE_EXTRASIZE(z);
|
||||
for (; p + ZIP_EXTRA_SIZE(p) <= pe; p += ZIP_EXTRA_SIZE(p)) {
|
||||
if (ZIP_EXTRA_HEADERID(p) == kZipExtraZip64) {
|
||||
int offset = 0;
|
||||
if (ZIP_LFILE_COMPRESSEDSIZE(z) == 0xFFFFFFFFu) {
|
||||
offset += 8;
|
||||
}
|
||||
if (offset + 8 <= ZIP_EXTRA_CONTENTSIZE(p)) {
|
||||
return ZIP_READ64(ZIP_EXTRA_CONTENT(p) + offset);
|
||||
if (8 <= ZIP_EXTRA_CONTENTSIZE(p)) {
|
||||
return ZIP_READ64(ZIP_EXTRA_CONTENT(p));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
"__AVX5124VNNIW__"
|
||||
"__AVX512VBMI__"
|
||||
"__AVX512VNNI__"
|
||||
"__AVX512VL__"
|
||||
"__AVXVNNI__"
|
||||
"__AVXVNNIINT8__"
|
||||
"__AVXVNNIINT16__"
|
||||
|
@ -100,7 +101,31 @@
|
|||
"__arm__"
|
||||
"__aarch64__"
|
||||
"__AARCH64EB__"
|
||||
"__ARM_ARCH"
|
||||
"__ARM_NEON"
|
||||
"__ARM_FEATURE_FMA"
|
||||
"__ARM_FEATURE_FP16_VECTOR_ARITHMETIC"
|
||||
"__ARM_FEATURE_DOTPROD"
|
||||
"__ARM_FEATURE_FRINT"
|
||||
"__ARM_FEATURE_RNG"
|
||||
"__ARM_FEATURE_CLZ"
|
||||
"__ARM_FEATURE_CRC32"
|
||||
"__ARM_FEATURE_CRYPTO"
|
||||
"__ARM_FEATURE_ATOMICS"
|
||||
"__ARM_FEATURE_MATMUL_INT8"
|
||||
"__ARM_FEATURE_NUMERIC_MAXMIN"
|
||||
"__ARM_FEATURE_QBIT"
|
||||
"__ARM_FEATURE_QRDMX"
|
||||
"__ARM_FEATURE_SHA2"
|
||||
"__ARM_FEATURE_SHA3"
|
||||
"__ARM_FEATURE_SHA512"
|
||||
"__ARM_FEATURE_SM3"
|
||||
"__ARM_FEATURE_SM4"
|
||||
"__ARM_FEATURE_FP16_FML"
|
||||
"__ARM_FP16_ARGS"
|
||||
"__ARM_FP16_FORMAT_ALTERNATIVE"
|
||||
"__ARM_FP16_IEEE"
|
||||
"__ARM_FP_FAST"
|
||||
"__powerpc__"
|
||||
"__powerpc64__"
|
||||
"__POWER9_VECTOR__"
|
||||
|
|
Loading…
Reference in a new issue