Skip to content

The Switch archive is missing zstd and tinygettext - #2477

Merged
flyinghead merged 1 commit into
flyinghead:masterfrom
WizzardSK:libnx-combined-libs
Sep 7, 2026
Merged

The Switch archive is missing zstd and tinygettext#2477
flyinghead merged 1 commit into
flyinghead:masterfrom
WizzardSK:libnx-combined-libs

Conversation

@WizzardSK

Copy link
Copy Markdown
Contributor

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:

ld: core/oslib/i18n.cpp:148: undefined reference to
    `tinygettext::Log::set_log_error_callback(void (*)(std::string const&))'
ld: core/deps/libzip/lib/zip_algorithm_zstd.c:252: undefined reference to `ZSTD_isError'

The combined target folds xxhash, chdr, zip, elf and the resources into flycast_libretro_libnx.a, and those two are not in the list: libzip's zstd backend needs libzstd_static, and core/oslib/i18n.cpp needs 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, and aarch64-none-elf-nm --defined-only on the resulting 186 MB archive now shows T ZSTD_isError and tinygettext's set_log_error_callback, neither of which was there before.

@flyinghead
flyinghead merged commit fa04b20 into flyinghead:master Sep 7, 2026
19 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants