Repository navigation
Link the CLI's libraries after its archives - #22
Merged
Merged
Conversation
GNU ld resolves symbols left to right, so with -ldl -lm ahead of the archives, the sqrt, pow and ceil calls in sqlite-vec.a went unresolved and make cli failed on Linux. photostructure/sqlite-vec@9db2489 links the libraries last; asg017#304 does the same upstream.
This was referenced Oct 23, 2026
Merged
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.
make clifails to link on Linux:The CLI rule passes
-ldl -lmbeforecore_init.cand the.aarchives. GNU ld resolves symbols left to right, so by the time it readssqlite-vec.a, libm has already been passed over, and the archive's calls tosqrt(6),ceil(2) andpow(1) stay unresolved. macOS's linker does not depend on the order, and the release workflow builds the CLI only with cosmocc, so CI never hits it.This PR moves
-ldl -lmafter the archives, the order photostructure/sqlite-vec@9db2489 uses. Upstream, asg017#281 makes this same change to the CLI rule, and asg017#304 moves the link libraries after the inputs on every link line.Test. On Linux arm64 with GCC 14,
make clion main fails as above; on this branch it buildsdist/sqlite3, which runsselect vec_version()and a KNN query over avec0table. It merges cleanly with #9 to #14 and #17 to #21.