Hunt down more bugs

After going through the MODE=dbg and MODE=zero build modes, a bunch of
little issues were identified, which have been addressed. Fixing those
issues created even more troubles for the project, because it improved
our ability to detect latent problems which are getting fixed so fast.
This commit is contained in:
Justine Tunney 2023-07-03 17:35:11 -07:00
parent 73c0faa1b5
commit 97b7116953
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
39 changed files with 557 additions and 754 deletions

View file

@ -1,4 +1,6 @@
// clang-format off
#ifdef __x86_64__
/*
* xxHash - Extremely Fast Hash algorithm
* Copyright (C) 2020-2021 Yann Collet
@ -806,3 +808,5 @@ XXH3_128bits_update_dispatch(XXH_NOESCAPE XXH3_state_t* state, XXH_NOESCAPE cons
}
#endif
/*! @} */
#endif /* __x86_64__ */

View file

@ -177,6 +177,7 @@
* @file xxhash.h
* xxHash prototypes and implementation
*/
#include "third_party/aarch64/arm_neon.internal.h"
#if defined (__cplusplus)
extern "C" {

View file

@ -12,36 +12,36 @@ THIRD_PARTY_XXHASH_SRCS = $(filter %.c,$(THIRD_PARTY_XXHASH_FILES))
THIRD_PARTY_XXHASH_OBJS = $(THIRD_PARTY_XXHASH_SRCS:%.c=o/$(MODE)/%.o)
THIRD_PARTY_XXHASH_A_DIRECTDEPS = \
LIBC_CALLS \
LIBC_FMT \
LIBC_INTRIN \
LIBC_MEM \
LIBC_RUNTIME \
LIBC_STDIO \
LIBC_STR \
LIBC_SYSV \
LIBC_CALLS \
LIBC_FMT \
LIBC_INTRIN \
LIBC_MEM \
LIBC_RUNTIME \
LIBC_STDIO \
LIBC_STR \
LIBC_SYSV \
LIBC_TIME
THIRD_PARTY_XXHASH_A_DEPS := \
THIRD_PARTY_XXHASH_A_DEPS := \
$(call uniq,$(foreach x,$(THIRD_PARTY_XXHASH_A_DIRECTDEPS),$($(x))))
THIRD_PARTY_XXHASH_CHECKS = \
$(THIRD_PARTY_XXHASH_A).pkg \
THIRD_PARTY_XXHASH_CHECKS = \
$(THIRD_PARTY_XXHASH_A).pkg \
$(THIRD_PARTY_XXHASH_HDRS:%=o/$(MODE)/%.ok)
$(THIRD_PARTY_XXHASH_A): \
third_party/xxhash/ \
$(THIRD_PARTY_XXHASH_A).pkg \
third_party/xxhash/ \
$(THIRD_PARTY_XXHASH_A).pkg \
$(THIRD_PARTY_XXHASH_OBJS)
$(THIRD_PARTY_XXHASH_A).pkg: \
$(THIRD_PARTY_XXHASH_OBJS) \
$(THIRD_PARTY_XXHASH_A).pkg: \
$(THIRD_PARTY_XXHASH_OBJS) \
$(foreach x,$(THIRD_PARTY_XXHASH_A_DIRECTDEPS),$($(x)_A).pkg)
o/$(MODE)/third_party/xxhash/xxhsum.com.dbg: \
$(THIRD_PARTY_XXHASH) \
o/$(MODE)/third_party/xxhash/cli/xxhsum.o \
$(CRT) \
$(THIRD_PARTY_XXHASH) \
o/$(MODE)/third_party/xxhash/cli/xxhsum.o \
$(CRT) \
$(APE_NO_MODIFY_SELF)
@$(APELINK)
@ -50,6 +50,6 @@ THIRD_PARTY_XXHASH_COMS = o/$(MODE)/third_party/xxhash/xxhsum.com
THIRD_PARTY_XXHASH_LIBS = $(THIRD_PARTY_XXHASH_A)
.PHONY: o/$(MODE)/third_party/xxhash
o/$(MODE)/third_party/xxhash: \
o/$(MODE)/third_party/xxhash: \
$(THIRD_PARTY_XXHASH_BINS) \
$(THIRD_PARTY_XXHASH_CHECKS)

View file

@ -39,6 +39,7 @@
#else
# define ZSTD_TRACE 0
#endif
#include "third_party/aarch64/arm_neon.internal.h"
#if defined (__cplusplus)
extern "C" {

View file

@ -6,58 +6,153 @@ PKGS += THIRD_PARTY_ZSTD
THIRD_PARTY_ZSTD_ARTIFACTS += THIRD_PARTY_ZSTD_A
THIRD_PARTY_ZSTD = $(THIRD_PARTY_ZSTD_A_DEPS) $(THIRD_PARTY_ZSTD_A)
THIRD_PARTY_ZSTD_A = o/$(MODE)/third_party/zstd/zstd.a
THIRD_PARTY_ZSTD_A_FILES := $(shell find ./third_party/zstd/lib -type f) $(wildcard third_party/zstd/programs/*)
THIRD_PARTY_ZSTD_A_HDRS = $(filter %.h,$(THIRD_PARTY_ZSTD_A_FILES))
THIRD_PARTY_ZSTD_A_SRCS = $(filter %.c,$(THIRD_PARTY_ZSTD_A_FILES))
THIRD_PARTY_ZSTD_A_INCS = $(filter %.inc,$(THIRD_PARTY_ZSTD_A_FILES))
THIRD_PARTY_ZSTD_A_OBJS = $(THIRD_PARTY_ZSTD_A_SRCS:%.c=o/$(MODE)/%.o)
THIRD_PARTY_ZSTD_A_CHECKS = \
$(THIRD_PARTY_ZSTD_A).pkg \
THIRD_PARTY_ZSTD_A_FILES := \
third_party/zstd/lib/common/allocations.h \
third_party/zstd/lib/common/bits.h \
third_party/zstd/lib/common/bitstream.h \
third_party/zstd/lib/common/compiler.h \
third_party/zstd/lib/common/cpu.h \
third_party/zstd/lib/common/debug.c \
third_party/zstd/lib/common/debug.h \
third_party/zstd/lib/common/entropy_common.c \
third_party/zstd/lib/common/error_private.c \
third_party/zstd/lib/common/error_private.h \
third_party/zstd/lib/common/fse.h \
third_party/zstd/lib/common/fse_decompress.c \
third_party/zstd/lib/common/huf.h \
third_party/zstd/lib/common/mem.h \
third_party/zstd/lib/common/pool.c \
third_party/zstd/lib/common/pool.h \
third_party/zstd/lib/common/portability_macros.h \
third_party/zstd/lib/common/threading.c \
third_party/zstd/lib/common/threading.h \
third_party/zstd/lib/common/xxhash.c \
third_party/zstd/lib/common/xxhash.h \
third_party/zstd/lib/common/zstd_common.c \
third_party/zstd/lib/common/zstd_deps.h \
third_party/zstd/lib/common/zstd_internal.h \
third_party/zstd/lib/common/zstd_trace.h \
third_party/zstd/lib/compress/clevels.h \
third_party/zstd/lib/compress/fse_compress.c \
third_party/zstd/lib/compress/hist.c \
third_party/zstd/lib/compress/hist.h \
third_party/zstd/lib/compress/huf_compress.c \
third_party/zstd/lib/compress/zstd_compress.c \
third_party/zstd/lib/compress/zstd_compress_internal.h \
third_party/zstd/lib/compress/zstd_compress_literals.c \
third_party/zstd/lib/compress/zstd_compress_literals.h \
third_party/zstd/lib/compress/zstd_compress_sequences.c \
third_party/zstd/lib/compress/zstd_compress_sequences.h \
third_party/zstd/lib/compress/zstd_compress_superblock.c \
third_party/zstd/lib/compress/zstd_compress_superblock.h \
third_party/zstd/lib/compress/zstd_cwksp.h \
third_party/zstd/lib/compress/zstd_double_fast.c \
third_party/zstd/lib/compress/zstd_double_fast.h \
third_party/zstd/lib/compress/zstd_fast.c \
third_party/zstd/lib/compress/zstd_fast.h \
third_party/zstd/lib/compress/zstd_lazy.c \
third_party/zstd/lib/compress/zstd_lazy.h \
third_party/zstd/lib/compress/zstd_ldm.c \
third_party/zstd/lib/compress/zstd_ldm.h \
third_party/zstd/lib/compress/zstd_ldm_geartab.h \
third_party/zstd/lib/compress/zstd_opt.c \
third_party/zstd/lib/compress/zstd_opt.h \
third_party/zstd/lib/compress/zstdmt_compress.c \
third_party/zstd/lib/compress/zstdmt_compress.h \
third_party/zstd/lib/decompress/huf_decompress.c \
third_party/zstd/lib/decompress/huf_decompress_amd64.S \
third_party/zstd/lib/decompress/zstd_ddict.c \
third_party/zstd/lib/decompress/zstd_ddict.h \
third_party/zstd/lib/decompress/zstd_decompress.c \
third_party/zstd/lib/decompress/zstd_decompress_block.c \
third_party/zstd/lib/decompress/zstd_decompress_block.h \
third_party/zstd/lib/decompress/zstd_decompress_internal.h \
third_party/zstd/lib/deprecated/zbuff.h \
third_party/zstd/lib/deprecated/zbuff_common.c \
third_party/zstd/lib/deprecated/zbuff_compress.c \
third_party/zstd/lib/deprecated/zbuff_decompress.c \
third_party/zstd/lib/dictBuilder/cover.c \
third_party/zstd/lib/dictBuilder/cover.h \
third_party/zstd/lib/dictBuilder/divsufsort.c \
third_party/zstd/lib/dictBuilder/divsufsort.h \
third_party/zstd/lib/dictBuilder/fastcover.c \
third_party/zstd/lib/dictBuilder/zdict.c \
third_party/zstd/programs/benchfn.c \
third_party/zstd/programs/benchfn.h \
third_party/zstd/programs/benchzstd.c \
third_party/zstd/programs/benchzstd.h \
third_party/zstd/programs/datagen.c \
third_party/zstd/programs/datagen.h \
third_party/zstd/programs/dibio.c \
third_party/zstd/programs/dibio.h \
third_party/zstd/programs/fileio.c \
third_party/zstd/programs/fileio.h \
third_party/zstd/programs/fileio_asyncio.c \
third_party/zstd/programs/fileio_asyncio.h \
third_party/zstd/programs/fileio_common.h \
third_party/zstd/programs/fileio_types.h \
third_party/zstd/programs/platform.h \
third_party/zstd/programs/timefn.c \
third_party/zstd/programs/timefn.h \
third_party/zstd/programs/util.c \
third_party/zstd/programs/util.h \
third_party/zstd/programs/zstdcli.c \
third_party/zstd/programs/zstdcli_trace.c \
third_party/zstd/programs/zstdcli_trace.h
THIRD_PARTY_ZSTD_A_CHECKS = \
$(THIRD_PARTY_ZSTD_A).pkg \
$(THIRD_PARTY_ZSTD_A_HDRS:%=o/$(MODE)/%.ok)
THIRD_PARTY_ZSTD_A_DIRECTDEPS = \
LIBC_INTRIN \
LIBC_NEXGEN32E \
LIBC_STR \
LIBC_MEM \
LIBC_STDIO \
LIBC_TIME \
LIBC_CALLS \
LIBC_RUNTIME \
THIRD_PARTY_ZSTD_A_DIRECTDEPS = \
LIBC_INTRIN \
LIBC_NEXGEN32E \
LIBC_STR \
LIBC_MEM \
LIBC_STDIO \
LIBC_TIME \
LIBC_CALLS \
LIBC_RUNTIME \
LIBC_FMT \
LIBC_LOG \
LIBC_SYSV
THIRD_PARTY_ZSTD_A_DEPS := \
THIRD_PARTY_ZSTD_A_DEPS := \
$(call uniq,$(foreach x,$(THIRD_PARTY_ZSTD_A_DIRECTDEPS),$($(x))))
$(THIRD_PARTY_ZSTD_A): \
third_party/zstd/ \
$(THIRD_PARTY_ZSTD_A).pkg \
$(THIRD_PARTY_ZSTD_A): \
third_party/zstd/ \
$(THIRD_PARTY_ZSTD_A).pkg \
$(THIRD_PARTY_ZSTD_A_OBJS)
$(THIRD_PARTY_ZSTD_A).pkg: \
$(THIRD_PARTY_ZSTD_A_OBJS) \
$(THIRD_PARTY_ZSTD_A).pkg: \
$(THIRD_PARTY_ZSTD_A_OBJS) \
$(foreach x,$(THIRD_PARTY_ZSTD_A_DIRECTDEPS),$($(x)_A).pkg)
$(THIRD_PARTY_ZSTD_A_CHECKS): private \
CFLAGS += \
-Wframe-larger-than=262144 \
$(THIRD_PARTY_ZSTD_A_CHECKS): private \
CFLAGS += \
-Wframe-larger-than=262144 \
-Wno-comment
$(THIRD_PARTY_ZSTD_A_OBJS): private \
CFLAGS += \
-Wframe-larger-than=262144 \
$(THIRD_PARTY_ZSTD_A_OBJS): private \
CFLAGS += \
-Wframe-larger-than=262144 \
-Wno-comment
o/$(MODE)/third_party/zstd/zstd.com.dbg: \
$(THIRD_PARTY_ZSTD) \
o/$(MODE)/third_party/zstd/programs/zstdcli.o \
$(CRT) \
$(THIRD_PARTY_ZSTD) \
o/$(MODE)/third_party/zstd/programs/zstdcli.o \
$(CRT) \
$(APE_NO_MODIFY_SELF)
@$(APELINK)
o/$(MODE)/third_party/zstd/lib/compress/zstd_lazy.o: \
QUOTA += -C64
THIRD_PARTY_ZSTD_BINS = $(THIRD_PARTY_ZSTD_COMS) $(THIRD_PARTY_ZSTD_COMS:%=%.dbg)
THIRD_PARTY_ZSTD_COMS = o/$(MODE)/third_party/zstd/zstd.com
@ -68,6 +163,6 @@ THIRD_PARTY_ZSTD_OBJS = $(foreach x,$(THIRD_PARTY_ZSTD_ARTIFACTS),$($(x)_OBJS))
$(THIRD_PARTY_ZSTD_OBJS): $(BUILD_FILES) third_party/zstd/zstd.mk
.PHONY: o/$(MODE)/third_party/zstd
o/$(MODE)/third_party/zstd: \
o/$(MODE)/third_party/zstd: \
$(THIRD_PARTY_ZSTD_BINS) \
$(THIRD_PARTY_ZSTD_CHECKS)