usr.bin/sqlite3: link the shell against libm#383
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>
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 the change is straightforward, so I have no 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.
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="usr.bin/sqlite3/Makefile" line_range="15" />
<code_context>
SRCS= shell.c
LIBADD+= sqlite3
+LIBADD+= m
# readline
</code_context>
<issue_to_address>
**suggestion:** Use the standard LIBM variable instead of hardcoding `m` in LIBADD.
Elsewhere in the tree we link the math library via `${LIBM}` (often with a matching `DPADD+= ${LIBM}`), so using `${LIBM}` here would align with the rest of the build system and avoid hardcoding the library name.
```suggestion
DPADD+= ${LIBM}
LIBADD+= ${LIBM}
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| SRCS= shell.c | ||
|
|
||
| LIBADD+= sqlite3 | ||
| LIBADD+= m |
There was a problem hiding this comment.
suggestion: Use the standard LIBM variable instead of hardcoding m in LIBADD.
Elsewhere in the tree we link the math library via ${LIBM} (often with a matching DPADD+= ${LIBM}), so using ${LIBM} here would align with the rest of the build system and avoid hardcoding the library name.

Companion to #381 (stable/4.0) and #382 (master).
stable/4.1'susr.bin/sqlite3/Makefileis identical and has the same link failure.Problem
The sqlite3 shell's
generate_seriesextension (seriesCeil/seriesFloorin
contrib/sqlite3/shell.c) referencesceil()/floor(), which resolve tolibm under the PIE shell link; the Makefile linked only
libsqlite3:Fix
LIBADD+= m. Verified locally:cd usr.bin/sqlite3 && makelinks cleanly with-lm.🤖 Generated with Claude Code
Summary by Sourcery
Bug Fixes: