Fix Moonshine Linux release link error on older glibc#62
Merged
Conversation
The release build failed to link on the ubuntu-22.04 runners (glibc 2.35):
rust-lld: error: undefined symbol: __isoc23_strtol / __isoc23_strtoll / __isoc23_strtoull
>>> ... in archive libort_sys (onnxruntime static lib)
The prebuilt ONNX Runtime static library (pyke, via ort's download-binaries) is
compiled against glibc >= 2.38, which redirects strtol/strtoul/... to __isoc23_*
symbols that don't exist on glibc 2.35, so the static link fails.
Add a tiny C shim (compiled by build.rs for the moonshine feature on Linux) that
provides the __isoc23_* symbols by forwarding to the classic libc functions.
This keeps the binary linkable and runnable on older glibc, preserving the
AppImage's low glibc floor rather than raising it by building on ubuntu-24.04.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GpXWVxBBJvtRgkdMWasSH6
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.
Problem
The v0.3.0 release build failed to link on the ubuntu-22.04 runners:
The prebuilt ONNX Runtime static library (pyke, pulled in by
ort+download-binaries) is compiled against glibc ≥ 2.38, which redirectsstrtol/strtoul/… to__isoc23_*symbols. The release runners are ubuntu-22.04 (glibc 2.35), which has no such symbols, so the static link fails. (Windows builds are unaffected.)Fix
Add a tiny C shim (
src/isoc23_compat.c, compiled by a newbuild.rsfor themoonshinefeature on Linux only) that provides the__isoc23_*symbols by forwarding to the classic libc functions. This keeps the binary linkable and runnable on older glibc, preserving the AppImage's low glibc floor — rather than bumping the runners to ubuntu-24.04, which would raise the minimum glibc for all Linux users (excluding e.g. Debian 12 / Ubuntu 22.04).ccis added as a build-dependency; it's already in the graph (whisper-rs-sys), so it adds nothing to compile.Verified
build.rsno-ops when the feature is off).--features moonshine.🤖 Generated with Claude Code
https://claude.ai/code/session_01GpXWVxBBJvtRgkdMWasSH6
Generated by Claude Code