The Switch archive is missing zstd and tinygettext - #2477
Merged
Conversation
WizzardSK
added a commit
to WizzardSK/flycast-libretro
that referenced
this pull request
Sep 7, 2026
Since flyinghead#2477 put zstd in the combined archive, the libnx job fails at the final link with `undefined reference to XXH32` - the symbol went missing from an archive that extracts xxHash first. ar names a member after the basename of its object, and zstd builds its own vendored copy of xxhash.c, namespaced to ZSTD_. Both archives therefore carry a member called xxhash.c.o, and extracting them into one directory leaves only the second: zstd's, which defines ZSTD_XXH32 and nothing the core calls. Extracting each archive into a directory of its own keeps every object, whatever it is called. Reproduced and checked with a CMake project of the same shape, two static libraries whose members collide: flat, as now: core_main, ZSTD_XXH32 a directory each: core_main, ZSTD_XXH32, XXH32 Not run on the buildbot - the Switch toolchain is not something I have here.
flyinghead
pushed a commit
that referenced
this pull request
Sep 8, 2026
Since #2477 put zstd in the combined archive, the libnx job fails at the final link with `undefined reference to XXH32` - the symbol went missing from an archive that extracts xxHash first. ar names a member after the basename of its object, and zstd builds its own vendored copy of xxhash.c, namespaced to ZSTD_. Both archives therefore carry a member called xxhash.c.o, and extracting them into one directory leaves only the second: zstd's, which defines ZSTD_XXH32 and nothing the core calls. Extracting each archive into a directory of its own keeps every object, whatever it is called. Reproduced and checked with a CMake project of the same shape, two static libraries whose members collide: flat, as now: core_main, ZSTD_XXH32 a directory each: core_main, ZSTD_XXH32, XXH32 Not run on the buildbot - the Switch toolchain is not something I have here.
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.
With the CMake version sorted out (#2476), the Switch job now compiles the whole tree and gets as far as RetroArch's link, which is where pipeline 108657 stops:
The
combinedtarget folds xxhash, chdr, zip, elf and the resources intoflycast_libretro_libnx.a, and those two are not in the list: libzip's zstd backend needslibzstd_static, andcore/oslib/i18n.cppneeds tinygettext. On every other target they come in as ordinary link libraries; on Switch RetroArch links a single archive, so anything not folded in is simply absent. My own omission from #2471 - I built the archive but never got to see the link that consumes it.Verified on GitHub Actions in
devkitpro/devkita64: the target builds, andaarch64-none-elf-nm --defined-onlyon the resulting 186 MB archive now showsT ZSTD_isErrorand tinygettext'sset_log_error_callback, neither of which was there before.