Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package/libchdr/0001-cmake-add-WITH_SYSTEM_LZMA-option.patch
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ sent.
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,7 @@ endif()
@@ -8,6 +8,7 @@
option(INSTALL_STATIC_LIBS "Install static libraries" OFF)
option(WITH_SYSTEM_ZLIB "Use system provided zlib library" OFF)
option(WITH_SYSTEM_ZSTD "Use system provided zstd library" OFF)
+option(WITH_SYSTEM_LZMA "Use system provided lzma-sdk library" OFF)
option(CHDR_WANT_RAW_DATA_SECTOR "Output ECC data and sync header" ON)
option(CHDR_WANT_SUBCODE "Output CD subchannel data" ON)
option(CHDR_VERIFY_BLOCK_CRC "Verify integrity of decoded data" ON)
@@ -42,10 +43,17 @@ include(GNUInstallDirs)
@@ -66,10 +67,17 @@
#--------------------------------------------------

# lzma
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ libchdr_chd: drop the redundant vendored LzmaDec.h include

Companion to patches 0001/0002, and the last hardcoded deps/ reference
on the lzma path. src/libchdr_chd.c includes
"../deps/lzma-26.02/include/LzmaDec.h" a second time at line 76, six
"../deps/lzma-26.02/include/LzmaDec.h" a second time at line 77, six
lines after it already pulled in "codec_lzma.h" (which provides
LzmaDec.h itself -- system or vendored, correctly selected by patch
0002). Under WITH_SYSTEM_LZMA this duplicate would re-open the vendored
Expand All @@ -25,7 +25,7 @@ sent.
diff --git a/src/libchdr_chd.c b/src/libchdr_chd.c
--- a/src/libchdr_chd.c
+++ b/src/libchdr_chd.c
@@ -73,8 +73,6 @@
@@ -74,8 +74,6 @@
#include "../include/libchdr/huffman.h"
#include "../include/libchdr/macros.h"

Expand Down
184 changes: 0 additions & 184 deletions package/libchdr/0005-chd-crc16-slicing-by-4.patch

This file was deleted.

2 changes: 1 addition & 1 deletion package/libchdr/libchdr.hash
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# touch a comment, so a literal here goes stale on the first automatic bump.
# Both of these had (they still named the 04a177ee pin, two bumps back), as
# did the "verified at pin time (2026-07-17)" date this replaces.
sha256 6b7a04ae29ad497dcae4a0f918b289df7df95eea6dd2deed8c420b2ee2c481cd libchdr-970a0ce060c0aa1012b1eebba1433c9a9e8ac8b9.tar.gz
sha256 04d6c61946c95addb78f4554740283b93249b81d8437e3d8a58ca1899c824dcc libchdr-8e7b8bd32bc676b7e5c6b42fe7d2daca986c4a0d.tar.gz
# LICENSE.txt -- the BSD-3-Clause text; see the LIBCHDR_LICENSE comment in
# the .mk (the bundled dr_flac's public-domain/MIT-0 statements live inside
# include/dr_libs/dr_flac.h itself, no separate file exists to hash)
Expand Down
49 changes: 23 additions & 26 deletions package/libchdr/libchdr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
# recover it from git history at this file's 2026-08-24 change if it is
# ever needed again.
#
# PATCH 0005 is a performance change, not a correctness one. crc16 is
# byte-at-a-time and runs on EVERY hunk read (VERIFY_BLOCK_CRC defaults to 1),
# which for a CD image is a 19,584-byte pass per hunk on top of the codec.
# Slicing-by-4 folds four bytes per iteration from three derived tables; same
# polynomial, same result, 1.5 kB more .rodata, plain C so every target gains.
# Measured on the DE10-Nano: 299.6 -> 127.0 us per hunk (2.36x), and end to end
# through chd_read() the audio hunks of a Sonic CD .chd go p50 2,212 -> 1,894 us
# and p90 2,698 -> 2,176 us. Verified byte-exact: all 31,984 hunks decode with 0
# failures and an unchanged FNV-1a over every decoded byte. Rebased 2026-08-24
# onto this pin's crc16_update() split (upstream's CHDR_LOWRAM_MAP work made
# the CRC continuable; the slicing loop is initial-value-agnostic so it drops
# in unchanged -- see the patch's rebase note). Drop 0005 when upstream
# carries it. The gap in the numbering is deliberate, not an error: 0004 was
# dropped as upstreamed (above) and renaming this file would orphan its
# history and every reference to it.
# FORMER PATCH 0005 (crc16 slicing-by-4) WAS DROPPED 2026-09-15, exactly
# as its own instruction said to ("Drop 0005 when upstream carries it"):
# upstream landed the same four-bytes-per-iteration rewrite of
# crc16_update() in commit e24e526be8 ("Fold four bytes per iteration in
# the hunk CRC", merged via rtissera/libchdr PR #180), which this pin
# carries.
# Upstream's version keeps the three companion tables and the slicing
# loop (with slightly different casts and an RV32-oriented comment), so
# the hunk failed to apply rather than applying as already-applied. The
# DE10-Nano timings (299.6 -> 127.0 us/hunk, Sonic CD audio p50 2,212 ->
# 1,894 us) live in that patch's header; recover it from git history at
# this file's 2026-09-15 change if it is ever needed again. The gaps in
# the numbering (0004 and 0005) are deliberate, not an error: both were
# dropped as upstreamed and renaming the remaining 0001-0003 files would
# orphan their history and every reference to them.
#
# ONE DEP STAYS BUNDLED, DELIBERATELY: the header-only dr_flac decoder
# (include/dr_libs/dr_flac.h) is compiled into the library by src/
Expand All @@ -64,20 +64,17 @@
# expecting zstd's CMake config package -- which Buildroot's zstd package
# (Makefile-installed, ships only libzstd.pc, no *.cmake) does not provide,
# so configure FAILS at the tag. The pin (upstream master HEAD at bump time;
# Renovate PR #115, 2026-08-24, previously 6cde534 of 2026-07-17) carries
# everything the old pin did (798a4f7's chd_read_header_core_file_callbacks
# fix included) plus, notably: the dictionary-clamp fix that used to be this
# package's patch 0004 (see above), a vendored LZMA SDK bump 25.01 -> 26.02
# -- now the SAME version as the system lzma-sdk package this build links
# instead of it -- a vendored miniz bump (also unused here; system zlib),
# and new CHDR_WANT_TESTS / CHDR_LOWRAM_MAP options, both left at their
# defaults (tests build a non-installed benchmark, exactly what the old pin
# built unconditionally; LOWRAM_MAP=OFF is the old pin's behavior).
# Version/ABI are unchanged from the tag: CMake
# this Renovate PR, 2026-09-15, previously 970a0ce) carries everything the
# older pins did (798a4f7's chd_read_header_core_file_callbacks fix, the
# dictionary-clamp fix that used to be patch 0004, vendored LZMA SDK 26.02)
# plus, notably, the crc16 slicing-by-4 that used to be this package's
# patch 0005 (see above). CHDR_WANT_TESTS / CHDR_LOWRAM_MAP stay at their
# defaults (tests build a non-installed benchmark; LOWRAM_MAP=OFF is the
# old pin's behavior). Version/ABI are unchanged from the tag: CMake
# project() still says 0.3.0, so this still produces libchdr.so.0.3 with
# SONAME libchdr.so.0 (re-verified at the 2026-08-24 bump by cross-building
# the pinned+patched source and reading the .so's SONAME).
LIBCHDR_VERSION = 970a0ce060c0aa1012b1eebba1433c9a9e8ac8b9
LIBCHDR_VERSION = 8e7b8bd32bc676b7e5c6b42fe7d2daca986c4a0d
LIBCHDR_SITE = $(call github,rtissera,libchdr,$(LIBCHDR_VERSION))
# LICENSE.txt is the standard BSD 3-clause text ("Copyright Romain
# Tisserand", the three numbered conditions, the all-caps disclaimer --
Expand Down
Loading