usr.bin/sqlite3: link the shell against libm by laffer1 · Pull Request #382 · MidnightBSD/src · GitHub
Skip to content

usr.bin/sqlite3: link the shell against libm#382

Merged
laffer1 merged 1 commit into
masterfrom
fix/sqlite3-shell-libm-master
Jun 12, 2026
Merged

usr.bin/sqlite3: link the shell against libm#382
laffer1 merged 1 commit into
masterfrom
fix/sqlite3-shell-libm-master

Conversation

@laffer1

@laffer1 laffer1 commented Jun 12, 2026

Copy link
Copy Markdown
Member

Companion to the stable/4.0 fix (#381). master's usr.bin/sqlite3/Makefile
is identical and has the same latent link failure.

Problem

The sqlite3 shell's generate_series extension (seriesCeil/seriesFloor
in contrib/sqlite3/shell.c) references ceil()/floor(), which resolve to
libm under the PIE shell link. The Makefile linked only libsqlite3:

ld: error: undefined symbol: ceil
ld: error: undefined symbol: floor   >>> shell.pieo:(seriesFilter)
*** [sqlite3.full] Error code 1

Fix

LIBADD+= m. Verified: cd usr.bin/sqlite3 && make links cleanly with -lm.

🤖 Generated with Claude Code

Summary by Sourcery

Link the sqlite3 shell binary against libm to resolve unresolved math symbol references in the generate_series extension.

Bug Fixes:

  • Fix sqlite3 shell link failures caused by unresolved ceil() and floor() symbols when building with PIE.

Build:

  • Add libm to the sqlite3 shell link libraries in usr.bin/sqlite3/Makefile.

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>
@sourcery-ai

sourcery-ai Bot commented Jun 12, 2026

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

@laffer1 laffer1 merged commit bc83826 into master Jun 12, 2026
7 of 13 checks passed

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@laffer1 laffer1 deleted the fix/sqlite3-shell-libm-master branch June 15, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant