fix(build): link the split ggml archives with static whisper - #2296
Open
naanlizard wants to merge 1 commit into
Open
fix(build): link the split ggml archives with static whisper#2296naanlizard wants to merge 1 commit into
naanlizard wants to merge 1 commit into
Conversation
Static whisper splits ggml into ggml + ggml-base + ggml-cpu. whisper.pc places ggml and ggml-base before libwhisper.a on the link line, where a single-pass linker cannot resolve backward references; only ggml-cpu followed it. Test binaries surfaced the miss. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
The below is Claude-written (as is the change). Manually tested/reproduced by me
Reproduction
On current master, in a fresh build directory:
The test binaries fail to link (excerpt):
Cause
Release builds use static whisper (
OME_WHISPER_STATICdefaults to ON for Release), and whisper.cpp ships ggml as three static archives:libggml.a,libggml-base.a,libggml-cpu.a. The build only tells the linker aboutggml-cpu. The other two do appear on the link line (viawhisper.pc), but beforelibwhisper.a. A static archive placed before the code that uses it does not resolve anything.The main
OvenMediaEnginebinary links anyway, by luck:third_parties.cppcalls two ggml functions directly, which makes the linker pull in the right archives early. Any other binary that links whisper, such as the test binaries, fails.Fix
Add all three ggml archives to the link line again, after
libwhisper.a, where the linker can actually use them. Shared-whisper builds are unaffected.