usr.bin/sqlite3: link the shell against libm (fixes stable/4.0 build) - #381
Conversation
The sqlite3 shell's generate_series extension (seriesCeil/seriesFloor in
contrib/sqlite3/shell.c) references ceil() and floor(); under the PIE
shell link these resolve to libm symbols. The Makefile only linked
libsqlite3, so sqlite3.full failed with:
ld: error: undefined symbol: ceil
ld: error: undefined symbol: floor
>>> referenced by shell.c ... seriesFilter
Add LIBADD+= m. Verified: usr.bin/sqlite3 now builds and links cleanly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR fixes a link failure for the sqlite3 shell on stable/4.0 by explicitly linking the binary against libm, ensuring math functions used by the generate_series extension resolve correctly under PIE. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Code Review
This pull request updates the Makefile for the sqlite3 utility to link against the math library by adding LIBADD+= m. There are no review comments, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Problem
stable/4.0buildworld fails linking the sqlite3 shell:Cause
contrib/sqlite3/shell.c'sgenerate_seriesextension definesseriesCeil()/seriesFloor()usingceil()/floor(). Under the PIE shelllink those resolve to libm symbols, but
usr.bin/sqlite3/Makefilelinkedonly
libsqlite3(LIBADD+= sqlite3).Fix
LIBADD+= m.Verification
cd usr.bin/sqlite3 && makenow builds clean β the link picks up-lm(
.../lib/msun -lm) andsqlite3.fulllinks/strips successfully.Note:
master'susr.bin/sqlite3/Makefileis identical (no libm) and likelyneeds the same change; happy to send a companion PR.
π€ Generated with Claude Code
Summary by Sourcery
Build: