-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Statically linked sqlite3
fails checks due to missing -lm
#128321
Comments
cc @erlend-aasland — I understand you're the expert in this area. |
This will result in over-linking when sqlite3 is used as a shared library (no pkg-config --static). |
Ah true — we could just include it during the checks but it seems like a bit of a pain. |
…ents (#128322) Co-authored-by: Erlend E. Aasland <erlend@python.org>
…quirements (pythonGH-128322) (cherry picked from commit 81376fe) Co-authored-by: Zanie Blue <contact@zanie.dev> Co-authored-by: Erlend E. Aasland <erlend@python.org>
…quirements (pythonGH-128322) (cherry picked from commit 81376fe) Co-authored-by: Zanie Blue <contact@zanie.dev> Co-authored-by: Erlend E. Aasland <erlend@python.org>
Bug report
Bug description:
On Linux, if I build a static version of sqlite3 (e.g.,
./configure --disable-shared && make
from a sqlite3 tarball)You can see that
./configure
for CPython fails the SQLite checks (added back in #30016):And in the
config.log
there are a bunch of failures due to undefined references to functions in libm, e.g.:CPython is determing SQLite's requirements via
pkg-config
if it can at:cpython/configure.ac
Lines 4204 to 4209 in 492b224
And
-lm
is included in thepkg-config
for the static sqlite3 build, but it's in the private libs and requires the--static
flag to be included in the--libs
output:However,
PKG_CHECK_MODULES
doesn't pass this flag. There's aPKG_CHECK_MODULES_STATIC
macro which does, but CPython doesn't seem to use this yet. The alternative is set the flag manually at configure time:which changes all the
PKG_CHECK_MODULES
calls to include the--static
flag. However, there's a missing export forLIBS
which prevents this from resolving the issue:This is "solved" with the patch:
As demonstrated by:
For context, this was reported in astral-sh/python-build-standalone#449 and some of the findings here are repeated there.
I've posted the patch in #128322
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
LIBS
instead ofLDFLAGS
during sqlite3 library build checks #128322The text was updated successfully, but these errors were encountered: