audioutils/lame: pin the checkout and build its AVX-512 sources - #3684
Open
casaroli wants to merge 1 commit into
Open
audioutils/lame: pin the checkout and build its AVX-512 sources#3684casaroli wants to merge 1 commit into
casaroli wants to merge 1 commit into
Conversation
The bundled encoder was checked out from lame's trunk with no revision, so every build took whatever trunk happened to be at that moment. lame's trunk grows vector tiers over time, and each one adds sources that the two build files have to name: r6655 offered AVX2 to the vector routines on 2026-07-25, and r6718 and r6720 added an AVX-512 tier on 2026-07-30. The AVX-512 sources were never listed, so sim:alsa stopped linking on x86 hosts: takehiro.c:332: undefined reference to `quantize_lines_xrpow_avx512' takehiro.c:533: undefined reference to `ix_max_avx512' takehiro.c:569: undefined reference to `count_bit_esc_avx512' vbrquantize.c:261: undefined reference to `calc_sfb_noise_x34_avx512' Pin the checkout to r6720 through a LAME_VERSION variable, as the rest of apps/ pins its third-party sources, and list the three AVX-512 files that revision provides. The pin is what keeps the two in step: the source list is maintained by hand, so it can only be correct for a known revision. The checkout is also only performed when lame/configure is absent and is never updated afterwards, so before this an unpinned tree was frozen at whatever trunk was on the day it was first built. Anyone who checked out before 2026-07-30 still links and cannot reproduce the failure, which is why this surfaced only in CI. Makefile named just vector/xmm_quantize_sub.c and none of the other vector sources, so a Make build on an x86 host fails the same way with a longer list of symbols, from SSE2 upwards. CI builds sim:alsa through CMake only, so that half was latent rather than visible. Both files now list the same nine sources under the same host condition. Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com> Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
acassis
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The bundled LAME encoder is checked out from
trunkwith no revision, so every build takes whatevertrunkhappens to be at that moment. LAME's trunk grows vector tiers over time and each one adds sources that the two build files have to name, so an unpinned checkout stops linking the day upstream adds the next one. That has now happened twice in six days:The AVX-512 sources were never listed, so
sim:alsastopped linking on x86 hosts (CI job):The first three come from r6718, the fourth from r6720. r6718 is also what starts defining
HAVE_AVX512_INTRINSICSinconfig.h, which is why the call sites and the definitions appeared together upstream — only this repository's source list was left behind.This change:
LAME_VERSIONvariable in both build files, matching how the rest ofapps/handles third-party sources. The pin is what keeps the two in step: the source list is maintained by hand, so it can only be correct for a known revision. Raising it is now a deliberate act, taken together with the source list.avx512_choose_table.c,avx512_quantize_lines.c,avx512_calc_sfb_noise.c.Makefile, which named onlyvector/xmm_quantize_sub.cand none of the other vector sources. A Make build on an x86 host fails the same way with a longer symbol list, from SSE2 upwards. CI buildssim:alsathrough CMake only, so that half was latent rather than visible. Both files now list the same nine sources under the same host condition.Worth noting for reviewers: the checkout is only performed when
lame/configureis absent and is never updated afterwards. Before this change a tree was therefore frozen at whatevertrunkwas on the day it was first built — anyone who checked out before 2026-07-30 still links and cannot reproduce the failure, which is why this surfaced only in CI.Impact
lame/checkout are untouched; the pin applies to fresh checkouts. Deleteapps/audioutils/lame/lameto move an existing tree to r6720.sim:alsalink failure on x86 hosts and makes the LAME source revision reproducible.Testing
Verified:
cmake-format --check audioutils/lame/CMakeLists.txt— clean.git diff --check— clean.tools/checkpatch.sh -c -u -m -g <base>..HEAD— ✔️ All checks pass.ifneq ($(CONFIG_HOST_X86)$(CONFIG_HOST_X86_64),)condition evaluated with GNU make for all three cases — neither symbol set,CONFIG_HOST_X86=y, andCONFIG_HOST_X86_64=y— selecting the vector group in the latter two only.libmp3lame/vectorlisting at r6720, and the four missing symbols traced to their defining files (ix_max_avx512andcount_bit_esc_avx512inavx512_choose_table.c,quantize_lines_xrpow_avx512inavx512_quantize_lines.c,calc_sfb_noise_x34_avx512inavx512_calc_sfb_noise.c).Not verified by me: I have no x86 host, so I have not linked
sim:alsawith this change — my only machines are arm64. The source list and the pin are verified by inspection against r6720 as described above, and CI covers the actual link. If a maintainer with an x86 box can confirm the build before merge, that would close the gap.One thing this change does not address:
neon_choose_table.cexists at r6720 and is not listed for any host. If LAME's configure enables NEON dispatch on an arm64 simulator host, that host would fail the same way. I have not confirmed whether it does, and did not want to add an untested condition here.PR verification self-check
Signed-off-by, andAssisted-bytrailer.cmake-formatandgit diff --check.